change package to use the new msi

This commit is contained in:
Mario Fetka 2016-08-27 09:50:31 +02:00
parent 0a60a8aa53
commit f0d8a10f32
6 changed files with 25 additions and 32 deletions

View File

@ -4,7 +4,6 @@
; credits: http://www.opsi.org/en/credits/
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
if FileExists($IniFile$)
@ -14,23 +13,20 @@ if FileExists($IniFile$)
endif
Message "Uninstalling " + $ProductId$ + " " + $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
Dosbatch_uninstall
sub_check_exitcode
if FileExists($IniFile$)
Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe")
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$
if FileExists($UninstallProgramOld$)
comment "Uninstall program found, starting uninstall"
Dosbatch_uninstall
sub_check_exitcode
Winbatch_uninstall_old /WaitforProcessending "Au_.exe" /Timeoutseconds 10
sub_check_exitcode
endif
Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "")
comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version"
Winbatch_uninstall_msi_old
sub_check_exitcode
endif
endif
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Dosbatch_uninstall
sub_check_exitcode
Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall_msi
sub_check_exitcode
endif
@ -47,12 +43,11 @@ LinkFolder_uninstall
; PuTTY 0.58+ uninstallers call 'putty -cleanup-during-uninstall' during uninstall. This causes a pop-up to appear which breaks the silent uninstall.
copy /Y "%System%\print.exe" "$InstallDir$\putty.exe"
[Winbatch_uninstall_old]
"$UninstallProgramOld$" /sp- /verysilent /norestart
[Winbatch_uninstall_msi_old]
msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall]
"$UninstallProgram$" /sp- /verysilent /norestart
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
[Files_uninstall]
; Example for recursively deleting the installation directory:

View File

@ -6,8 +6,7 @@
[Actions]
requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $MsiIdOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$
@ -37,7 +36,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$ = "20 MB"
Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\PuTTY"
; ----------------------------------------------------------------
@ -76,7 +75,7 @@ else
endif
[Winbatch_install]
"$InstallExe$" /sp- /verysilent
msiexec /i "$InstallMsi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
[Files_install]
; copy the ini file to the InstallDir

View File

@ -6,8 +6,7 @@
[Actions]
requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram$
DefVar $UninstallProgramOld$
DefVar $MsiIdOld$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$

View File

@ -19,14 +19,14 @@ TYPE="public"
DL_FILE[0]="putty_by_apathy22.png"
DL_SOURCE[0]="http://fc03.deviantart.net/fs8/i/2005/302/a/0/putty_by_apathy22.png"
DL_FILE[1]="putty-${VERSION}-installer.exe"
DL_SOURCE[1]="http://the.earth.li/~sgtatham/putty/latest/x86/putty-${VERSION}-installer.exe"
DL_FILE[1]="putty-${VERSION}-installer.msi"
DL_SOURCE[1]="http://the.earth.li/~sgtatham/putty/latest/x86/putty-${VERSION}-installer.msi"
DL_ARCH[1]="X86"
DL_WINST_NAME[1]="InstallExe"
DL_WINST_NAME[1]="InstallMsi"
# File array index for the image showing while installing the program
ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="UninstallProg"
OPSI_INI_VALUE[0]="unins000.exe"
OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="{ED9EF59B-0799-428E-823D-6D2B7B4FE2E0}"

View File

@ -1 +0,0 @@
3911d72eb2371b9a530744a4afef993ecdd2f57e /home/mario/.opsi-dist-cache/bitvise.putty-0.67/X86/putty-0.67-installer.exe

View File

@ -0,0 +1 @@
f7e4eff6ef17a88c4854654f93d87e1de01d7182 /home/mario/.opsi-dist-cache/bitvise.putty-0.67/X86/putty-0.67-installer.msi