new build system and change file association

This commit is contained in:
Mario Fetka 2012-05-13 09:30:28 +02:00
parent ba737f8391
commit 940f3da59d
8 changed files with 173 additions and 83 deletions

View File

@ -1 +0,0 @@
55283ad59439134673fc32fc097bdd9ae920fbc6 /usr/portage/distfiles/7z920.exe

1
7z920.msi.sha1sum Normal file
View File

@ -0,0 +1 @@
c67d3f611ea3eb3336cf92f6ffcafdb14f8b12af /home/mario/.opsi-dist-cache/7zip.7zip-9.20/X86/7z920.msi

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 $UninstallProgram64$ = $InstallDir64$ + "\uninstall.exe"
Set $IniFile32$ = $InstallDir32$ + "\opsi-" + $ProductId$ + ".ini"
Set $IniFile64$ = $InstallDir64$ + "\opsi-" + $ProductId$ + ".ini"
Set $MsiId64$ = '{23170F69-40C1-2702-0920-000001000000}'
Set $UninstallProgram32$ = $InstallDir64$ + "\Uninstall.exe"
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
@ -59,9 +77,15 @@ LinkFolder_uninstall
; Choose one of the following examples as basis for program uninstall ; Choose one of the following examples as basis for program uninstall
; ;
; === Nullsoft Scriptable Install System ================================================================ ; === Nullsoft Scriptable Install System ================================================================
"$UninstallProgram32$" /S ; "$UninstallProgram32$" /S
;
; === Inno Setup ========================================================================================
; "$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
@ -74,9 +98,15 @@ msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
; Choose one of the following examples as basis for program uninstall ; Choose one of the following examples as basis for program uninstall
; ;
; === Nullsoft Scriptable Install System ================================================================ ; === Nullsoft Scriptable Install System ================================================================
"$UninstallProgram64$" /S ; "$UninstallProgram64$" /S
;
; === Inno Setup ========================================================================================
; "$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

