Skip to content

Commit

Permalink
Merge pull request #286 from RoDuth/ghini-1.0-wininstaller
Browse files Browse the repository at this point in the history
windows installer
  • Loading branch information
mfrasca authored Oct 13, 2017
2 parents 9d3ecf3 + cb51841 commit 96cefb3
Show file tree
Hide file tree
Showing 11 changed files with 750 additions and 54 deletions.
9 changes: 9 additions & 0 deletions bauble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]>
# Copyright (c) 2012-2016 Mario Frasca <[email protected]>
# Copyright (c) 2016 Ross Demuth <[email protected]>
#
# This file is part of ghini.desktop.
#
Expand Down Expand Up @@ -217,6 +218,14 @@ def main(uri=None):
if not os.path.exists(paths.appdata_dir()):
os.makedirs(paths.appdata_dir())

# a hack to write stderr and stdout to a file in a py2exe environment
# prevents failed attempts at creating ghini.exe.log
if main_is_frozen():
_stdout = os.path.join(paths.user_dir(), 'stdout.log')
_stderr = os.path.join(paths.user_dir(), 'stderr.log')
sys.stdout = open(_stdout, 'w')
sys.stderr = open(_stderr, 'w')

# add console root handler, and file root handler, set it at the logging
# level specified by BAUBLE_LOGGING, or at INFO level.
filename = os.path.join(paths.appdata_dir(), 'bauble.log')
Expand Down
11 changes: 9 additions & 2 deletions bauble/connmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright 2008-2010 Brett Adams
# Copyright 2015-2016 Mario Frasca <[email protected]>.
# Copyright 2016 Ross Demuth <[email protected]>
#
# This file is part of ghini.desktop.
#
Expand Down Expand Up @@ -223,9 +224,15 @@ def __init__(self, view=None):
except:
pass

from threading import Thread
self.start_thread(Thread(target=check_and_notify_new_version,
from bauble import main_is_frozen
# Don't check for new versions if we are in a py2exe environment
if main_is_frozen():
pass
else:
from threading import Thread
self.start_thread(Thread(target=check_and_notify_new_version,
args=[self.view]))
logger.debug('main_is_frozen = %s' % (main_is_frozen()))

def on_file_btnbrowse_clicked(self, *args):
previously = self.view.widget_get_value('file_entry')
Expand Down
Binary file added bauble/images/ghini_logo.bmp
Binary file not shown.
Binary file modified bauble/images/icon.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion bauble/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright (c) 2005,2006,2007,2008,2009 Brett Adams <[email protected]>
# Copyright (c) 2012-2016 Mario Frasca <[email protected]>
# Copyright (c) 2016 Ross Demuth <[email protected]>
#
# This file is part of ghini.desktop.
#
Expand Down Expand Up @@ -89,7 +90,7 @@ def installation_dir():
elif sys.platform == 'win32':
# main_dir is the location of the scripts, which is located in the
# installation_dir:
d = os.path.dirname(main_dir())
d = main_dir()
else:
raise NotImplementedError('This platform does not support '
'translations: %s' % sys.platform)
Expand Down
9 changes: 8 additions & 1 deletion bauble/utils/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright 2008-2010 Brett Adams
# Copyright 2014-2017 Mario Frasca <[email protected]>.
# Copyright 2016 Ross Demuth <[email protected]>
#
# This file is part of ghini.desktop.
#
Expand Down Expand Up @@ -31,7 +32,13 @@


def _open_link(func, data=None):
desktop.open(data)
# windows generates odd characters in the uri unless its in ascii
import sys
if sys.platform == 'win32' :
udata=data.decode("utf-8")
asciidata=udata.encode("ascii","ignore")
desktop.open(asciidata)
else : desktop.open(data)

gtk.link_button_set_uri_hook(_open_link)

Expand Down
31 changes: 31 additions & 0 deletions scripts/Add_to_PATH.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
' -Copyright (c) 2016,2017 Ross Demuth <[email protected]>
'
' This file is part of ghini.desktop.
'
' ghini.desktop is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' ghini.desktop is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
' GNU General Public License for more details.
'
' You should have received a copy of the GNU General Public License
' along with ghini.desktop. If not, see <http://www.gnu.org/licenses/>.

' a simple script used by the nsis installer to prepend to the PATH
' EXAMPLES:
' cscript.exe Add_to_PATH.vbs /path:"C:\TEST" /env:"USER"
' cscript.exe //E:vbscript Add_to_PATH.vbs /env:"SYSTEM" /path:"C:\TEST\"

Dim wshShell : Set wshShell = CreateObject("WScript.Shell")
Dim strPathToAdd : strPathToAdd = WScript.Arguments.Named("path")
Dim strEnv : strEnv = WScript.Arguments.Named("env")

Dim wshSysEnv : Set wshSysEnv = wshShell.Environment(strEnv)
Dim strCurrentPath : strCurrentPath = wshSysEnv("PATH")

Dim strNewPath : strNewPath = strPathToAdd & ";" & strCurrentPath
wshSysEnv("PATH") = strNewPath
Loading

0 comments on commit 96cefb3

Please sign in to comment.