Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghini 1.0 wininstaller #294

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bauble/utils/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@



def _open_link(func, data=None):
def _open_link(data=None):
"""Open a web link"""
# 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")
udata = data.decode("utf-8")
asciidata = udata.encode("ascii", "ignore")
desktop.open(asciidata)
else:
desktop.open(data)
Expand Down
File renamed without changes.
32 changes: 16 additions & 16 deletions scripts/build-multiuser.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
; Global
Name "ghini.desktop"
!define VERSION "1.0.75" ; :bump
!define src_dir "..\dist"
!define SRC_DIR "..\dist"
!define PRODUCT_NAME "ghini.desktop"
Outfile "${PRODUCT_NAME}-${VERSION}-setup.exe"
!define PROGEXE "ghini.exe"
!define COMPANY_NAME ""
!define license_file "LICENSE"
!define readme "README.rst"
!define startmenu "$SMPROGRAMS\${PRODUCT_NAME}"
!define LICENSE_FILE "LICENSE"
!define README "README.rst"
!define START_MENU "$SMPROGRAMS\${PRODUCT_NAME}"
!define UNINSTALL_FILENAME "uninstall.exe"

; FOP
Expand Down Expand Up @@ -113,11 +113,11 @@ CRCCheck on
; Modern User Interface v2 Settings
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!define MUI_ICON "${src_dir}\bauble\images\icon.ico"
!define MUI_UNICON "${src_dir}\bauble\images\icon.ico"
!define MUI_ICON "${SRC_DIR}\bauble\images\icon.ico"
!define MUI_UNICON "${SRC_DIR}\bauble\images\icon.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${src_dir}\bauble\images\ghini_logo.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "${src_dir}\bauble\images\ghini_logo.bmp"
!define MUI_HEADERIMAGE_BITMAP "${SRC_DIR}\bauble\images\ghini_logo.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "${SRC_DIR}\bauble\images\ghini_logo.bmp"
!define MUI_HEADERIMAGE_RIGHT
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "Or, select the optional components you wish to install: \
Expand Down Expand Up @@ -149,7 +149,7 @@ CRCCheck on
; PAGES

; Installer
!insertmacro MUI_PAGE_LICENSE "${src_dir}\${license_file}"
!insertmacro MUI_PAGE_LICENSE "${SRC_DIR}\${LICENSE_FILE}"
!insertmacro MULTIUSER_PAGE_INSTALLMODE
; this will show the 2 install options, unless it's an elevated inner process
; (in that case we know we should install for all users)
Expand Down Expand Up @@ -196,16 +196,16 @@ Section "!Ghini.desktop" SecMain
SetOverwrite on
; package all files, recursively, preserving attributes
; assume files are in the correct places
File /a /r "${src_dir}\*.*"
File /a /r "${SRC_DIR}\*.*"

; Create uninstaller
WriteUninstaller "$INSTDIR\${UNINSTALL_FILENAME}"

; add registry keys
!insertmacro MULTIUSER_RegistryAddInstallInfo
; create shortcuts
CreateDirectory "${startmenu}"
CreateShortcut "${startmenu}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PROGEXE}" \
CreateDirectory "${START_MENU}"
CreateShortcut "${START_MENU}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PROGEXE}" \
"" "$INSTDIR\${PROGEXE}" "" SW_SHOWNORMAL \
"" "Ghini biodiversity collection manager"
; desktop shortcut
Expand Down Expand Up @@ -415,11 +415,11 @@ UninstallText "This will uninstall ${PRODUCT_NAME}."
Section "Uninstall" SecUnMain
; Remove registry keys
!insertmacro MULTIUSER_RegistryRemoveInstallInfo
Delete "${startmenu}\*.*"
Delete "${START_MENU}\*.*"
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
SetOutPath $TEMP
RMDir /r "$INSTDIR"
RMDir /r "${startmenu}"
RMDir /r "${START_MENU}"
SectionEnd


