fixed reinstall (uninstall & install)

This commit is contained in:
DT Netsolution GmbH 2012-04-27 15:01:32 +02:00
parent eef9900764
commit 33db18d1be
2 changed files with 18 additions and 31 deletions

View File

@ -3,23 +3,12 @@
; and published under the Terms of the General Public License. ; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/ ; credits: http://www.opsi.org/credits/
DefVar $SecMonitorProgram$
Set $SecMonitorProgram$ = $InstallDir$ + "\SecMonitor.exe"
Set $MsiId$ = '{106BB145-4FF6-4473-B0AE-CD8502CD123A}' if FileExists($SecMonitorProgram$)
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
Message "Uninstalling " + $ProductId$ + " ..." Message "Uninstalling " + $ProductId$ + " ..."
if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall"
Winbatch_uninstall
sub_check_exitcode
endif
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
comment "Delete files" comment "Delete files"
Files_uninstall /32Bit Files_uninstall /32Bit
@ -29,18 +18,18 @@ Registry_uninstall /32Bit
comment "Delete program shortcuts" comment "Delete program shortcuts"
LinkFolder_uninstall LinkFolder_uninstall
[Winbatch_uninstall] comment "Uninstall program found, starting uninstall"
; Choose one of the following examples as basis for program uninstall Winbatch_uninstall_msi
; sub_check_exitcode
; === Nullsoft Scriptable Install System ================================================================
; "$UninstallProgram$" /S comment "Trigger reboot"
; ExitWindows /ImmediateReboot
; === Inno Setup ======================================================================================== endif
; "$UninstallProgram$" /silent /norestart
[Winbatch_uninstall_msi] [Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress msiexec /x "$Msi32$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb!
[Files_uninstall] [Files_uninstall]
; Example for recursively deleting the installation directory (don't forget the trailing backslash): ; Example for recursively deleting the installation directory (don't forget the trailing backslash):
@ -64,6 +53,7 @@ msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
; set_subfolder "" ; set_subfolder ""
; delete_element $ProductId$ ; delete_element $ProductId$
[Sub_check_exitcode] [Sub_check_exitcode]
comment "Test for installation success via exit code" comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode set $ExitCode$ = getLastExitCode

View File

@ -39,9 +39,6 @@ Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub32.ins") if FileExists("%ScriptPath%\delsub32.ins")
comment "Start uninstall sub section" comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub32.ins" Sub "%ScriptPath%\delsub32.ins"
comment "Trigger reboot"
ExitWindows /Reboot
endif endif
if $LicenseRequired$ = "true" if $LicenseRequired$ = "true"