From 03eac47f5de0b070ddaaca8700f18ee36efbffd1 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 18 Mar 2018 09:44:34 +0100 Subject: [PATCH] Bump to msi installer --- CLIENT_DATA/delsub3264.ins | 60 +++++++++++++++----------------- CLIENT_DATA/setup3264.ins | 14 ++++---- CLIENT_DATA/uninstall3264.ins | 8 ++--- builder-product.cfg | 23 ++++++------ peazip-6.5.1.WIN64.Msi.sha1sum | 1 + peazip-6.5.1.WIN64.exe.sha1sum | 1 - peazip-6.5.1.WINDOWS.exe.sha1sum | 1 - peazip-6.5.1.WINDOWS.msi.sha1sum | 1 + 8 files changed, 51 insertions(+), 58 deletions(-) create mode 100644 peazip-6.5.1.WIN64.Msi.sha1sum delete mode 100644 peazip-6.5.1.WIN64.exe.sha1sum delete mode 100644 peazip-6.5.1.WINDOWS.exe.sha1sum create mode 100644 peazip-6.5.1.WINDOWS.msi.sha1sum diff --git a/CLIENT_DATA/delsub3264.ins b/CLIENT_DATA/delsub3264.ins index 93da5a3..c0fdcce 100644 --- a/CLIENT_DATA/delsub3264.ins +++ b/CLIENT_DATA/delsub3264.ins @@ -4,10 +4,8 @@ ; credits: http://www.opsi.org/en/credits/ -Set $UninstallProgram32$ = $InstallDir32$ + "\" + $UninstallProg32$ Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini" -Set $UninstallProgram64$ = $InstallDir64$ + "\" + $UninstallProg64$ Set $IniFile64$ = $InstallDir64$ + "\opsi-" + $ProductId$ + ".ini" if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") @@ -19,20 +17,19 @@ if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specif Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 32 Bit..." if FileExists($IniFile32$) - Set $UninstallProg32$ = GetValueFromInifile($IniFile32$,"X86","UninstallProg32","XXXXXXXX.exe") - Set $UninstallProgramOld32$ = $InstallDir32$ + "\" + $UninstallProg32$ - if FileExists($UninstallProgramOld32$) - comment "Uninstall program found, starting uninstall" - Winbatch_uninstall_old_32 - sub_check_exitcode - endif + Set $MsiIdOld32$ = GetValueFromInifile($IniFile32$,"X86","MsiId32","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld32$ + "] DisplayName") = "") + comment "Old MSI id " + $MsiIdOld32$ + " found in registry, starting msiexec to uninstall old version" + Winbatch_uninstall_msi_old_32 + sub_check_exitcode + endif endif - if FileExists($UninstallProgram32$) - comment "Uninstall program found, starting uninstall" - Winbatch_uninstall_32 + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32$ + "] DisplayName") = "") + comment "MSI id " + $MsiId32$ + " found in registry, starting msiexec to uninstall" + Winbatch_uninstall_msi_32 sub_check_exitcode endif - + comment "Delete files" Files_uninstall_32 /32Bit comment "Cleanup registry" @@ -48,20 +45,19 @@ if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system spe Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " 64 Bit..." if FileExists($IniFile64$) - Set $UninstallProg64$ = GetValueFromInifile($IniFile64$,"X86_64","UninstallProg64","XXXXXXXX.exe") - Set $UninstallProgramOld64$ = $InstallDir64$ + "\" + $UninstallProg64$ - if FileExists($UninstallProgramOld64$) - comment "Uninstall program found, starting uninstall" - Winbatch_uninstall_old_64 - sub_check_exitcode - endif + Set $MsiIdOld64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiId64","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld64$ + "] DisplayName") = "") + comment "Old MSI id " + $MsiIdOld64$ + " found in registry, starting msiexec to uninstall old version" + Winbatch_uninstall_msi_old_64 + sub_check_exitcode + endif endif - if FileExists($UninstallProgram64$) - comment "Uninstall program found, starting uninstall" - Winbatch_uninstall_64 + if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId64$ + "] DisplayName") = "") + comment "MSI id " + $MsiId64$ + " found in registry, starting msiexec to uninstall" + Winbatch_uninstall_msi_64 sub_check_exitcode endif - + comment "Delete files" Files_uninstall_64 /64Bit comment "Cleanup registry" @@ -71,22 +67,22 @@ endif comment "Delete program shortcuts" LinkFolder_uninstall -[Winbatch_uninstall_old_32] -"$UninstallProgramOld32$" /SILENT +[Winbatch_uninstall_msi_old_32] +msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress -[Winbatch_uninstall_32] -"$UninstallProgram32$" /SILENT +[Winbatch_uninstall_msi_32] +msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress [Files_uninstall_32] ; Example for recursively deleting the installation directory (don't forget the trailing backslash): ; delete -sf "$InstallDir32$\" -[Winbatch_uninstall_old_64] -"$UninstallProgramOld64$" /SILENT +[Winbatch_uninstall_msi_old_64] +msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress -[Winbatch_uninstall_64] -"$UninstallProgram64$" /SILENT +[Winbatch_uninstall_msi_64] +msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress [Files_uninstall_64] ; Example for recursively deleting the installation directory: diff --git a/CLIENT_DATA/setup3264.ins b/CLIENT_DATA/setup3264.ins index 4b2ca9e..9cf1215 100644 --- a/CLIENT_DATA/setup3264.ins +++ b/CLIENT_DATA/setup3264.ins @@ -6,11 +6,9 @@ [Actions] requiredWinstVersion >= "4.11.2.6" -DefVar $UninstallProgram32$ -DefVar $UninstallProgramOld32$ +DefVar $MsiIdOld32$ DefVar $IniFile32$ -DefVar $UninstallProgram64$ -DefVar $UninstallProgramOld64$ +DefVar $MsiIdOld64$ DefVar $IniFile64$ DefVar $IniCfgFile$ DefVar $LogDir$ @@ -46,7 +44,7 @@ Set $LogDir$ = "%SystemDrive%\tmp" ;$ProductId$ should be the name of the product in opsi ; therefore please: only lower letters, no umlauts, ; no white space use '-' as a seperator -Set $MinimumSpace$ = "15 MB" +Set $MinimumSpace$ = "20 MB" ; the path were we find the product after the installation Set $InstallDir32$ = "%ProgramFiles32Dir%\PeaZip" Set $InstallDir64$ = "%ProgramFiles64Dir%\PeaZip" @@ -84,7 +82,7 @@ else endif if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) - Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 64 Bit..." + Message "Installing " + $ProductId$ + " " + $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " 64 Bit..." comment "Start setup program" ChangeDirectory "%SCRIPTPATH%" Winbatch_install_64 @@ -100,7 +98,7 @@ else endif [Winbatch_install_32] -"$Install32Exe$" /SILENT +msiexec /i "$Instal32Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress [Files_install_32] ; copy the ini file to the InstallDir @@ -111,7 +109,7 @@ copy "$IniCfgFile$" "$InstallDir32$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$" [Winbatch_install_64] -"$Install64Exe$" /SILENT +msiexec /i "$Install64Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress [Files_install_64] ; copy the ini file to the InstallDir diff --git a/CLIENT_DATA/uninstall3264.ins b/CLIENT_DATA/uninstall3264.ins index e1adf4a..7a1d96b 100644 --- a/CLIENT_DATA/uninstall3264.ins +++ b/CLIENT_DATA/uninstall3264.ins @@ -6,13 +6,9 @@ [Actions] requiredWinstVersion >= "4.11.2.6" -DefVar $UninstallProg32$ -DefVar $UninstallProgram32$ -DefVar $UninstallProgramOld32$ +DefVar $MsiIdOld32$ DefVar $IniFile32$ -DefVar $UninstallProg64$ -DefVar $UninstallProgram64$ -DefVar $UninstallProgramOld64$ +DefVar $MsiIdOld64$ DefVar $IniFile64$ DefVar $IniCfgFile$ DefVar $LogDir$ diff --git a/builder-product.cfg b/builder-product.cfg index 9211c81..3ea2c23 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -17,23 +17,26 @@ TYPE="public" DL_FILE[0]="peazip_2.png" DL_SOURCE[0]="http://rocketdock.com/images/screenshots/peazip_2.png" -DL_FILE[1]="peazip-${VERSION}.WINDOWS.exe" -DL_SOURCE[1]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WINDOWS.exe" +DL_FILE[1]="peazip-${VERSION}.WINDOWS.msi" +DL_SOURCE[1]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WINDOWS.msi" DL_ARCH[1]="X86" -DL_WINST_NAME[1]=Install32Exe +DL_WINST_NAME[1]=Install32Msi -DL_FILE[2]="peazip-${VERSION}.WIN64.exe" -DL_SOURCE[2]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WIN64.exe" +DL_FILE[2]="peazip-${VERSION}.WIN64.Msi" +DL_SOURCE[2]="https://github.com/giorgiotani/PeaZip/releases/download/${VERSION}/peazip-${VERSION}.WIN64.msi" DL_ARCH[2]="X86_64" -DL_WINST_NAME[2]=Install64Exe +DL_WINST_NAME[2]=Install64Msi # File array index for the image showing while installing the program ICON_DL_INDEX=0 OPSI_INI_SECTION[0]="X86" -OPSI_INI_OPTION[0]="UninstallProg32" -OPSI_INI_VALUE[0]="unins000.exe" +OPSI_INI_OPTION[0]="MsiId32" +OPSI_INI_VALUE[0]="{9B755822-B264-4E31-933B-9C5E90E4E295}" + +# AND OPSI_INI_SECTION[1]="X86_64" -OPSI_INI_OPTION[1]="UninstallProg64" -OPSI_INI_VALUE[1]="unins000.exe" +OPSI_INI_OPTION[1]="MsiId64" +OPSI_INI_VALUE[1]="{AFCD9F92-38B4-4EE5-B746-7F7DA8D83D1D}" + diff --git a/peazip-6.5.1.WIN64.Msi.sha1sum b/peazip-6.5.1.WIN64.Msi.sha1sum new file mode 100644 index 0000000..a002259 --- /dev/null +++ b/peazip-6.5.1.WIN64.Msi.sha1sum @@ -0,0 +1 @@ +ef0eea96109506256b9d051342ce582811bb3892 /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86_64/peazip-6.5.1.WIN64.Msi diff --git a/peazip-6.5.1.WIN64.exe.sha1sum b/peazip-6.5.1.WIN64.exe.sha1sum deleted file mode 100644 index 11aedca..0000000 --- a/peazip-6.5.1.WIN64.exe.sha1sum +++ /dev/null @@ -1 +0,0 @@ -94c639cd3f12a3164b549315ba6fb5810bc588ae /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86_64/peazip-6.5.1.WIN64.exe diff --git a/peazip-6.5.1.WINDOWS.exe.sha1sum b/peazip-6.5.1.WINDOWS.exe.sha1sum deleted file mode 100644 index dc3e6fb..0000000 --- a/peazip-6.5.1.WINDOWS.exe.sha1sum +++ /dev/null @@ -1 +0,0 @@ -871cf60f8fc8d1f3dfc48390b2f0ec90bc89a821 /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86/peazip-6.5.1.WINDOWS.exe diff --git a/peazip-6.5.1.WINDOWS.msi.sha1sum b/peazip-6.5.1.WINDOWS.msi.sha1sum new file mode 100644 index 0000000..5ddf983 --- /dev/null +++ b/peazip-6.5.1.WINDOWS.msi.sha1sum @@ -0,0 +1 @@ +964e2f189318354cbf975f67c63f442368a16741 /home/mario/.opsi-dist-cache/peazip.peazip-6.5.1/X86/peazip-6.5.1.WINDOWS.msi