remove msi and license parrt from *.ins
This commit is contained in:
parent
447734e49b
commit
a449c1521b
@ -4,7 +4,6 @@
|
|||||||
; credits: http://www.opsi.org/credits/
|
; credits: http://www.opsi.org/credits/
|
||||||
|
|
||||||
|
|
||||||
Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
|
|
||||||
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
|
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
|
||||||
|
|
||||||
Message "Uninstalling " + $ProductId$ + " ..."
|
Message "Uninstalling " + $ProductId$ + " ..."
|
||||||
@ -14,11 +13,6 @@ if FileExists($UninstallProgram$)
|
|||||||
Winbatch_uninstall
|
Winbatch_uninstall
|
||||||
sub_check_exitcode
|
sub_check_exitcode
|
||||||
endif
|
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
|
||||||
@ -34,9 +28,6 @@ LinkFolder_uninstall
|
|||||||
;
|
;
|
||||||
"$UninstallProgram$" /S
|
"$UninstallProgram$" /S
|
||||||
|
|
||||||
[Winbatch_uninstall_msi]
|
|
||||||
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
|
|
||||||
|
|
||||||
[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):
|
||||||
;
|
;
|
||||||
|
@ -6,16 +6,12 @@
|
|||||||
[Actions]
|
[Actions]
|
||||||
requiredWinstVersion >= "4.10.8.6"
|
requiredWinstVersion >= "4.10.8.6"
|
||||||
|
|
||||||
DefVar $MsiId$
|
|
||||||
DefVar $UninstallProgram$
|
DefVar $UninstallProgram$
|
||||||
DefVar $LogDir$
|
DefVar $LogDir$
|
||||||
DefVar $ProductId$
|
DefVar $ProductId$
|
||||||
DefVar $MinimumSpace$
|
DefVar $MinimumSpace$
|
||||||
DefVar $InstallDir$
|
DefVar $InstallDir$
|
||||||
DefVar $ExitCode$
|
DefVar $ExitCode$
|
||||||
DefVar $LicenseRequired$
|
|
||||||
DefVar $LicenseKey$
|
|
||||||
DefVar $LicensePool$
|
|
||||||
|
|
||||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||||
|
|
||||||
@ -39,8 +35,6 @@ Set $ProductId$ = "vlc"
|
|||||||
Set $MinimumSpace$ = "30 MB"
|
Set $MinimumSpace$ = "30 MB"
|
||||||
; the path were we find the product after the installation
|
; the path were we find the product after the installation
|
||||||
Set $InstallDir$ = "%ProgramFiles32Dir%\VideoLAN\VLC"
|
Set $InstallDir$ = "%ProgramFiles32Dir%\VideoLAN\VLC"
|
||||||
Set $LicenseRequired$ = "false"
|
|
||||||
Set $LicensePool$ = "p_" + $ProductId$
|
|
||||||
; ----------------------------------------------------------------
|
; ----------------------------------------------------------------
|
||||||
|
|
||||||
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
|
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
|
||||||
@ -58,11 +52,6 @@ else
|
|||||||
|
|
||||||
Message "Installing " + $ProductId$ + " ..."
|
Message "Installing " + $ProductId$ + " ..."
|
||||||
|
|
||||||
if $LicenseRequired$ = "true"
|
|
||||||
comment "Licensing required, reserve license and get license key"
|
|
||||||
Sub_get_licensekey
|
|
||||||
endif
|
|
||||||
|
|
||||||
comment "Start setup program"
|
comment "Start setup program"
|
||||||
Winbatch_install
|
Winbatch_install
|
||||||
Sub_check_exitcode
|
Sub_check_exitcode
|
||||||
@ -76,15 +65,6 @@ else
|
|||||||
comment "Create shortcuts"
|
comment "Create shortcuts"
|
||||||
LinkFolder_install
|
LinkFolder_install
|
||||||
|
|
||||||
comment "Test for installation success"
|
|
||||||
; Test if software marked as installed in registry
|
|
||||||
; if (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}] DisplayName") = "")
|
|
||||||
; logError "Fatal: After Installation 32 bit [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}] not found"
|
|
||||||
; isFatalError
|
|
||||||
; else
|
|
||||||
; comment "Successful Installation"
|
|
||||||
; endif
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
[Winbatch_install]
|
[Winbatch_install]
|
||||||
@ -140,44 +120,6 @@ endif
|
|||||||
; icon_index: 2
|
; icon_index: 2
|
||||||
; end_link
|
; end_link
|
||||||
|
|
||||||
[Sub_get_licensekey]
|
|
||||||
if opsiLicenseManagementEnabled
|
|
||||||
comment "License management is enabled and will be used"
|
|
||||||
|
|
||||||
comment "Trying to get a license key"
|
|
||||||
Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
|
|
||||||
; If there is an assignment of exactly one licensepool to the product the following call is possible:
|
|
||||||
; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
|
|
||||||
;
|
|
||||||
; If there is an assignment of a license pool to a windows software id, it is possible to use:
|
|
||||||
; DefVar $WindowsSoftwareId$
|
|
||||||
; $WindowsSoftwareId$ = "..."
|
|
||||||
; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
|
|
||||||
|
|
||||||
DefVar $ServiceErrorClass$
|
|
||||||
set $ServiceErrorClass$ = getLastServiceErrorClass
|
|
||||||
comment "Error class: " + $ServiceErrorClass$
|
|
||||||
|
|
||||||
if $ServiceErrorClass$ = "None"
|
|
||||||
comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
|
|
||||||
else
|
|
||||||
if $ServiceErrorClass$ = "LicenseConfigurationError"
|
|
||||||
LogError "Fatal: license configuration must be corrected"
|
|
||||||
LogError getLastServiceErrorMessage
|
|
||||||
isFatalError
|
|
||||||
else
|
|
||||||
if $ServiceErrorClass$ = "LicenseMissingError"
|
|
||||||
LogError "Fatal: required license is not supplied"
|
|
||||||
isFatalError
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
LogError "Fatal: license required, but license management not enabled"
|
|
||||||
isFatalError
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
[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
|
||||||
|
@ -6,14 +6,11 @@
|
|||||||
[Actions]
|
[Actions]
|
||||||
requiredWinstVersion >= "4.10.8.6"
|
requiredWinstVersion >= "4.10.8.6"
|
||||||
|
|
||||||
DefVar $MsiId$
|
|
||||||
DefVar $UninstallProgram$
|
DefVar $UninstallProgram$
|
||||||
DefVar $LogDir$
|
DefVar $LogDir$
|
||||||
DefVar $ExitCode$
|
DefVar $ExitCode$
|
||||||
DefVar $ProductId$
|
DefVar $ProductId$
|
||||||
DefVar $InstallDir$
|
DefVar $InstallDir$
|
||||||
DefVar $LicenseRequired$
|
|
||||||
DefVar $LicensePool$
|
|
||||||
|
|
||||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||||
|
|
||||||
@ -32,8 +29,6 @@ Set $LogDir$ = "%SystemDrive%\tmp"
|
|||||||
; ----------------------------------------------------------------
|
; ----------------------------------------------------------------
|
||||||
Set $ProductId$ = "vlc"
|
Set $ProductId$ = "vlc"
|
||||||
Set $InstallDir$ = "%ProgramFiles32Dir%\VideoLAN\VLC"
|
Set $InstallDir$ = "%ProgramFiles32Dir%\VideoLAN\VLC"
|
||||||
Set $LicenseRequired$ = "false"
|
|
||||||
Set $LicensePool$ = "p_" + $ProductId$
|
|
||||||
; ----------------------------------------------------------------
|
; ----------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@ -45,31 +40,4 @@ 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"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if $LicenseRequired$ = "true"
|
|
||||||
comment "Licensing required, free license used"
|
|
||||||
Sub_free_license
|
|
||||||
endif
|
|
||||||
|
|
||||||
[Sub_free_license]
|
|
||||||
if opsiLicenseManagementEnabled
|
|
||||||
comment "License management is enabled and will be used"
|
|
||||||
|
|
||||||
comment "Trying to free license used for the product"
|
|
||||||
DefVar $result$
|
|
||||||
Set $result$ = FreeLicense($LicensePool$)
|
|
||||||
; If there is an assignment of a license pool to the product, it is possible to use
|
|
||||||
; Set $result$ = FreeLicense("", $ProductId$)
|
|
||||||
;
|
|
||||||
; If there is an assignment of a license pool to a windows software id, it is possible to use
|
|
||||||
; DefVar $WindowsSoftwareId$
|
|
||||||
; $WindowsSoftwareId$ = "..."
|
|
||||||
; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)
|
|
||||||
else
|
|
||||||
LogError "Error: licensing required, but license management not enabled"
|
|
||||||
isFatalError
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user