From b66353b8c82700eca4299dd0cc3b755e6d379d52 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Fri, 8 Mar 2013 20:58:48 +0100 Subject: [PATCH] Rewrite to new opsi builder scripts --- CLIENT_DATA/delsub3264.ins | 96 ++++++++++------------------------- CLIENT_DATA/setup3264.ins | 74 +++++---------------------- CLIENT_DATA/uninstall3264.ins | 39 ++------------ OPSI/changelog.txt | 2 + OPSI/control | 17 ++++--- builder-product.cfg | 4 +- nitroreader3.5.txt | 1 - 7 files changed, 59 insertions(+), 174 deletions(-) delete mode 100644 nitroreader3.5.txt diff --git a/CLIENT_DATA/delsub3264.ins b/CLIENT_DATA/delsub3264.ins index ce53e7a..a4ac1de 100644 --- a/CLIENT_DATA/delsub3264.ins +++ b/CLIENT_DATA/delsub3264.ins @@ -1,33 +1,24 @@ ; Copyright (c) uib gmbh (www.uib.de) ; This sourcecode is owned by uib gmbh ; and published under the Terms of the General Public License. -; credits: http://www.opsi.org/credits/ +; credits: http://www.opsi.org/en/credits/ -Set $UninstallProgram32$ = $InstallDir32$ + "\uninstall.exe" -Set $UninstallProgram64$ = $InstallDir64$ + "\uninstall.exe" Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini" + Set $IniFile64$ = $InstallDir64$ + "\opsi-" + $ProductId$ + ".ini" - - if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") Message "Uninstalling " + $ProductId$ + " 32 Bit..." - if FileExists($IniFile32$) - Set $MsiIdOld32$ = GetValueFromInifile($IniFile32$,"X86","MsiId32","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") - if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld32$ + "] DisplayName") = "") - comment "Old MSI id " + $MsiIdOld32$ + " found in registry, starting msiexec to uninstall old version" - Winbatch_uninstall_msi_old_32 - sub_check_exitcode - endif - endif - - if FileExists($UninstallProgram32$) - comment "Uninstall program found, starting uninstall" - Winbatch_uninstall_32 - sub_check_exitcode - endif + if FileExists($IniFile32$) + Set $MsiIdOld32$ = GetValueFromInifile($IniFile32$,"X86","MsiId32","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld32$ + "] DisplayName") = "") + comment "Old MSI id " + $MsiIdOld32$ + " found in registry, starting msiexec to uninstall old version" + Winbatch_uninstall_msi_old_32 + sub_check_exitcode + endif + endif if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32$ + "] DisplayName") = "") comment "MSI id " + $MsiId32$ + " found in registry, starting msiexec to uninstall" @@ -35,9 +26,9 @@ if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specif sub_check_exitcode endif - comment "Disables the pop-up browser window" - Winbatch_killtasks_32 - + comment "Disables the pop-up browser window" + Winbatch_killtasks_32 + comment "Delete files" Files_uninstall_32 /32Bit comment "Cleanup registry" @@ -47,19 +38,14 @@ endif if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) Message "Uninstalling " + $ProductId$ + " 64 Bit..." - if FileExists($IniFile64$) - Set $MsiIdOld64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiId64","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") - if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld64$ + "] DisplayName") = "") - comment "Old MSI id " + $MsiIdOld64$ + " found in registry, starting msiexec to uninstall old version" - Winbatch_uninstall_msi_old_64 - sub_check_exitcode - endif - endif - if FileExists($UninstallProgram64$) - comment "Uninstall program found, starting uninstall" - Winbatch_uninstall_64 - sub_check_exitcode - endif + if FileExists($IniFile64$) + Set $MsiIdOld64$ = GetValueFromInifile($IniFile64$,"X86_64","MsiId64","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}") + if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiIdOld64$ + "] DisplayName") = "") + comment "Old MSI id " + $MsiIdOld64$ + " found in registry, starting msiexec to uninstall old version" + Winbatch_uninstall_msi_old_64 + sub_check_exitcode + endif + endif if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId64$ + "] DisplayName") = "") comment "MSI id " + $MsiId64$ + " found in registry, starting msiexec to uninstall" @@ -67,9 +53,9 @@ if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system spe sub_check_exitcode endif - comment "Disables the pop-up browser window" - Winbatch_killtasks_64 - + comment "Disables the pop-up browser window" + Winbatch_killtasks_64 + comment "Delete files" Files_uninstall_64 /64Bit comment "Cleanup registry" @@ -79,22 +65,9 @@ endif comment "Delete program shortcuts" LinkFolder_uninstall -[Winbatch_uninstall_32] -; Choose one of the following examples as basis for program uninstall -; -; === Nullsoft Scriptable Install System ================================================================ -; "$UninstallProgram32$" /S -; -; === Inno Setup ======================================================================================== -; "$UninstallProgram32$" /silent /norestart /SUPPRESSMSGBOXES - - [Winbatch_killtasks_32] %ScriptPath%\X86\closewindow.exe "Before you go" "" -[Winbatch_killtasks_64] -%ScriptPath%\X86_64\closewindow.exe "Before you go" "" - [Winbatch_uninstall_msi_old_32] msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress @@ -102,22 +75,12 @@ msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress [Files_uninstall_32] -delete "$IniFile32$" -delete -sf "$InstallDir32$\" - ; Example for recursively deleting the installation directory (don't forget the trailing backslash): ; ; delete -sf "$InstallDir32$\" -[Winbatch_uninstall_64] -; Choose one of the following examples as basis for program uninstall -; -; === Nullsoft Scriptable Install System ================================================================ -; "$UninstallProgram64$" /S -; -; === Inno Setup ======================================================================================== -; "$UninstallProgram64$" /silent /norestart /SUPPRESSMSGBOXES - +[Winbatch_killtasks_64] +%ScriptPath%\X86_64\closewindow.exe "Before you go" "" [Winbatch_uninstall_msi_old_64] msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress @@ -126,12 +89,9 @@ msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress [Files_uninstall_64] -delete "$IniFile64$" -delete -sf "$InstallDir64$\" - -; Example for recursively deleting the installation directory (don't forget the trailing backslash): +; Example for recursively deleting the installation directory: ; -; delete -sf "$InstallDir64$\" +; del -sf "$InstallDir64$\" [Registry_uninstall] ; Example of deleting a registry key: diff --git a/CLIENT_DATA/setup3264.ins b/CLIENT_DATA/setup3264.ins index ed3d610..e69a8ad 100644 --- a/CLIENT_DATA/setup3264.ins +++ b/CLIENT_DATA/setup3264.ins @@ -1,18 +1,14 @@ ; 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/credits/ +; credits: http://www.opsi.org/en/credits/ [Actions] -requiredWinstVersion >= "4.10.8.6" +requiredWinstVersion >= "4.11.2.6" -; DefVar $MsiId32$ DefVar $MsiIdOld32$ -DefVar $UninstallProgram32$ DefVar $IniFile32$ -; DefVar $MsiId64$ DefVar $MsiIdOld64$ -DefVar $UninstallProgram64$ DefVar $IniFile64$ DefVar $IniCfgFile$ DefVar $LogDir$ @@ -21,16 +17,12 @@ DefVar $MinimumSpace$ DefVar $InstallDir32$ DefVar $InstallDir64$ DefVar $ExitCode$ -DefVar $LicenseRequired$ -DefVar $LicenseKey$ -DefVar $LicensePool$ DefVar $INST_SystemType$ DefVar $INST_architecture$ Set $INST_SystemType$ = GetSystemType set $INST_architecture$ = GetProductProperty("install_architecture","system specific") - Set $LogDir$ = "%SystemDrive%\tmp" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh @@ -49,16 +41,14 @@ Set $LogDir$ = "%SystemDrive%\tmp" ;$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$ = "nitro.pdfreader" Set $MinimumSpace$ = "200 MB" ; the path were we find the product after the installation Set $InstallDir32$ = "%ProgramFiles32Dir%\Nitro\Reader 3" Set $InstallDir64$ = "%ProgramFiles64Dir%\Nitro\Reader 3" -Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" -Set $LicenseRequired$ = "false" -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 @@ -72,19 +62,14 @@ else Sub "%ScriptPath%\delsub3264.ins" endif - if $LicenseRequired$ = "true" - comment "Licensing required, reserve license and get license key" - Sub_get_licensekey - endif - comment "installing" if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only") Message "Installing " + $ProductId$ + " 32 Bit..." - comment "Extract the setup programm" + comment "Start setup program" + ChangeDirectory "%SCRIPTPATH%" Winbatch_extract_32 Sub_check_exitcode - comment "Start setup program" Winbatch_install_32 Sub_check_exitcode comment "Copy files" @@ -97,17 +82,16 @@ else if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only")) Message "Installing " + $ProductId$ + " 64 Bit..." - comment "Extract the setup programm" + comment "Start setup program" + ChangeDirectory "%SCRIPTPATH%" Winbatch_extract_64 Sub_check_exitcode - comment "Start setup program" Winbatch_install_64 Sub_check_exitcode comment "Copy files" Files_install_64 /64Bit comment "Patch Registry" - ; Registry_install /64Bit - Registry_install /32Bit + Registry_install /64Bit comment "Create shortcuts" LinkFolder_install endif @@ -118,9 +102,10 @@ endif "$Install32Exe$" /EXTRACTMSI:$LogDir$\nitro-32.msi [Winbatch_install_32] -msiexec /i "$LogDir$\nitro-32.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress +msiexec /i "$LogDir$\nitro-32.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress [Files_install_32] +; copy the ini file to the InstallDir copy "$IniCfgFile$" "$InstallDir32$" ; Example of recursively copying some files into the installation directory: @@ -131,9 +116,10 @@ copy "$IniCfgFile$" "$InstallDir32$" "$Install64Exe$" /EXTRACTMSI:$LogDir$\nitro-64.msi [Winbatch_install_64] -msiexec /i "$LogDir$\nitro-64.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress +msiexec /i "$LogDir$\nitro-64.msi" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress [Files_install_64] +; copy the ini file to the InstallDir copy "$IniCfgFile$" "$InstallDir64$" ; Example of recursively copying some files into the installation directory: @@ -147,8 +133,6 @@ copy "$IniCfgFile$" "$InstallDir64$" ; set "name1" = "some string value" ; set "name2" = REG_DWORD:0001 ; set "name3" = REG_BINARY:00 af 99 cd -openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Nitro\Reader\3.0\settings] -set "Pip2Enabled" = "0" [LinkFolder_install] ; Example of deleting a folder from AllUsers startmenu: @@ -184,38 +168,6 @@ set "Pip2Enabled" = "0" ; icon_index: 2 ; end_link -[Sub_get_licensekey] -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 - [Sub_check_exitcode] comment "Test for installation success via exit code" set $ExitCode$ = getLastExitCode diff --git a/CLIENT_DATA/uninstall3264.ins b/CLIENT_DATA/uninstall3264.ins index c96b6f0..0e745f2 100644 --- a/CLIENT_DATA/uninstall3264.ins +++ b/CLIENT_DATA/uninstall3264.ins @@ -1,18 +1,14 @@ ; Copyright (c) uib gmbh (www.uib.de) ; This sourcecode is owned by uib gmbh ; and published under the Terms of the General Public License. -; credits: http://www.opsi.org/credits/ +; credits: http://www.opsi.org/en/credits/ [Actions] -requiredWinstVersion >= "4.10.8.6" +requiredWinstVersion >= "4.11.2.6" -; DefVar $MsiId32$ DefVar $MsiIdOld32$ -DefVar $UninstallProgram32$ DefVar $IniFile32$ -; DefVar $MsiId64$ DefVar $MsiIdOld64$ -DefVar $UninstallProgram64$ DefVar $IniFile64$ DefVar $IniCfgFile$ DefVar $LogDir$ @@ -20,15 +16,12 @@ DefVar $ExitCode$ DefVar $ProductId$ DefVar $InstallDir32$ DefVar $InstallDir64$ -DefVar $LicenseRequired$ -DefVar $LicensePool$ DefVar $INST_SystemType$ DefVar $INST_architecture$ Set $INST_SystemType$ = GetSystemType set $INST_architecture$ = GetProductProperty("install_architecture","system specific") - Set $LogDir$ = "%SystemDrive%\tmp" ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh @@ -44,13 +37,11 @@ Set $LogDir$ = "%SystemDrive%\tmp" ; ---------------------------------------------------------------- ; - Please edit the following values - ; ---------------------------------------------------------------- -Set $ProductId$ = "nitro.pdfreader" -Set $InstallDir32$ = "%ProgramFiles32Dir%\Nitro\Reader 3" -Set $InstallDir64$ = "%ProgramFiles64Dir%\Nitro\Reader 3" -Set $LicenseRequired$ = "false" -Set $LicensePool$ = "p_" + $ProductId$ +Set $InstallDir32$ = "%ProgramFiles32Dir%\Nitro\Reader 3" +Set $InstallDir64$ = "%ProgramFiles64Dir%\Nitro\Reader 3" ; ---------------------------------------------------------------- +Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" comment "Show product picture" ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ @@ -62,23 +53,3 @@ if FileExists("%ScriptPath%\delsub3264.ins") Sub "%ScriptPath%\delsub3264.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$) - - diff --git a/OPSI/changelog.txt b/OPSI/changelog.txt index e69de29..bc69317 100644 --- a/OPSI/changelog.txt +++ b/OPSI/changelog.txt @@ -0,0 +1,2 @@ +Don't add cahngelog entries here! +It get autogenerated by the opsi-builder.sh \ No newline at end of file diff --git a/OPSI/control b/OPSI/control index 27bcdfc..d3f60e3 100644 --- a/OPSI/control +++ b/OPSI/control @@ -1,16 +1,16 @@ [Package] -version: RELEASE +version: 2 depends: incremental: False [Product] type: localboot -id: nitro.pdfreader -name: Nitro PDF Reader -description: Der einzige kostenlose PDF-Reader, der PDF-Dateien anzeigen und erstellen kann -advice: ADVICE -version: VERSION -priority: PRIORITY +id: opsi-template +name: opsi template product +description: A template for opsi products +advice: +version: 4.0.2 +priority: 0 licenseRequired: False productClasses: setupScript: setup3264.ins @@ -19,7 +19,7 @@ updateScript: alwaysScript: onceScript: customScript: -userLoginScript: +userLoginScript: [ProductProperty] type: unicode @@ -36,3 +36,4 @@ requiredProduct: sereby.aio requiredStatus: installed requirementType: before + diff --git a/builder-product.cfg b/builder-product.cfg index c036157..34bd500 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -32,9 +32,9 @@ DL_WINST_NAME[2]=Install64Exe ICON_DL_INDEX=0 OPSI_INI_SECTION[0]="X86" -OPSI_INI_NAME[0]="MsiId32" +OPSI_INI_OPTION[0]="MsiId32" OPSI_INI_VALUE[0]="{7B0BEA94-65C0-4A12-A702-6AC18B95A067}" OPSI_INI_SECTION[1]="X86_64" -OPSI_INI_NAME[1]="MsiId64" +OPSI_INI_OPTION[1]="MsiId64" OPSI_INI_VALUE[1]="{0BE7C451-4741-4154-9633-830019ACFD39}" diff --git a/nitroreader3.5.txt b/nitroreader3.5.txt deleted file mode 100644 index 062c4e5..0000000 --- a/nitroreader3.5.txt +++ /dev/null @@ -1 +0,0 @@ -ProductCode, {7B0BEA94-65C0-4A12-A702-6AC18B95A067}