change to msi pack template

This commit is contained in:
Mario Fetka 2013-05-06 12:11:16 +02:00
parent 1217513ee9
commit dcba3c3faf
4 changed files with 18 additions and 23 deletions

View File

@ -4,7 +4,6 @@
; credits: http://www.opsi.org/en/credits/ ; credits: http://www.opsi.org/en/credits/
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini" Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
if FileExists($IniFile$) if FileExists($IniFile$)
@ -15,17 +14,16 @@ endif
Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..." Message "Uninstalling " + $ProductId$ + " "+ $OLD_VERSION$ + "-" + $OLD_CREATOR_TAG$ + $OLD_RELEASE$ + " ..."
if FileExists($IniFile$) if FileExists($IniFile$)
Set $UninstallProg$ = GetValueFromInifile($IniFile$,"X86","UninstallProg","XXXXXXXX.exe") Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86_64","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
Set $UninstallProgramOld$ = $InstallDir$ + "\" + $UninstallProg$ if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "")
if FileExists($UninstallProgramOld$) comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version"
comment "Uninstall program found, starting uninstall" Winbatch_uninstall_msi_old
Winbatch_uninstall_old
sub_check_exitcode sub_check_exitcode
endif endif
endif endif
if FileExists($UninstallProgram$) if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
comment "Uninstall program found, starting uninstall" comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
Winbatch_uninstall Winbatch_uninstall_msi
sub_check_exitcode sub_check_exitcode
endif endif
@ -38,12 +36,11 @@ Registry_uninstall /64Bit
comment "Delete program shortcuts" comment "Delete program shortcuts"
LinkFolder_uninstall LinkFolder_uninstall
[Winbatch_uninstall_old] [Winbatch_uninstall_msi_old]
"$UninstallProgramOld$" -ms msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall]
"$UninstallProgram$" -ms
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
[Files_uninstall] [Files_uninstall]
; Example for recursively deleting the installation directory: ; Example for recursively deleting the installation directory:

View File

@ -6,8 +6,7 @@
[Actions] [Actions]
requiredWinstVersion >= "4.11.2.6" requiredWinstVersion >= "4.11.2.6"
DefVar $UninstallProgram$ DefVar $MsiIdOld$
DefVar $UninstallProgramOld$
DefVar $IniFile$ DefVar $IniFile$
DefVar $IniCfgFile$ DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
@ -37,7 +36,7 @@ Set $LogDir$ = "%SystemDrive%\tmp"
;$ProductId$ should be the name of the product in opsi ;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, ; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator ; no white space use '-' as a seperator
Set $MinimumSpace$ = "50 MB" Set $MinimumSpace$ = "100 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles64Dir%\Waterfox" Set $InstallDir$ = "%ProgramFiles64Dir%\Waterfox"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -76,7 +75,8 @@ else
endif endif
[Winbatch_install] [Winbatch_install]
"$InstallExe$" -ms "$InstallExe$" /qb /l* "$LogDir$\$ProductId$.install_log.txt" ALLUSERS=1 REBOOT=ReallySuppress
; msiexec /i "%ScriptPath%\some.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
[Files_install] [Files_install]
; copy the ini file to the InstallDir ; copy the ini file to the InstallDir

View File

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

View File

@ -27,6 +27,5 @@ DL_WINST_NAME[1]=InstallExe
ICON_DL_INDEX=0 ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86_64" OPSI_INI_SECTION[0]="X86_64"
OPSI_INI_OPTION[0]="UninstallProg" OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="uninstall\helper.exe" OPSI_INI_VALUE[0]="{FD7DEB7B-8CEA-44E5-AB2D-7C66786C0563}"