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/
|
||||
|
||||
|
||||
Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
|
||||
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
|
||||
|
||||
Message "Uninstalling " + $ProductId$ + " ..."
|
||||
@ -14,11 +13,6 @@ if FileExists($UninstallProgram$)
|
||||
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"
|
||||
Files_uninstall /32Bit
|
||||
@ -34,9 +28,6 @@ LinkFolder_uninstall
|
||||
;
|
||||
"$UninstallProgram$" /S
|
||||
|
||||
[Winbatch_uninstall_msi]
|
||||
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
|
||||
|
||||
[Files_uninstall]
|
||||
; Example for recursively deleting the installation directory (don't forget the trailing backslash):
|
||||
;
|
||||
|
@ -6,16 +6,12 @@
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.10.8.6"
|
||||
|
||||
DefVar $MsiId$
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $LogDir$
|
||||
DefVar $ProductId$
|
||||
DefVar $MinimumSpace$
|
||||
DefVar $InstallDir$
|
||||
DefVar $ExitCode$
|
||||
DefVar $LicenseRequired$
|
||||
DefVar $LicenseKey$
|
||||
DefVar $LicensePool$
|
||||
|
||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
|
||||
@ -39,8 +35,6 @@ Set $ProductId$ = "vlc"
|
||||
Set $MinimumSpace$ = "30 MB"
|
||||
; the path were we find the product after the installation
|
||||
Set $InstallDir$ = "%ProgramFiles32Dir%\VideoLAN\VLC"
|
||||
Set $LicenseRequired$ = "false"
|
||||
Set $LicensePool$ = "p_" + $ProductId$
|
||||
; ----------------------------------------------------------------
|
||||
|
||||
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
|
||||
@ -58,11 +52,6 @@ else
|
||||
|
||||
Message "Installing " + $ProductId$ + " ..."
|
||||
|
||||
if $LicenseRequired$ = "true"
|
||||
comment "Licensing required, reserve license and get license key"
|
||||
Sub_get_licensekey
|
||||
endif
|
||||
|
||||
comment "Start setup program"
|
||||
Winbatch_install
|
||||
Sub_check_exitcode
|
||||
@ -76,15 +65,6 @@ else
|
||||
comment "Create shortcuts"
|
||||
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
|
||||
|
||||
[Winbatch_install]
|
||||
@ -140,44 +120,6 @@ endif
|
||||
; icon_index: 2
|
||||
; 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]
|
||||
comment "Test for installation success via exit code"
|
||||
set $ExitCode$ = getLastExitCode
|
||||
|
@ -6,14 +6,11 @@
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.10.8.6"
|
||||
|
||||
DefVar $MsiId$
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $LogDir$
|
||||
DefVar $ExitCode$
|
||||
DefVar $ProductId$
|
||||
DefVar $InstallDir$
|
||||
DefVar $LicenseRequired$
|
||||
DefVar $LicensePool$
|
||||
|
||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
|
||||
@ -32,8 +29,6 @@ Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
; ----------------------------------------------------------------
|
||||
Set $ProductId$ = "vlc"
|
||||
Set $InstallDir$ = "%ProgramFiles32Dir%\VideoLAN\VLC"
|
||||
Set $LicenseRequired$ = "false"
|
||||
Set $LicensePool$ = "p_" + $ProductId$
|
||||
; ----------------------------------------------------------------
|
||||
|
||||
|
||||
@ -46,30 +41,3 @@ if FileExists("%ScriptPath%\delsub32.ins")
|
||||
comment "Start uninstall sub section"
|
||||
Sub "%ScriptPath%\delsub32.ins"
|
||||
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