@ -0,0 +1,9 @@
[X86]
MsiId32={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[X86_64]
MsiId64={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
[COMMON]
PN=7zip.7zip
VERSION=9.20

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$
@ -28,7 +33,14 @@ set $INST_architecture$ = GetProductProperty("install_architecture","system spec
Set $LogDir$ = "%SystemDrive%\tmp" Set $LogDir$ = "%SystemDrive%\tmp"
; Token BUILDER_VARIABLES will be replaced by opsi-builder.sh ; 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@@ @@BUILDER_VARIABLES@@
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -38,10 +50,11 @@ Set $LogDir$ = "%SystemDrive%\tmp"
; therefore please: only lower letters, no umlauts, ; therefore please: only lower letters, no umlauts,
; no white space use '-' as a seperator ; no white space use '-' as a seperator
Set $ProductId$ = "7zip.7zip" Set $ProductId$ = "7zip.7zip"
Set $MinimumSpace$ = "3 MB" Set $MinimumSpace$ = "10 MB"
; the path were we find the product after the installation ; the path were we find the product after the installation
Set $InstallDir32$ = "%ProgramFiles32Dir%\7-Zip" Set $InstallDir32$ = "%ProgramFiles32Dir%\7-Zip"
Set $InstallDir64$ = "%ProgramFiles64Dir%\7-Zip" Set $InstallDir64$ = "%ProgramFiles64Dir%\7-Zip"
Set $IniCfgFile$ = "%ScriptPath%\opsi-" + $ProductId$ + ".ini"
Set $LicenseRequired$ = "false" Set $LicenseRequired$ = "false"
Set $LicensePool$ = "p_" + $ProductId$ Set $LicensePool$ = "p_" + $ProductId$
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -54,9 +67,9 @@ else
comment "Show product picture" comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
if FileExists("%ScriptPath%\delsub.ins") if FileExists("%ScriptPath%\delsub3264.ins")
comment "Start uninstall sub section" comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.ins" Sub "%ScriptPath%\delsub3264.ins"
endif endif
if $LicenseRequired$ = "true" if $LicenseRequired$ = "true"
@ -71,6 +84,8 @@ else
comment "Start setup program" comment "Start setup program"
Winbatch_install_32 Winbatch_install_32
Sub_check_exitcode Sub_check_exitcode
Dosbatch_install_32
Sub_check_exitcode
comment "Copy files" comment "Copy files"
Files_install_32 /32Bit Files_install_32 /32Bit
comment "Patch Registry" comment "Patch Registry"
@ -84,6 +99,8 @@ else
comment "Start setup program" comment "Start setup program"
Winbatch_install_64 Winbatch_install_64
Sub_check_exitcode Sub_check_exitcode
Dosbatch_install_64
Sub_check_exitcode
comment "Copy files" comment "Copy files"
Files_install_64 /64Bit Files_install_64 /64Bit
comment "Patch Registry" comment "Patch Registry"
@ -95,28 +112,52 @@ else
endif endif
[Winbatch_install_32] [Winbatch_install_32]
; Choose one of the following examples as basis for your installation msiexec /i "$Install32Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress
; You can use $LicenseKey$ var to pass a license key to the installer
; [Dosbatch_install_32]
; === Nullsoft Scriptable Install System ================================================================ @echo off
"$Install32Exe$" /S /D="$InstallDir32$"
"%ScriptPath%\associate.cmd" SET SC=HKLM\Software\Classes
SET Extn=001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 dmg-17 gz-14 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 split-9 squashfs-24 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 txz-23 vhd-20 wim-15 xar-19 xz-23 z-5 zip-1001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 dmg-17 gz-14 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 split-9 squashfs-24 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 txz-23 vhd-20 wim-15 xar-19 xz-23 z-5 zip-1
FOR %%j IN (%Extn%) DO (
FOR /F "tokens=1,2 delims=-" %%A IN ("%%j") DO (
REG ADD %SC%\.%%A /VE /D "7-Zip.%%A" /F
REG ADD %SC%\7-Zip.%%A /VE /D "%%A Archive" /F
REG ADD %SC%\7-Zip.%%A\DefaultIcon /VE /D "$InstallDir32$\7z.dll,%%B" /F
REG ADD %SC%\7-Zip.%%A\shell\open\command /VE /D "\"$InstallDir32$\7zFM.exe\" \"%%1\"" /F
)
)
[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$"
[Winbatch_install_64] [Winbatch_install_64]
; Choose one of the following examples as basis for your installation msiexec /i "$Install64Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress
; You can use $LicenseKey$ var to pass a license key to the installer
; [Dosbatch_install_64]
; === MSI package ======================================================================================= @echo off
; You may use the parameter PIDKEY=$Licensekey$
msiexec /i "Install64Msi" INSTALLDIR="$InstallDir64$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=2 REBOOT=ReallySuppress SET SC=HKLM\Software\Classes
"%ScriptPath%\associate.cmd" SET Extn=001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 dmg-17 gz-14 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 split-9 squashfs-24 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 txz-23 vhd-20 wim-15 xar-19 xz-23 z-5 zip-1001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 dmg-17 gz-14 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 split-9 squashfs-24 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 txz-23 vhd-20 wim-15 xar-19 xz-23 z-5 zip-1
FOR %%j IN (%Extn%) DO (
FOR /F "tokens=1,2 delims=-" %%A IN ("%%j") DO (
REG ADD %SC%\.%%A /VE /D "7-Zip.%%A" /F
REG ADD %SC%\7-Zip.%%A /VE /D "%%A Archive" /F
REG ADD %SC%\7-Zip.%%A\DefaultIcon /VE /D "$InstallDir64$\7z.dll,%%B" /F
REG ADD %SC%\7-Zip.%%A\shell\open\command /VE /D "\"$InstallDir64$\7zFM.exe\" \"%%1\"" /F
)
)
[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$"
@ -164,7 +205,6 @@ msiexec /i "Install64Msi" INSTALLDIR="$InstallDir64$" /l* "$LogDir$\$ProductId$.
; end_link ; end_link
[Sub_get_licensekey] [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" comment "Trying to get a license key"
@ -195,11 +235,6 @@ if opsiLicenseManagementEnabled
endif endif
endif endif
endif endif
else
LogError "Fatal: license required, but license management not enabled"
isFatalError
endif
[Sub_check_exitcode] [Sub_check_exitcode]
comment "Test for installation success via exit code" comment "Test for installation success via exit code"
@ -230,3 +265,4 @@ else
endif endif
endif endif

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 $ExitCode$ DefVar $ExitCode$
DefVar $ProductId$ DefVar $ProductId$
@ -26,6 +31,16 @@ set $INST_architecture$ = GetProductProperty("install_architecture","system spec
Set $LogDir$ = "%SystemDrive%\tmp" 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 - ; - Please edit the following values -
; ---------------------------------------------------------------- ; ----------------------------------------------------------------
@ -42,9 +57,9 @@ ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
Message "Uninstalling " + $ProductId$ + " ..." Message "Uninstalling " + $ProductId$ + " ..."
if FileExists("%ScriptPath%\delsub.ins") if FileExists("%ScriptPath%\delsub3264.ins")
comment "Start uninstall sub section" comment "Start uninstall sub section"
Sub "%ScriptPath%\delsub.ins" Sub "%ScriptPath%\delsub3264.ins"
endif endif
if $LicenseRequired$ = "true" if $LicenseRequired$ = "true"
@ -53,7 +68,6 @@ if $LicenseRequired$ = "true"
endif endif
[Sub_free_license] [Sub_free_license]
if opsiLicenseManagementEnabled
comment "License management is enabled and will be used" comment "License management is enabled and will be used"
comment "Trying to free license used for the product" comment "Trying to free license used for the product"
@ -66,10 +80,5 @@ if opsiLicenseManagementEnabled
; DefVar $WindowsSoftwareId$ ; DefVar $WindowsSoftwareId$
; $WindowsSoftwareId$ = "..." ; $WindowsSoftwareId$ = "..."
; set $result$ = FreeLicense("", "", $WindowsSoftwareId$) ; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)
else
LogError "Error: licensing required, but license management not enabled"
isFatalError
endif

View File

@ -13,8 +13,8 @@ version: VERSION
priority: PRIORITY priority: PRIORITY
licenseRequired: False licenseRequired: False
productClasses: productClasses:
setupScript: setup.ins setupScript: setup3264.ins
uninstallScript: uninstall.ins uninstallScript: uninstall3264.ins
updateScript: updateScript:
alwaysScript: alwaysScript:
onceScript: onceScript:

View File

@ -16,10 +16,10 @@ TYPE="public"
DL_FILE[0]="7zip-icon.png" DL_FILE[0]="7zip-icon.png"
DL_SOURCE[0]="http://icons.iconarchive.com/icons/benjigarner/softdimension/256/7zip-icon.png" DL_SOURCE[0]="http://icons.iconarchive.com/icons/benjigarner/softdimension/256/7zip-icon.png"
DL_FILE[1]="7z920.exe" DL_FILE[1]="7z920.msi"
DL_SOURCE[1]="http://downloads.sourceforge.net/sevenzip/7z920.exe" DL_SOURCE[1]="http://downloads.sourceforge.net/sevenzip/7z920.msi"
DL_ARCH[1]="X86" DL_ARCH[1]="X86"
DL_WINST_NAME[1]=Install32Exe DL_WINST_NAME[1]=Install32Msi
DL_FILE[2]="7z920-x64.msi" DL_FILE[2]="7z920-x64.msi"
DL_SOURCE[2]="http://downloads.sourceforge.net/sevenzip/7z920-x64.msi" DL_SOURCE[2]="http://downloads.sourceforge.net/sevenzip/7z920-x64.msi"
@ -29,3 +29,9 @@ DL_WINS_NAMET[2]=Install64Msi
# 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
WINST_NAME[0]="MsiId32"
WINST_VALUE[0]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
WINST_NAME[1]="MsiId64"
WINST_VALUE[1]="{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"