Cleanup source tree

This commit is contained in:
Mario Fetka
2014-02-21 12:09:13 +01:00
parent 7524ae12c1
commit 1a6fa309f1
2 changed files with 161 additions and 161 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,161 +1,161 @@
; Copyright (c) uib gmbh (www.uib.de) ; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib ; This sourcecode is owned by uib
; 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/
[Actions] [Actions]
requiredWinstVersion >= "4.11.1.1" requiredWinstVersion >= "4.11.1.1"
DefVar $LogDir$ DefVar $LogDir$
DefVar $ProductId$ DefVar $ProductId$
DefVar $LicenseRequired$ DefVar $LicenseRequired$
DefVar $LicenseKey$ DefVar $LicenseKey$
DefVar $LicensePool$ DefVar $LicensePool$
DefVar $poolOrKey$ DefVar $poolOrKey$
DefVar $source$ DefVar $source$
DefVar $httpproxy$ DefVar $httpproxy$
Set $LogDir$ = "%SystemDrive%\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
Set $ProductId$ = "activate-win" Set $ProductId$ = "activate-win"
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
; see: ; see:
; http://technet.microsoft.com/en-us/library/ff793433.aspx ; http://technet.microsoft.com/en-us/library/ff793433.aspx
if GetMsVersionInfo < "6" if GetMsVersionInfo < "6"
LogError "This is for NT 6 (Vista) and above" LogError "This is for NT 6 (Vista) and above"
isFatalError isFatalError
else else
comment "Show product picture" comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
Message "Installing " + $ProductId$ + " ..." Message "Installing " + $ProductId$ + " ..."
set $poolOrKey$ = GetProductProperty("Poolid-or-Licensekey","") set $poolOrKey$ = GetProductProperty("Poolid-or-Licensekey","")
set $source$ = GetProductProperty("method","only-activate") set $source$ = GetProductProperty("method","only-activate")
set $httpproxy$ = GetProductProperty("httpproxy","") set $httpproxy$ = GetProductProperty("httpproxy","")
comment "Check Status" comment "Check Status"
DosInAnIcon_status_win7 winst /sysnative DosInAnIcon_status_win7 winst /sysnative
if not ( $httpproxy$ = "" ) if not ( $httpproxy$ = "" )
comment "enable HTTP proxy, required for auto-activating"
comment "enable HTTP proxy, required for auto-activating" DosInAnIcon_setproxy_win7 winst /sysnative
endif
DosInAnIcon_setproxy_win7 winst /sysnative
endif if not ($source$ = "only-activate")
comment " we need a key..."
if not ($source$ = "only-activate") if $source$ = "opsi License management"
comment " we need a key..." Set $LicenseRequired$ = "true"
if $source$ = "opsi License management" Set $LicensePool$ = $poolOrKey$
Set $LicenseRequired$ = "true" comment " get key from license management with poolid "+$LicensePool$
Set $LicensePool$ = $poolOrKey$ comment "Licensing required, reserve license and get license key"
comment " get key from license management with poolid "+$LicensePool$ Sub_get_licensekey
comment "Licensing required, reserve license and get license key" else
Sub_get_licensekey Set $LicenseRequired$ = "false"
else Set $LicensePool$ = ""
Set $LicenseRequired$ = "false" set $LicenseKey$ = $poolOrKey$
Set $LicensePool$ = "" comment " use key "+$LicenseKey$
set $LicenseKey$ = $poolOrKey$ endif
comment " use key "+$LicenseKey$
endif comment "Set the Key"
DosInAnIcon_set_key winst /sysnative
comment "Set the Key"
DosInAnIcon_set_key winst /sysnative comment "Check Status"
DosInAnIcon_status_win7 winst /sysnative
comment "Check Status" endif
DosInAnIcon_status_win7 winst /sysnative
endif comment "Start Activation"
DosInAnIcon_activate winst /sysnative
comment "Start Activation"
DosInAnIcon_activate winst /sysnative comment "Check Status"
DosInAnIcon_status_win7 winst /sysnative
comment "Check Status"
DosInAnIcon_status_win7 winst /sysnative endif
endif [DosInAnIcon_set_key]
cscript //b c:\windows\system32\slmgr.vbs /ipk $LicenseKey$
[DosInAnIcon_set_key]
cscript //b c:\windows\system32\slmgr.vbs /ipk $LicenseKey$ [DosInAnIcon_activate]
cscript //b c:\windows\system32\slmgr.vbs /ato
[DosInAnIcon_activate]
cscript //b c:\windows\system32\slmgr.vbs /ato [DosInAnIcon_status_win7]
cscript c:\windows\system32\slmgr.vbs /dli
[DosInAnIcon_status_win7]
cscript c:\windows\system32\slmgr.vbs /dli
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
[Sub_get_licensekey] comment "License management is enabled and will be used"
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used" comment "Trying to get a license key"
Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
comment "Trying to get a license key" ; If there is an assignment of exactly one licensepool to the product the following call is possible:
Set $LicenseKey$ = demandLicenseKey ($LicensePool$) ; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
; 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$
; If there is an assignment of a license pool to a windows software id, it is possible to use: ; $WindowsSoftwareId$ = "..."
; DefVar $WindowsSoftwareId$ ; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
; $WindowsSoftwareId$ = "..."
; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$) DefVar $ServiceErrorClass$
set $ServiceErrorClass$ = getLastServiceErrorClass
DefVar $ServiceErrorClass$ comment "Error class: " + $ServiceErrorClass$
set $ServiceErrorClass$ = getLastServiceErrorClass
comment "Error class: " + $ServiceErrorClass$ if $ServiceErrorClass$ = "None"
comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
if $ServiceErrorClass$ = "None" else
comment "Everything fine, we got the license key '" + $LicenseKey$ + "'" if $ServiceErrorClass$ = "LicenseConfigurationError"
else LogError "Fatal: license configuration must be corrected"
if $ServiceErrorClass$ = "LicenseConfigurationError" LogError getLastServiceErrorMessage
LogError "Fatal: license configuration must be corrected" isFatalError
LogError getLastServiceErrorMessage else
isFatalError if $ServiceErrorClass$ = "LicenseMissingError"
else LogError "Fatal: required license is not supplied"
if $ServiceErrorClass$ = "LicenseMissingError" isFatalError
LogError "Fatal: required license is not supplied" endif
isFatalError endif
endif endif
endif else
endif LogError "Fatal: license required, but license management not enabled"
else isFatalError
LogError "Fatal: license required, but license management not enabled" endif
isFatalError
endif
[Sub_check_exitcode]
comment "Test for installation success via exit code"
[Sub_check_exitcode] set $ExitCode$ = getLastExitCode
comment "Test for installation success via exit code" ; informations to exit codes see
set $ExitCode$ = getLastExitCode ; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; informations to exit codes see ; http://msdn.microsoft.com/en-us/library/aa368542.aspx
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx if ($ExitCode$ = "0")
; http://msdn.microsoft.com/en-us/library/aa368542.aspx comment "Looks good: setup program gives exitcode zero"
if ($ExitCode$ = "0") else
comment "Looks good: setup program gives exitcode zero" comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
else if ($ExitCode$ = "1605")
comment "Setup program gives a exitcode unequal zero: " + $ExitCode$ comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed."
if ($ExitCode$ = "1605") comment "Uninstall of a not installed product failed - no problem"
comment "ERROR_UNKNOWN_PRODUCT 1605 This action is only valid for products that are currently installed." else
comment "Uninstall of a not installed product failed - no problem" if ($ExitCode$ = "1641")
else comment "looks good: setup program gives exitcode 1641"
if ($ExitCode$ = "1641") comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success."
comment "looks good: setup program gives exitcode 1641" else
comment "ERROR_SUCCESS_REBOOT_INITIATED 1641 The installer has initiated a restart. This message is indicative of a success." if ($ExitCode$ = "3010")
else comment "looks good: setup program gives exitcode 3010"
if ($ExitCode$ = "3010") comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success."
comment "looks good: setup program gives exitcode 3010" else
comment "ERROR_SUCCESS_REBOOT_REQUIRED 3010 A restart is required to complete the install. This message is indicative of a success." logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
else isFatalError
logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$ endif
isFatalError endif
endif endif
endif endif
endif
endif [DosInAnIcon_setproxy_win7]
;netsh.exe winhttp set proxy proxy:3128 "<local>;*.mynet.local"
[DosInAnIcon_setproxy_win7] netsh.exe winhttp set proxy $httpproxy$