new support for old versions of package

This commit is contained in:
Mario Fetka 2012-05-12 21:18:37 +02:00
parent 9007cb72d4
commit 021d1a761a
11 changed files with 123 additions and 10 deletions

View File

@ -4,11 +4,19 @@
; credits: http://www.opsi.org/credits/ ; credits: http://www.opsi.org/credits/
Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe" Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
Message "Uninstalling " + $ProductId$ + " ..." 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$) if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
Winbatch_uninstall Winbatch_uninstall
@ -39,6 +47,9 @@ LinkFolder_uninstall
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES ; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES
[Winbatch_uninstall_msi_old]
msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi] [Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress

View File

@ -4,15 +4,25 @@
; credits: http://www.opsi.org/credits/ ; credits: http://www.opsi.org/credits/
Set $MsiId32$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram32$ = $InstallDir32$ + "\uninstall.exe" Set $UninstallProgram32$ = $InstallDir32$ + "\uninstall.exe"
Set $MsiId64$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram64$ = $InstallDir64$ + "\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") if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
Message "Uninstalling " + $ProductId$ + " 32 Bit..." 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$) if FileExists($UninstallProgram32$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_32 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")) 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..." 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$) if FileExists($UninstallProgram64$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
Winbatch_uninstall_64 Winbatch_uninstall_64
@ -65,6 +83,9 @@ LinkFolder_uninstall
; "$UninstallProgram32$" /silent /norestart /SUPPRESSMSGBOXES ; "$UninstallProgram32$" /silent /norestart /SUPPRESSMSGBOXES
[Winbatch_uninstall_msi_old_32]
msiexec /x $MsiIdOld32$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi_32] [Winbatch_uninstall_msi_32]
msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
@ -83,6 +104,9 @@ msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
; "$UninstallProgram64$" /silent /norestart /SUPPRESSMSGBOXES ; "$UninstallProgram64$" /silent /norestart /SUPPRESSMSGBOXES
[Winbatch_uninstall_msi_old_64]
msiexec /x $MsiIdOld64$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi_64] [Winbatch_uninstall_msi_64]
msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress

View File

