changeset d9b582ad6099 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=d9b582ad6099
description:
        Build 32 and 64 bit windows setup

        issue8914
        review250371002
diffstat:

 make-win32-installer.sh |   3 ++-
 setup.nsi               |  38 +++++++++++++++++++++-----------------
 2 files changed, 23 insertions(+), 18 deletions(-)

diffs (117 lines):

diff -r 8ab813be46f3 -r d9b582ad6099 make-win32-installer.sh
--- a/make-win32-installer.sh   Sat Feb 29 23:36:28 2020 +0100
+++ b/make-win32-installer.sh   Sat Feb 29 23:37:07 2020 +0100
@@ -2,7 +2,8 @@
 set -e
 version=`./setup.py --version`
 series=${version%.*}
+bits=`python -c "import platform; print(platform.architecture()[0])"`
 rm -rf build dist
 ./setup.py compile_catalog
 ./setup-freeze.py install_exe -d dist
-makensis -DVERSION=${version} -DSERIES=${series} setup.nsi
+makensis -DVERSION=${version} -DSERIES=${series} -DBITS=${bits} setup.nsi
diff -r 8ab813be46f3 -r d9b582ad6099 setup.nsi
--- a/setup.nsi Sat Feb 29 23:36:28 2020 +0100
+++ b/setup.nsi Sat Feb 29 23:37:07 2020 +0100
@@ -9,24 +9,28 @@
 !ifndef SERIES
     !error "Missing SERIES! Specify if with '/DSERIES=<SERIES>'"
 !endif
+;Check bits
+!ifndef BITS
+    !error "Missing BITS! Specify it with '/DBITS=<BITS>'"
+!endif
 
 ;Include Modern UI
 !include "MUI.nsh"
 
 ;General
-Name "Tryton ${VERSION}"
-OutFile "tryton-${VERSION}.exe"
+Name "Tryton ${BITS} ${VERSION}"
+OutFile "tryton-${BITS}-${VERSION}.exe"
 SetCompressor lzma
 SetCompress auto
 Unicode true
 
 ;Default installation folder
-InstallDir "$PROGRAMFILES\Tryton-${SERIES}"
+InstallDir "$PROGRAMFILES\Tryton-${BITS}-${SERIES}"
 
 ;Get installation folder from registry if available
-InstallDirRegKey HKCU "Software\Tryton-${SERIES}" ""
+InstallDirRegKey HKCU "Software\Tryton-${BITS}-${SERIES}" ""
 
-BrandingText "Tryton ${SERIES}"
+BrandingText "Tryton ${BITS} ${SERIES}"
 
 ;Vista redirects $SMPROGRAMS to all users without this
 RequestExecutionLevel admin
@@ -85,14 +89,14 @@
 ;Installer Sections
 Function .onInit
     ClearErrors
-    ReadRegStr $0 HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${SERIES}" 
"UninstallString"
+    ReadRegStr $0 HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${BITS}-${SERIES}" 
"UninstallString"
     StrCmp $0 "" DoInstall
 
     MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "$(PreviousInstall)" /SD IDOK 
IDOK Uninstall
     Quit
 
     Uninstall:
-        ReadRegStr $1 HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${SERIES}" 
"InstallLocation"
+        ReadRegStr $1 HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${BITS}-${SERIES}" 
"InstallLocation"
         ClearErrors
         StrCpy $2 "/S"
         IfSilent +2
@@ -124,12 +128,12 @@
     WriteRegStr HKCR "tryton\shell\open\command" "" '$INSTDIR\tryton.exe "%1"'
 
     ;Write the installation path into the registry
-    WriteRegStr HKLM "Software\Tryton-${SERIES}" "" $INSTDIR
+    WriteRegStr HKLM "Software\Tryton-${BITS}-${SERIES}" "" $INSTDIR
 
     ;Write the uninstall keys for Windows
-    WriteRegStr HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${SERIES}" 
"DisplayName" "Tryton ${VERSION} (remove only)"
-    WriteRegStr HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${SERIES}" 
"UninstallString" "$INSTDIR\uninstall.exe"
-    WriteRegStr HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${SERIES}" 
"InstallLocation" "$INSTDIR"
+    WriteRegStr HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${BITS}-${SERIES}" 
"DisplayName" "Tryton ${BITS} ${VERSION} (remove only)"
+    WriteRegStr HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${BITS}-${SERIES}" 
"UninstallString" "$INSTDIR\uninstall.exe"
+    WriteRegStr HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${BITS}-${SERIES}" 
"InstallLocation" "$INSTDIR"
 
     ;Create the uninstaller
     WriteUninstaller uninstall.exe
@@ -143,8 +147,8 @@
 
         CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
         CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" 
"$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
-        CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Tryton-${SERIES}.lnk" 
"$INSTDIR\tryton.exe" "" "$INSTDIR\tryton.exe" 0
-        CreateShortCut "$DESKTOP\Tryton-${SERIES}.lnk" "$INSTDIR\tryton.exe" 
"" "$INSTDIR\tryton.exe" 0
+        CreateShortCut 
"$SMPROGRAMS\$STARTMENU_FOLDER\Tryton-${BITS}-${SERIES}.lnk" 
"$INSTDIR\tryton.exe" "" "$INSTDIR\tryton.exe" 0
+        CreateShortCut "$DESKTOP\Tryton-${BITS}-${SERIES}.lnk" 
"$INSTDIR\tryton.exe" "" "$INSTDIR\tryton.exe" 0
 
     !insertmacro MUI_STARTMENU_WRITE_END
 
@@ -161,17 +165,17 @@
     RMDIR /r "$INSTDIR"
 
     ;remove registry keys
-    DeleteRegKey HKLM "Software\Tryton-${SERIES}"
-    DeleteRegKey HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${SERIES}"
+    DeleteRegKey HKLM "Software\Tryton-${BITS}-${SERIES}"
+    DeleteRegKey HKLM 
"Software\Microsoft\Windows\CurrentVersion\Uninstall\tryton-${BITS}-${SERIES}"
 
     SetShellVarContext all
-    Delete "$DESKTOP\Tryton-${SERIES}.lnk"
+    Delete "$DESKTOP\Tryton-${BITS}-${SERIES}.lnk"
 
     !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
 
     StrCmp $MUI_TEMP "" noshortcuts
         Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
-        Delete "$SMPROGRAMS\$MUI_TEMP\Tryton-${SERIES}.lnk"
+        Delete "$SMPROGRAMS\$MUI_TEMP\Tryton-${BITS}-${SERIES}.lnk"
         RMDir "$SMPROGRAMS\$MUI_TEMP"
     noshortcuts:
 

Reply via email to