move to new build system
This commit is contained in:
@@ -4,11 +4,19 @@
|
||||
; credits: http://www.opsi.org/credits/
|
||||
|
||||
|
||||
Set $MsiId$ = '{AC76BA86-1033-F400-BA7E-100000000002}'
|
||||
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
|
||||
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
|
||||
|
||||
Message "Uninstalling " + $ProductId$ + " ..."
|
||||
|
||||
if FileExists($IniFile$)
|
||||
Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
|
||||
if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld$ + "] DisplayName") = "")
|
||||
comment "Old MSI id " + $MsiIdOld$ + " found in registry, starting msiexec to uninstall old version"
|
||||
Winbatch_uninstall_msi_old
|
||||
sub_check_exitcode
|
||||
endif
|
||||
endif
|
||||
if FileExists($UninstallProgram$)
|
||||
comment "Uninstall program found, starting uninstall"
|
||||
Winbatch_uninstall
|
||||
@@ -36,9 +44,12 @@ LinkFolder_uninstall
|
||||
; "$UninstallProgram$" /S
|
||||
;
|
||||
; === Inno Setup ========================================================================================
|
||||
; "$UninstallProgram$" /silent /norestart
|
||||
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES
|
||||
|
||||
|
||||
[Winbatch_uninstall_msi_old]
|
||||
msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
|
||||
|
||||
[Winbatch_uninstall_msi]
|
||||
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
|
||||
|
||||
|
||||
6
CLIENT_DATA/opsi-softmaker.office2010.ini
Normal file
6
CLIENT_DATA/opsi-softmaker.office2010.ini
Normal file
@@ -0,0 +1,6 @@
|
||||
[X86]
|
||||
MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
|
||||
|
||||
[COMMON]
|
||||
PN=softmaker.office2010
|
||||
VERSION=2010
|
||||
@@ -6,8 +6,11 @@
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.10.8.6"
|
||||
|
||||
DefVar $MsiId$
|
||||
; DefVar $MsiId$
|
||||
DefVar $MsiIdOld$
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $IniFile$
|
||||
DefVar $IniCfgFile$
|
||||
DefVar $LogDir$
|
||||
DefVar $ProductId$
|
||||
DefVar $MinimumSpace$
|
||||
@@ -19,16 +22,27 @@ DefVar $LicensePool$
|
||||
|
||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
|
||||
; 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 $ProductId$ = "smoffice2010"
|
||||
Set $MinimumSpace$ = "285 MB"
|
||||
Set $ProductId$ = "softmaker.office2010"
|
||||
Set $MinimumSpace$ = "300 MB"
|
||||
; the path were we find the product after the installation
|
||||
Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker\"
|
||||
Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker Office 2010"
|
||||
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
|
||||
Set $LicenseRequired$ = "false"
|
||||
Set $LicensePool$ = "p_" + $ProductId$
|
||||
; ----------------------------------------------------------------
|
||||
@@ -53,10 +67,22 @@ else
|
||||
Sub_get_licensekey
|
||||
endif
|
||||
|
||||
comment "Remove Setup Files"
|
||||
Winbatch_remove
|
||||
Sub_check_exitcode
|
||||
|
||||
comment "Extract setup program"
|
||||
Winbatch_extract
|
||||
Sub_check_exitcode
|
||||
|
||||
comment "Start setup program"
|
||||
Winbatch_install
|
||||
Sub_check_exitcode
|
||||
|
||||
comment "Remove Setup Files"
|
||||
Winbatch_remove
|
||||
Sub_check_exitcode
|
||||
|
||||
comment "Copy files"
|
||||
Files_install /32Bit
|
||||
|
||||
@@ -74,40 +100,27 @@ else
|
||||
; else
|
||||
; comment "Successful Installation"
|
||||
; endif
|
||||
|
||||
comment "Reboot"
|
||||
ExitWindows /Reboot
|
||||
|
||||
endif
|
||||
|
||||
[Winbatch_extract]
|
||||
copy "$InstallExe$" "$LogDir$"
|
||||
"$LogDir$/ofw2010.exe /ExtractCab /qb
|
||||
|
||||
[Winbatch_install]
|
||||
; Choose one of the following examples as basis for your installation
|
||||
; You can use $LicenseKey$ var to pass a license key to the installer
|
||||
;
|
||||
; === Nullsoft Scriptable Install System ================================================================
|
||||
; "%ScriptPath%\Setup.exe" /S
|
||||
;
|
||||
; === MSI package =======================================================================================
|
||||
; You may use the parameter PIDKEY=$Licensekey$
|
||||
msiexec /i "%ScriptPath%\files\X86FILE" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress TRANSFORMS=:lng_de.mst ADDLOCAL="ALL"
|
||||
msiexec /i "$LogDir$\SupportFiles\SoftMaker Office 2010.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress TRANSFORMS=:lng_de.mst ADDLOCAL="ALL"
|
||||
|
||||
[Winbatch_remove]
|
||||
delete -sf "$LogDir$\SupportFiles\"
|
||||
delete -sf "$LogDir$\ofw2010.exe"
|
||||
|
||||
;
|
||||
; === InstallShield + MSI=====================================================================================
|
||||
; Attention: The path to the log file should not contain any whitespaces
|
||||
; "%ScriptPath%\setup.exe" /s /v" /l* $LogDir$\$ProductId$.install_log.txt /qb! ALLUSERS=2 REBOOT=ReallySuppress"
|
||||
; "%ScriptPath%\setup.exe" /s /v" /qb! ALLUSERS=2 REBOOT=ReallySuppress"
|
||||
;
|
||||
; === InstallShield =====================================================================================
|
||||
; Create setup.iss answer file by running: setup.exe /r /f1"c:\setup.iss"
|
||||
; "%ScriptPath%\setup.exe" /s /sms /f1"%ScriptPath%\setup.iss" /f2"$LogDir$\$ProductId$.install_log.txt"
|
||||
;
|
||||
; === Inno Setup ========================================================================================
|
||||
; http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
|
||||
; You may create setup answer file by: setup.exe /SAVEINF="filename"
|
||||
; You may use an answer file by the parameter /LOADINF="filename"
|
||||
; "%ScriptPath%\setup.exe" /sp- /silent /norestart
|
||||
|
||||
[Files_install]
|
||||
; copy the ini file to the InstallDir
|
||||
copy "$IniCfgFile$" "$InstallDir$"
|
||||
|
||||
; Example of recursively copying some files into the installation directory:
|
||||
;
|
||||
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
[Actions]
|
||||
requiredWinstVersion >= "4.10.8.6"
|
||||
|
||||
DefVar $MsiId$
|
||||
; DefVar $MsiId$
|
||||
DefVar $MsiIdOld$
|
||||
DefVar $UninstallProgram$
|
||||
DefVar $LogDir$
|
||||
DefVar $IniFile$
|
||||
DefVar $IniCfgFile$
|
||||
DefVar $ExitCode$
|
||||
DefVar $ProductId$
|
||||
DefVar $InstallDir$
|
||||
@@ -17,12 +20,22 @@ DefVar $LicensePool$
|
||||
|
||||
Set $LogDir$ = "%SystemDrive%\tmp"
|
||||
|
||||
; 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 -
|
||||
; ----------------------------------------------------------------
|
||||
Set $ProductId$ = "smoffice2010"
|
||||
Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker"
|
||||
Set $LicenseRequired$ = "true"
|
||||
Set $ProductId$ = "softmaker.office2010"
|
||||
Set $InstallDir$ = "%ProgramFiles32Dir%\SoftMaker Office 2010"
|
||||
Set $LicenseRequired$ = "false"
|
||||
Set $LicensePool$ = "p_" + $ProductId$
|
||||
; ----------------------------------------------------------------
|
||||
|
||||
@@ -43,23 +56,16 @@ if $LicenseRequired$ = "true"
|
||||
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
|
||||
|
||||
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$)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user