@ -4,11 +4,19 @@
; credits: http://www.opsi.org/credits/ ; credits: http://www.opsi.org/credits/
Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe" Set $UninstallProgram$ = $InstallDir$ + "\uninstall.exe"
Set $IniFile$ = $InstallDir$ + "\opsi-" + $ProductId$ + ".ini"
Message "Uninstalling " + $ProductId$ + " ..." Message "Uninstalling " + $ProductId$ + " ..."
if FileExists($IniFile$)
Set $MsiIdOld$ = GetValueFromInifile($IniFile$,"X86_64","MsiId","{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}")
if not (GetRegistryStringValue64("[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$) if FileExists($UninstallProgram$)
comment "Uninstall program found, starting uninstall" comment "Uninstall program found, starting uninstall"
Winbatch_uninstall Winbatch_uninstall
@ -39,6 +47,9 @@ LinkFolder_uninstall
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES ; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES
[Winbatch_uninstall_msi_old]
msiexec /x $MsiIdOld$ /qb! REBOOT=ReallySuppress
[Winbatch_uninstall_msi] [Winbatch_uninstall_msi]
msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress

View File

@ -0,0 +1,11 @@
[X86]
MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MsiId32={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[X86_64]
MsiId={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MsiId64={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[COMMON]
PN=name
VERSION=version

View File

@ -6,8 +6,11 @@
[Actions] [Actions]
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId$ ; DefVar $MsiId$
DefVar $MsiIdOld$
DefVar $UninstallProgram$ DefVar $UninstallProgram$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ProductId$ DefVar $ProductId$
DefVar $MinimumSpace$ DefVar $MinimumSpace$
@ -39,6 +42,7 @@ Set $ProductId$ = "opsi-template"
Set $MinimumSpace$ = "1 MB" Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles32Dir%\<path to the product>" Set $InstallDir$ = "%ProgramFiles32Dir%\<path to the product>"
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
Set $LicenseRequired$ = "false" Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$ Set $LicensePool$ = "p_" + $ProductId$
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -114,6 +118,9 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES ; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[Files_install] [Files_install]
; copy the ini file to the InstallDir
copy "$IniCfgFile$" "$InstallDir$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"

View File

@ -6,10 +6,15 @@
[Actions] [Actions]
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId32$ ; DefVar $MsiId32$
DefVar $MsiIdOld32$
DefVar $UninstallProgram32$ DefVar $UninstallProgram32$
DefVar $MsiId64$ DefVar $IniFile32$
; DefVar $MsiId64$
DefVar $MsiIdOld64$
DefVar $UninstallProgram64$ DefVar $UninstallProgram64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ProductId$ DefVar $ProductId$
DefVar $MinimumSpace$ DefVar $MinimumSpace$
@ -49,6 +54,7 @@ Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir32$ = "%ProgramFiles32Dir%\<path to the product>" Set $InstallDir32$ = "%ProgramFiles32Dir%\<path to the product>"
Set $InstallDir64$ = "%ProgramFiles64Dir%\<path to the product>" Set $InstallDir64$ = "%ProgramFiles64Dir%\<path to the product>"
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
Set $LicenseRequired$ = "false" Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$ Set $LicensePool$ = "p_" + $ProductId$
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -128,6 +134,8 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES ; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[Files_install_32] [Files_install_32]
copy "$IniCfgFile$" "$InstallDir32$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
@ -159,6 +167,8 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES ; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[Files_install_64] [Files_install_64]
copy "$IniCfgFile$" "$InstallDir64$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"

View File

@ -6,9 +6,11 @@
[Actions] [Actions]
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId$ ; DefVar $MsiId$
DefVar $UninstallProgram$ DefVar $UninstallProgram$
DefVar $LogDir$ DefVar $LogDir$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $ProductId$ DefVar $ProductId$
DefVar $MinimumSpace$ DefVar $MinimumSpace$
DefVar $InstallDir$ DefVar $InstallDir$
@ -39,6 +41,7 @@ Set $ProductId$ = "opsi-template"
Set $MinimumSpace$ = "1 MB" Set $MinimumSpace$ = "1 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir$ = "%ProgramFiles64Dir%\<path to the product>" Set $InstallDir$ = "%ProgramFiles64Dir%\<path to the product>"
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
Set $LicenseRequired$ = "false" Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$ Set $LicensePool$ = "p_" + $ProductId$
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -114,6 +117,8 @@ endif
; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES ; "%ScriptPath%\setup.exe" /sp- /silent /norestart /SUPPRESSMSGBOXES
[Files_install] [Files_install]
copy "$IniCfgFile$" "$InstallDir$"
; Example of recursively copying some files into the installation directory: ; Example of recursively copying some files into the installation directory:
; ;
; copy -s "%ScriptPath%\files\*.*" "$InstallDir$" ; copy -s "%ScriptPath%\files\*.*" "$InstallDir$"

View File

@ -7,8 +7,11 @@
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId$ DefVar $MsiId$
DefVar $MsiIdOld$
DefVar $UninstallProgram$ DefVar $UninstallProgram$
DefVar $LogDir$ DefVar $LogDir$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $ExitCode$ DefVar $ExitCode$
DefVar $ProductId$ DefVar $ProductId$
DefVar $InstallDir$ DefVar $InstallDir$

View File

@ -7,9 +7,14 @@
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId32$ DefVar $MsiId32$
DefVar $MsiIdOld32$
DefVar $UninstallProgram32$ DefVar $UninstallProgram32$
DefVar $IniFile32$
DefVar $MsiId64$ DefVar $MsiId64$
DefVar $MsiIdOld64$
DefVar $UninstallProgram64$ DefVar $UninstallProgram64$
DefVar $IniFile64$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ExitCode$ DefVar $ExitCode$
DefVar $ProductId$ DefVar $ProductId$

View File

@ -7,7 +7,10 @@
requiredWinstVersion >= "4.10.8.6" requiredWinstVersion >= "4.10.8.6"
DefVar $MsiId$ DefVar $MsiId$
DefVar $MsiIdOld$
DefVar $UninstallProgram$ DefVar $UninstallProgram$
DefVar $IniFile$
DefVar $IniCfgFile$
DefVar $LogDir$ DefVar $LogDir$
DefVar $ExitCode$ DefVar $ExitCode$
DefVar $ProductId$ DefVar $ProductId$

View File

@ -103,13 +103,36 @@ DL_WINST_NAME[2]=itWESS64
DL_FILE[3]="AiO-Runtimes-x86-v1.7.1.7z" DL_FILE[3]="AiO-Runtimes-x86-v1.7.1.7z"
DL_SOURCE[3]="http://ftp.computerbase.de/dl-758/weJMhoTGCTbFI5mzRnMlAg/1327825564/AiO-Runtimes-x86-v1.7.1.7z" DL_SOURCE[3]="http://ftp.computerbase.de/dl-758/weJMhoTGCTbFI5mzRnMlAg/1327825564/AiO-Runtimes-x86-v1.7.1.7z"
DL_ARCH[3]="X86" DL_ARCH[3]="X86"
DL_DOWNLOADER="wget" DL_DOWNLOADER[3]="wget"
DL_EXTRACT_FORMAT[3]="unzip" DL_EXTRACT_FORMAT[3]="unzip"
DL_EXTACT_TO[3]="office" DL_EXTACT_TO[3]="office"
# File array index for the image showing while installing the program # File array index for the image showing while installing the program
ICON_DL_INDEX=0 ICON_DL_INDEX=0
#########################
# Setup required WINST variables
# which will be injected to the *.ins files (replaces token @@BUILDER_VARIABLES@@ )
#
# The following tokens inside the WINST_VALUE will be replaced dynamically
#
# if your package is not msi based then you can remove the msi part from *.ins files and drop this variables compleatly
# !!! These Variables are requred if you remove them in this cfg file you will get error's about not defined Variables !!!
#
#########################
# if the packaga just supports X86 OR X86_64 (setupXX.ins delsubXX.ins uninstallXX.ins) then you have to just specify one MsiId
WINST_NAME[0]="MsiId"
WINST_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
# if the package supports X86 AND X86_64 (setup3264.ins delsub3264.ins uninstall3264.ins) then you have to specify 2 MsiId's
WINST_NAME[0]="MsiId32"
WINST_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
WINST_NAME[1]="MsiId64"
WINST_VALUE[1]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
######################### #########################
# Setup additional, custom WINST variables # Setup additional, custom WINST variables
# which will be injected to the *.ins files (replaces token @@BUILDER_VARIABLES@@ ) # which will be injected to the *.ins files (replaces token @@BUILDER_VARIABLES@@ )