Updated associations for Windows 8 and removed 32/64 bit script difference
This commit is contained in:
parent
750bfd3006
commit
541b416834
4
CLIENT_DATA/defaultassociations.xml
Normal file
4
CLIENT_DATA/defaultassociations.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<DefaultAssociations>
|
||||
<Association Identifier=".7z" ProgId="7-Zip.7z" ApplicationName="7-Zip file archiver"/>
|
||||
</DefaultAssociations>
|
@ -23,6 +23,9 @@ DefVar $OLD_VERSION$
|
||||
DefVar $OLD_CREATOR_TAG$
|
||||
DefVar $OLD_RELEASE$
|
||||
|
||||
DefVar $InstallDir$
|
||||
DefVar $ProgExe$
|
||||
|
||||
Set $INST_SystemType$ = GetSystemType
|
||||
set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
|
||||
|
||||
@ -73,7 +76,9 @@ else
|
||||
ChangeDirectory "%SCRIPTPATH%"
|
||||
Winbatch_install_32
|
||||
Sub_check_exitcode
|
||||
DosInAnIcon_install_32
|
||||
Set $InstallDir$ = $InstallDir32$
|
||||
Set $ProgExe$ = $Prog32$
|
||||
DosInAnIcon_install winst /32bit
|
||||
Sub_check_exitcode
|
||||
comment "Copy files"
|
||||
Files_install_32 /32Bit
|
||||
@ -89,7 +94,9 @@ else
|
||||
ChangeDirectory "%SCRIPTPATH%"
|
||||
Winbatch_install_64
|
||||
Sub_check_exitcode
|
||||
DosInAnIcon_install_64
|
||||
Set $InstallDir$ = $InstallDir64$
|
||||
Set $ProgExe$ = $Prog64$
|
||||
DosInAnIcon_install winst /64bit
|
||||
Sub_check_exitcode
|
||||
comment "Copy files"
|
||||
Files_install_64 /64Bit
|
||||
@ -101,24 +108,34 @@ else
|
||||
|
||||
endif
|
||||
|
||||
[Winbatch_install_32]
|
||||
msiexec /i "$Install32Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
|
||||
|
||||
[DosInAnIcon_install_32]
|
||||
[DosInAnIcon_install]
|
||||
@echo off
|
||||
|
||||
If exist "%System%\defaultassociations.xml" (copy "%System%\defaultassociations.xml" "$LogDir$") ELSE (copy "%ScriptPath%\defaultassociations.xml" "$LogDir$")
|
||||
|
||||
SET Prog=$ProgExe$
|
||||
SET Prog=%Prog:~0,-4%
|
||||
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
|
||||
)
|
||||
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 "$InstallDir$\7z.dll,%%B" /F
|
||||
REG ADD %SC%\7-Zip.%%A\shell\open\command /VE /D "\"$InstallDir$\7zFM.exe\" \"%%1\"" /F
|
||||
copy "$LogDir$\defaultassociations.xml" "$LogDir$\defaultassociations.xml.old"
|
||||
xml ed -d /DefaultAssociations/Association[@Identifier='.%%A'] "$LogDir$\defaultassociations.xml.old"> "$LogDir$\defaultassociations.xml"
|
||||
copy "$LogDir$\defaultassociations.xml" "$LogDir$\defaultassociations.xml.old"
|
||||
xml ed -s /DefaultAssociations -t elem -n Association_new -v "" -i /DefaultAssociations/Association_new -t attr -n Identifier -v .%%A -i /DefaultAssociations/Association_new -t attr -n ProgId -v 7-Zip.%%A -i /DefaultAssociations/Association_new -t attr -n ApplicationName -v "7-Zip file archiver" -r "/DefaultAssociations/Association_new" -v Association "$LogDir$\defaultassociations.xml.old"> "$LogDir$\defaultassociations.xml"
|
||||
)
|
||||
)
|
||||
|
||||
rem Set Default Associations for Windows 8
|
||||
move "$LogDir$\defaultassociations.xml" "%System%"
|
||||
REG ADD HKLM\Software\Policies\Microsoft\Windows\System /V DefaultAssociationsConfiguration /D "%System%\defaultassociations.xml" /F
|
||||
|
||||
[Winbatch_install_32]
|
||||
msiexec /i "$Install32Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
|
||||
|
||||
[Files_install_32]
|
||||
; copy the ini file to the InstallDir
|
||||
@ -131,21 +148,6 @@ copy "$IniCfgFile$" "$InstallDir32$"
|
||||
[Winbatch_install_64]
|
||||
msiexec /i "$Install64Msi$" /l* "$LogDir$\$ProductId$.install_log.txt" /qb! ALLUSERS=1 REBOOT=ReallySuppress
|
||||
|
||||
[DosInAnIcon_install_64]
|
||||
@echo off
|
||||
|
||||
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 "$InstallDir64$\7z.dll,%%B" /F
|
||||
REG ADD %SC%\7-Zip.%%A\shell\open\command /VE /D "\"$InstallDir64$\7zFM.exe\" \"%%1\"" /F
|
||||
)
|
||||
)
|
||||
|
||||
[Files_install_64]
|
||||
; copy the ini file to the InstallDir
|
||||
copy "$IniCfgFile$" "$InstallDir64$"
|
||||
|
@ -39,3 +39,11 @@ OPSI_INI_SECTION[1]="X86_64"
|
||||
OPSI_INI_OPTION[1]="MsiId64"
|
||||
OPSI_INI_VALUE[1]="{23170F69-40C1-2702-0930-000001000000}"
|
||||
|
||||
|
||||
OPSI_INI_SECTION[2]="X86"
|
||||
OPSI_INI_OPTION[2]="Prog32"
|
||||
OPSI_INI_VALUE[2]="7zFM.exe"
|
||||
|
||||
OPSI_INI_SECTION[3]="X86_64"
|
||||
OPSI_INI_OPTION[3]="Prog64"
|
||||
OPSI_INI_VALUE[3]="7zFM.exe"
|
||||
|
Loading…
Reference in New Issue
Block a user