Uninstall old installer based setup first

This commit is contained in:
Mario Fetka 2016-08-28 09:02:28 +02:00
parent f0d8a10f32
commit b2ef2520c7
4 changed files with 18 additions and 1 deletions

View File

@ -3,7 +3,7 @@
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
Set $UninstallProgram$ = $InstallDir$ + "\" + $UninstallProg$
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
if FileExists($IniFile$)
@ -30,6 +30,14 @@ if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
sub_check_exitcode
endif
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Dosbatch_uninstall
sub_check_exitcode
Winbatch_uninstall /WaitforProcessending "Au_.exe" /Timeoutseconds 10
sub_check_exitcode
endif
comment "Delete files"
Files_uninstall /32Bit
@ -49,6 +57,9 @@ msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall]
"$UninstallProgram$" /sp- /verysilent /norestart
[Files_uninstall]
; Example for recursively deleting the installation directory:
;

View File

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

View File

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

View File

@ -30,3 +30,7 @@ ICON_DL_INDEX=0
OPSI_INI_SECTION[0]="X86"
OPSI_INI_OPTION[0]="MsiId"
OPSI_INI_VALUE[0]="{ED9EF59B-0799-428E-823D-6D2B7B4FE2E0}"
OPSI_INI_SECTION[1]="X86"
OPSI_INI_OPTION[1]="UninstallProg"
OPSI_INI_VALUE[1]="unins000.exe"