From 8319e1a2a6eb8a92275a935bea56765ac6b96bb9 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 24 Feb 2013 14:01:34 +0100 Subject: [PATCH] Bump with proper uninstall of old release based in setup programm --- CLIENT_DATA/{delsub.ins => delsub3264.ins} | 40 +++++++-- CLIENT_DATA/opsi-cdburnerxp.cdburnerxp.ini | 9 ++ CLIENT_DATA/{setup.ins => setup3264.ins} | 87 +++++++++---------- .../{uninstall.ins => uninstall3264.ins} | 45 +++++----- OPSI/control | 4 +- builder-product.cfg | 26 +++--- cdbxp_setup_4.5.0.3717_minimal.exe.sha1sum | 1 - ...p_setup_4.5.0.3717_x64_minimal.exe.sha1sum | 1 - cdbxp_setup_4.5.1.3868.msi.sha1sum | 1 + cdbxp_setup_x64_4.5.1.3868.msi.sha1sum | 1 + 10 files changed, 129 insertions(+), 86 deletions(-) rename CLIENT_DATA/{delsub.ins => delsub3264.ins} (71%) create mode 100644 CLIENT_DATA/opsi-cdburnerxp.cdburnerxp.ini rename CLIENT_DATA/{setup.ins => setup3264.ins} (78%) rename CLIENT_DATA/{uninstall.ins => uninstall3264.ins} (67%) delete mode 100644 cdbxp_setup_4.5.0.3717_minimal.exe.sha1sum delete mode 100644 cdbxp_setup_4.5.0.3717_x64_minimal.exe.sha1sum create mode 100644 cdbxp_setup_4.5.1.3868.msi.sha1sum create mode 100644 cdbxp_setup_x64_4.5.1.3868.msi.sha1sum diff --git a/CLIENT_DATA/delsub.ins b/CLIENT_DATA/delsub3264.ins similarity index 71% rename from CLIENT_DATA/delsub.ins rename to CLIENT_DATA/delsub3264.ins index 1539e03..73dc23f 100644 --- a/CLIENT_DATA/delsub.ins +++ b/CLIENT_DATA/delsub3264.ins @@ -4,15 +4,25 @@ ; credits: http://www.opsi.org/credits/ -Set $MsiId32$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}' Set $UninstallProgram32$ = $InstallDir32$ + "\unins000.exe" - -Set $MsiId64$ = '{23170F69-40C1-2702-0920-000001000000}' Set $UninstallProgram64$ = $InstallDir64$ + "\unins000.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 @@ -34,6 +44,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 @@ -59,9 +77,15 @@ LinkFolder_uninstall ; Choose one of the following examples as basis for program uninstall ; ; === Nullsoft Scriptable Install System ================================================================ -"$UninstallProgram32$" /VERYSILENT +; "$UninstallProgram32$" /S +; +; === Inno Setup ======================================================================================== +; "$UninstallProgram32$" /silent /norestart /SUPPRESSMSGBOXES +[Winbatch_uninstall_msi_old_32] +msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress + [Winbatch_uninstall_msi_32] msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress @@ -74,9 +98,15 @@ msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress ; Choose one of the following examples as basis for program uninstall ; ; === Nullsoft Scriptable Install System ================================================================ -"$UninstallProgram64$" /VERYSILENT +; "$UninstallProgram64$" /S +; +; === Inno Setup ======================================================================================== +; "$UninstallProgram64$" /silent /norestart /SUPPRESSMSGBOXES +[Winbatch_uninstall_msi_old_64] +msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress + [Winbatch_uninstall_msi_64] msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress diff --git a/CLIENT_DATA/opsi-cdburnerxp.cdburnerxp.ini b/CLIENT_DATA/opsi-cdburnerxp.cdburnerxp.ini new file mode 100644 index 0000000..9f087ee --- /dev/null +++ b/CLIENT_DATA/opsi-cdburnerxp.cdburnerxp.ini @@ -0,0 +1,9 @@ +[X86] +MsiId32={3867AA1B-BF01-4492-9E3A-DA032C94F424} + +[X86_64] +MsiId64={2049837C-257A-4F11-BC7B-2EAC6C043B26} + +[COMMON] +PN=cdburnerxp.cdburnerxp +VERSION=4.5.1.3868 diff --git a/CLIENT_DATA/setup.ins b/CLIENT_DATA/setup3264.ins similarity index 78% rename from CLIENT_DATA/setup.ins rename to CLIENT_DATA/setup3264.ins index edec09f..f99241b 100644 --- a/CLIENT_DATA/setup.ins +++ b/CLIENT_DATA/setup3264.ins @@ -6,10 +6,15 @@ [Actions] requiredWinstVersion >= "4.10.8.6" -DefVar $MsiId32$ +; DefVar $MsiId32$ +DefVar $MsiIdOld32$ DefVar $UninstallProgram32$ -DefVar $MsiId64$ +DefVar $IniFile32$ +; DefVar $MsiId64$ +DefVar $MsiIdOld64$ DefVar $UninstallProgram64$ +DefVar $IniFile64$ +DefVar $IniCfgFile$ DefVar $LogDir$ DefVar $ProductId$ DefVar $MinimumSpace$ @@ -49,6 +54,7 @@ Set $MinimumSpace$ = "30 MB" ; the path were we find the product after the installation Set $InstallDir32$ = "%ProgramFiles32Dir%\CDBurnerXP" Set $InstallDir64$ = "%ProgramFiles64Dir%\CDBurnerXP" +Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini" Set $LicenseRequired$ = "false" Set $LicensePool$ = "p_" + $ProductId$ ; ---------------------------------------------------------------- @@ -61,9 +67,9 @@ else comment "Show product picture" ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ - if FileExists("%ScriptPath%\delsub.ins") + if FileExists("%ScriptPath%\delsub3264.ins") comment "Start uninstall sub section" - Sub "%ScriptPath%\delsub.ins" + Sub "%ScriptPath%\delsub3264.ins" endif if $LicenseRequired$ = "true" @@ -102,26 +108,25 @@ else endif [Winbatch_install_32] -; 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 ================================================================ -"$Install32Exe$" /verysilent ALLUSERS=1 +; === MSI package ======================================================================================= +; You may use the parameter PIDKEY=$Licensekey$ +msiexec /i "$Install32Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress [Files_install_32] +copy "$IniCfgFile$" "$InstallDir32$" + ; Example of recursively copying some files into the installation directory: ; ; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$" [Winbatch_install_64] -; Choose one of the following examples as basis for your installation -; You can use $LicenseKey$ var to pass a license key to the installer -; ; === MSI package ======================================================================================= ; You may use the parameter PIDKEY=$Licensekey$ -"$Install64Exe$" /verysilent ALLUSERS=1 +msiexec /i "$Install64Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress [Files_install_64] +copy "$IniCfgFile$" "$InstallDir64$" + ; Example of recursively copying some files into the installation directory: ; ; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$" @@ -169,43 +174,37 @@ endif ; end_link [Sub_get_licensekey] -if opsiLicenseManagementEnabled - comment "License management is enabled and will be used" +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 +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 - 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 - [Sub_check_exitcode] comment "Test for installation success via exit code" set $ExitCode$ = getLastExitCode diff --git a/CLIENT_DATA/uninstall.ins b/CLIENT_DATA/uninstall3264.ins similarity index 67% rename from CLIENT_DATA/uninstall.ins rename to CLIENT_DATA/uninstall3264.ins index 2453080..358f535 100644 --- a/CLIENT_DATA/uninstall.ins +++ b/CLIENT_DATA/uninstall3264.ins @@ -6,10 +6,15 @@ [Actions] requiredWinstVersion >= "4.10.8.6" -DefVar $MsiId32$ +; DefVar $MsiId32$ +DefVar $MsiIdOld32$ DefVar $UninstallProgram32$ -DefVar $MsiId64$ +DefVar $IniFile32$ +; DefVar $MsiId64$ +DefVar $MsiIdOld64$ DefVar $UninstallProgram64$ +DefVar $IniFile64$ +DefVar $IniCfgFile$ DefVar $LogDir$ DefVar $ExitCode$ DefVar $ProductId$ @@ -40,8 +45,8 @@ Set $LogDir$ = "%SystemDrive%\tmp" ; - Please edit the following values - ; ---------------------------------------------------------------- Set $ProductId$ = "cdburnerxp.cdburnerxp" -Set $InstallDir32$ = "%ProgramFiles32Dir%\CDBurnerXP" -Set $InstallDir64$ = "%ProgramFiles64Dir%\CDBurnerXP" +Set $InstallDir32$ = "%ProgramFiles32Dir%\CDBurnerXP" +Set $InstallDir64$ = "%ProgramFiles64Dir%\CDBurnerXP" Set $LicenseRequired$ = "false" Set $LicensePool$ = "p_" + $ProductId$ ; ---------------------------------------------------------------- @@ -52,9 +57,9 @@ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ Message "Uninstalling " + $ProductId$ + " ..." -if FileExists("%ScriptPath%\delsub.ins") +if FileExists("%ScriptPath%\delsub3264.ins") comment "Start uninstall sub section" - Sub "%ScriptPath%\delsub.ins" + Sub "%ScriptPath%\delsub3264.ins" endif if $LicenseRequired$ = "true" @@ -63,23 +68,17 @@ 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$) diff --git a/OPSI/control b/OPSI/control index 104c02c..5911eb0 100644 --- a/OPSI/control +++ b/OPSI/control @@ -13,8 +13,8 @@ version: VERSION priority: PRIORITY licenseRequired: False productClasses: -setupScript: setup.ins -uninstallScript: uninstall.ins +setupScript: setup3264.ins +uninstallScript: uninstall3264.ins updateScript: alwaysScript: onceScript: diff --git a/builder-product.cfg b/builder-product.cfg index dd0dd49..e4867dd 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -3,7 +3,7 @@ ############################ VENDOR="cdburnerxp.se" PN="cdburnerxp.cdburnerxp" -VERSION="4.5.0.3717" +VERSION="4.5.1.3868" RELEASE="1" PRIORITY="0" ADVICE="" @@ -15,19 +15,25 @@ TYPE="public" DL_FILE[0]="cdburnerxp-icon.png" DL_SOURCE[0]="http://2.bp.blogspot.com/-EcI3aRnd1VM/Tcbn_dipuII/AAAAAAAAAGI/lCXyXMjmRYI/s200/cdburnerxp.png" -#DL_FILE[1]="cdbxp_setup_${VERSION}.exe" -#DL_SOURCE[1]="http://cdburnerxp.se/downloadsetup.exe" -DL_FILE[1]="cdbxp_setup_${VERSION}_minimal.exe" -DL_SOURCE[1]="http://download.cdburnerxp.se/minimal/4886a85775676a3397bc6a1692bfaf37/50e459b4/cdbxp_setup_${VERSION}_minimal.exe" +DL_FILE[1]="cdbxp_setup_${VERSION}.msi" +DL_SOURCE[1]="http://download.cdburnerxp.se/msi/cdbxp_setup_${VERSION}.msi" DL_ARCH[1]="X86" DL_WINST_NAME[1]=Install32Exe -#DL_FILE[2]="cdbxp_setup_${VERSION}_x64.exe" -#DL_SOURCE[2]="http://cdburnerxp.se/downloadsetup.exe?x64" -DL_FILE[2]="cdbxp_setup_${VERSION}_x64_minimal.exe" -DL_SOURCE[2]="http://download.cdburnerxp.se/minimal/e5c720de18df718873c5888f042e238a/50e459b4/cdbxp_setup_${VERSION}_x64_minimal.exe" +DL_FILE[2]="cdbxp_setup_x64_${VERSION}.msi" +DL_SOURCE[2]="http://download.cdburnerxp.se/msi/cdbxp_setup_x64_${VERSION}.msi" DL_ARCH[2]="X86_64" DL_WINST_NAME[2]=Install64Exe # File array index for the image showing while installing the program -ICON_DL_INDEX=0 \ No newline at end of file +ICON_DL_INDEX=0 + + +WINST_NAME[0]="MsiId32" +WINST_VALUE[0]="{3867AA1B-BF01-4492-9E3A-DA032C94F424}" + + +WINST_NAME[1]="MsiId64" +WINST_VALUE[1]="{2049837C-257A-4F11-BC7B-2EAC6C043B26}" + + diff --git a/cdbxp_setup_4.5.0.3717_minimal.exe.sha1sum b/cdbxp_setup_4.5.0.3717_minimal.exe.sha1sum deleted file mode 100644 index bb59888..0000000 --- a/cdbxp_setup_4.5.0.3717_minimal.exe.sha1sum +++ /dev/null @@ -1 +0,0 @@ -2fcee9b5992c567d586f640c60c0a7dfd8cd5e73 /home/mario/.opsi-dist-cache/cdburnerxp.cdburnerxp-4.5.0.3717/X86/cdbxp_setup_4.5.0.3717_minimal.exe diff --git a/cdbxp_setup_4.5.0.3717_x64_minimal.exe.sha1sum b/cdbxp_setup_4.5.0.3717_x64_minimal.exe.sha1sum deleted file mode 100644 index 3140f84..0000000 --- a/cdbxp_setup_4.5.0.3717_x64_minimal.exe.sha1sum +++ /dev/null @@ -1 +0,0 @@ -e5f0654a3da867131ca5b6c52e4028bdfafd8777 /home/mario/.opsi-dist-cache/cdburnerxp.cdburnerxp-4.5.0.3717/X86_64/cdbxp_setup_4.5.0.3717_x64_minimal.exe diff --git a/cdbxp_setup_4.5.1.3868.msi.sha1sum b/cdbxp_setup_4.5.1.3868.msi.sha1sum new file mode 100644 index 0000000..251d967 --- /dev/null +++ b/cdbxp_setup_4.5.1.3868.msi.sha1sum @@ -0,0 +1 @@ +ea09cee19e1df58e9e8215c941dfd94ba8520670 /home/mario/.opsi-dist-cache/cdburnerxp.cdburnerxp-4.5.1.3868/X86/cdbxp_setup_4.5.1.3868.msi diff --git a/cdbxp_setup_x64_4.5.1.3868.msi.sha1sum b/cdbxp_setup_x64_4.5.1.3868.msi.sha1sum new file mode 100644 index 0000000..3d01342 --- /dev/null +++ b/cdbxp_setup_x64_4.5.1.3868.msi.sha1sum @@ -0,0 +1 @@ +1d0ed8b99c36d046ea1f796ddd3f30ae9b9b0ed3 /home/mario/.opsi-dist-cache/cdburnerxp.cdburnerxp-4.5.1.3868/X86_64/cdbxp_setup_x64_4.5.1.3868.msi