highcriteria.transcriptionb.../CLIENT_DATA/setup32.ins

157 lines
4.8 KiB
TeX

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/en/credits/
[Actions]
requiredWinstVersion >= "4.11.2.6"
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $OLD_VERSION$
DefVar $OLD_CREATOR_TAG$
DefVar $OLD_RELEASE$
DefVar $OrgName$
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:
; from builder-product.cfg : all variables definded by attribute WINST[index]
; from builder-product.cfg : VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE
; from opsi-builder.cfg : CREATOR_TAG CREATOR_NAME CREATOR_EMAIL
; auto generated winst-variables
; $IconFile$: path to product picture
;
@@BUILDER_VARIABLES@@
; ----------------------------------------------------------------
; - Please edit the following values -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator
Set $MinimumSpace$ = "5 MB"
; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\HighCriteria\TranscriptionBuddy"
Set $LicenseRequired$ = "true"
Set $LicensePool$ = "p_" + $ProductId$
; ----------------------------------------------------------------
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
isFatalError "No Space"
; Stop process and set installation status to failed
else
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $NAME$
if FileExists("%ScriptPath%\delsub32.ins")
comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub32.ins"
endif
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
comment "Patch Registry"
Registry_install /32Bit
comment "Create shortcuts"
LinkFolder_install
endif
[Files_install]
copy -s "%ScriptPath%\X86\*.*" "$InstallDir$"
[Registry_install]
openkey [HKEY_LOCAL_MACHINE\Software\HighCriteria\TranscriptionBuddyPE\WinReg]
set "Name" = "$OrgName$"
set "Key" = "$LicenseKey$"
openkey [HKEY_LOCAL_MACHINE\Software\HighCriteria\TranscriptionBuddyPE\ProductVersion]
set "MajorVer" = REG_DWORD:0x00000004
set "MinorVer" = REG_DWORD:0x00000000
set "NumbBuild" = REG_DWORD:0x0000002D
set "CommonReg" = REG_DWORD:0x00000001
set "CommonSet" = REG_DWORD:0x00000000
set "SetAccess" = REG_DWORD:0xFFFFFFFF
openkey [HKEY_LOCAL_MACHINE\Software\HighCriteria\TranscriptionBuddyPE]
set "Path" = "$InstallDir$"
set "Module" = "Tnpbuddy.exe"
[LinkFolder_install]
set_basefolder common_programs
delete_subfolder $ProductId$
set_basefolder common_programs
set_subfolder Transcription Buddy
set_link
name: Transcription Buddy
target: $InstallDir$\Tnpbuddy.exe
parameters:
working_dir: $InstallDir$
icon_file: $InstallDir$\Tnpbuddy.exe
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