Expand Down Expand Up @@ -479,8 +479,8 @@ Function AddFOPtoPATH
; copy the script to a temp dir
SetOutPath "$PLUGINSDIR\"
SetOverwrite on
File /a "Add_to_PATH.vbs"
ExecWait '"$SYSDIR\wscript.exe" //E:vbscript "$PLUGINSDIR\Add_to_PATH.vbs" /path:"$R0\fop-${FOP_VERSION}\" /env:"$R1"'
File /a "add_to_path.vbs"
ExecWait '"$SYSDIR\wscript.exe" //E:vbscript "$PLUGINSDIR\add_to_path.vbs" /path:"$R0\fop-${FOP_VERSION}\" /env:"$R1"'
DetailPrint "Apache FOP added to $R1 PATH as: $R0\fop-${FOP_VERSION}\"
SetRebootFlag True
DetailPrint "Reboot flag = True"
Expand Down
3 changes: 2 additions & 1 deletion scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def bump_nsi_file(filename, varname='version'):
bump_py_file(os.path.join(root_of_clone(), 'doc/conf.py'), 'release')
bump_desktop_file(os.path.join(root_of_clone(), 'data/ghini.desktop'))
bump_nsi_file(os.path.join(root_of_clone(), 'scripts/build.nsi'))
bump_nsi_file(os.path.join(root_of_clone(), 'scripts/build-multiuser.nsi'), 'VERSION')
bump_nsi_file(os.path.join(root_of_clone(), 'scripts/build-multiuser.nsi'),
'VERSION')

rx = "(^VERSION=\").*?\..*?\..*?(\".*?%s.*?$)" % bump_tag
bump_file(os.path.join(root_of_clone(), 'packages/builddeb.sh'), rx)
Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@
exclude=['test', 'bauble.*.test', 'ghini.*.test'])
plugins_pkgs = ['bauble.plugins.%s' % p for p in plugins]
all_packages = setuptools.find_packages(exclude=['test', 'bauble.*.test',
'ghini.*.test'])
'ghini.*.test'])

package_data = {'': ['README.rst', 'CHANGES', 'LICENSE'],
'bauble': ['*.ui', '*.glade', 'images/*.png', 'pixmaps/*.png',
'images/*.svg', 'images/*.gif', 'images/*.ico', 'images/*.bmp']}
'bauble': ['*.ui', '*.glade', 'images/*.png', 'pixmaps/*.png',
'images/*.svg', 'images/*.gif', 'images/*.ico',
'images/*.bmp']}

# ceate a list of the data patterns to look for in the packages
data_patterns = ['default/*.txt', '*.ui', '*.glade', '*.xsl', '*.xsd',
Expand All @@ -85,8 +86,9 @@
sqlalchemy_includes = ['sqlalchemy.dialects.sqlite',
'sqlalchemy.dialects.postgresql']
py2exe_includes = ['sqlite3', 'lxml', 'gdata', 'fibra', 'psycopg2',
'encodings', 'mako', 'mako.cache', 'pygments.styles.default',
'pyparsing'] + gtk_pkgs + plugins_pkgs + sqlalchemy_includes
'encodings', 'mako', 'mako.cache',
'pygments.styles.default', 'pyparsing']
py2exe_includes += gtk_pkgs + plugins_pkgs + sqlalchemy_includes
py2exe_setup_args = {
'windows': [{'script': 'scripts/ghini',
'icon_resources': [(1, "bauble/images/icon.ico")]}]}
Expand All @@ -105,7 +107,7 @@
"libgtk-win32-2.0-0.dll", "libpango-1.0-0.dll",
"libpangowin32-1.0-0.dll", "libxml2-2.dll",
# windows dlls
"DNSAPI.DLL","MSIMG32.DLL", "Secur32.dll", "SHFOLDER.dll",
"DNSAPI.DLL", "MSIMG32.DLL", "Secur32.dll", "SHFOLDER.dll",
"CRYPT32.dll", "MPR.dll"
]
}
Expand Down Expand Up @@ -176,8 +178,8 @@ def run(self):
file_util.copy_file(gtheme, dest)

# copy LICENSE to dist\share\LICENSE.ghini (for help>about)
file_util.copy_file("LICENSE",
os.path.join(self.dist_dir, 'share', 'LICENSE.ghini'))
file_util.copy_file("LICENSE", os.path.join(self.dist_dir, 'share',
'LICENSE.ghini'))

class nsis_cmd(Command):
# 1. copy the gtk dist to the dist directory
Expand Down Expand Up @@ -423,7 +425,7 @@ def run(self):
scripts = ["scripts/ghini"]
if sys.platform == 'win32':
scripts = ["scripts/ghini", "scripts/ghini.bat", "scripts/ghini.vbs",
"scripts/ghini-update.bat"]
"scripts/ghini-update.bat"]

# TODO: images in bauble/images should really be in data and copied as
# package_data or data_files
Expand Down