Changes

Jump to: navigation, search

7-Zip

1,029 bytes added, 11:37, 11 January 2011
MSI Installer package.xml, sets 7-zip as default archive application
</source>
You can use a batch-script (tested for Version 9.20), to add the extension. Feel free to add further extensions to 7-Zip Shortly explained what the script is doing:  * This batch grabs the extension from the with space delimited extension list (EXTN=001-9 ... zip-1) * <extension>-<standard-icon in 7z.dll> means that the first part is the name of the extension. The second part is the icon, which is stored within the 7z.dll. * This data will be used to automatically add the desired values to the registry. ATTENTION: Please install 7-Zip x86 for x86 systems only and not on x64 Systems. Otherwise you have to check prior, which programfiles folder to use. (see batch script below %PROGRAMFILES% / %PROGRAMFILES(x86)%) <source lang="dos">@echo off SET SC=HKLM\Software\ClassesSET 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 "%PROGRAMFILES%\7-Zip\7z.dll,%%B" /F REG ADD %SC%\7-Zip.%%A\shell\open\command /VE /D "\"%PROGRAMFILES%\7-Zip\7zFM.exe\" \"%%1\"" /F ))</source> Alternative the .reg file:
<source lang="reg">
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.zip\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
</source>
 
as alternative, you can use this batch-script:
<source lang="dos">
@echo off
 
SET SC=HKLM\Software\Classes
SET Extn=7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-7 deb-11 gz-14 gzip-14 iso-8 lha-6 lzh-6 rar-3 rpm-10 split-9 swm-15 tar-13 taz-5 tbz-2 tbz2-2 tgz-14 tpz-14 wim-15 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 "%PROGRAMFILES%\7-Zip\7z.dll,%%B" /F
REG ADD %SC%\7-Zip.%%A\shell\open\command /VE /D "\"%PROGRAMFILES%\7-Zip\7zFM.exe\" \"%%1\"" /F
)
)
</source>
Anonymous user

Navigation menu