update to new opsi builder template

This commit is contained in:
Mario Fetka 2013-03-13 15:07:07 +01:00
parent 389c037b3d
commit 3453e5a921
4 changed files with 74 additions and 17 deletions

View File

@ -32,4 +32,4 @@ deletekey [HKEY_LOCAL_MACHINE\Software\HighCriteria\DictationBuddy]
[LinkFolder_uninstall]
set_basefolder common_programs
delete_subfolder Dictation Buddy
delete_subfolder Dictation Buddy

View File

@ -13,11 +13,15 @@ DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
Set $LogDir$ = "%SystemDrive%\tmp"
Set $OrgName$ = GetProductProperty ("orgname","OrgName")
; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
; and adds the following variables:
@ -38,6 +42,8 @@ Set $LogDir$ = "%SystemDrive%\tmp"
Set $MinimumSpace$ = "5 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\HighCriteria\DictationBuddy"
Set $LicenseRequired$ = "true"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
@ -57,9 +63,13 @@ else
Message "Installing " + $ProductId$ + " "+ $VERSION$ + "-" + $CREATOR_TAG$ + $RELEASE$ + " ..."
if $LicenseRequired$ = "true"
comment "Licensing required, reserve license and get license key"
Sub_get_licensekey
endif
comment "Start setup program"
ChangeDirectory "%SCRIPTPATH%"
comment "Copy files"
Files_install /32Bit
@ -71,11 +81,8 @@ else
endif
[Files_install]
copy "$IniCfgFile$" "$InstallDir$"
copy -s "%ScriptPath%\X86\*.*" "$InstallDir$"
copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
[Registry_install]
openkey [HKEY_LOCAL_MACHINE\Software\HighCriteria\DictationBuddy\WinReg]
@ -102,7 +109,7 @@ set_basefolder common_programs
set_subfolder Dictation Buddy
set_link
name: Dictation Buddy
name: Dictation Buddy
target: $InstallDir$\dicbuddy.exe
parameters:
working_dir: $InstallDir$
@ -110,3 +117,39 @@ set_link
icon_index:
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

View File

@ -12,6 +12,8 @@ DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
@ -32,6 +34,8 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; - Please edit the following values -
; ----------------------------------------------------------------
Set $InstallDir$ = "%ProgramFiles32Dir%\HighCriteria\DictationBuddy"
Set $LicenseRequired$ = "true"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
@ -46,3 +50,22 @@ if FileExists("%ScriptPath%\delsub32.ins")
Sub "%ScriptPath%\delsub32.ins"
endif
if $LicenseRequired$ = "true"
comment "Licensing required, free license used"
Sub_free_license
endif
[Sub_free_license]
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$)

View File

@ -21,18 +21,9 @@ onceScript:
customScript:
userLoginScript:
[ProductProperty]
type: unicode
name: install_architecture
multivalue: False
editable: False
description: which architecture (32/64 bit) has to be installed
values: ["32 only", "64 only", "both", "system specific"]
default: ["system specific"]
[ProductDependency]
action: setup
requiredProduct: aio
requiredProduct: sereby.aio
requiredStatus: installed
requirementType: before