Difference between revisions of "7-Zip"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m (Reverted edits by KevinMurphy (talk) to last revision by 194.167.115.194)
m (7-Zip 19.00 MSI installer (32-bit and 64-bit versions))
 
(25 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 
A free file compressor/extractor: [http://www.7-zip.org/ www.7-zip.org]
 
A free file compressor/extractor: [http://www.7-zip.org/ www.7-zip.org]
  
 +
== 7-Zip 19.00 MSI installer (32-bit and 64-bit versions) ==
  
== MSI installer package.xml ==
+
<source lang="xml">
 +
<package
 +
    id='7zip'
 +
    name='7-Zip'
 +
    revision="%version%"
 +
    reboot="false"
 +
    priority="1">
  
=== Using GUID for Uninstall===
+
    <variable name="version" value="19.00" />
 +
    <variable name="filever" value="1900" />
  
<source lang="xml">
+
    <check type="uninstall" condition="exists" path="7-Zip %version%" architecture="x86" />
  <package id="7zip"
+
    <check type="uninstall" condition="exists" path="7-Zip %version% (x64 edition)" architecture="x64" />
        name="7-Zip"
+
        revision="920"
+
        reboot="false"
+
        priority="0">
+
  
      <check type="uninstall" condition="exists" path="7-Zip 9.20" />
+
    <install cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z%filever%.msi' architecture="x86" />
 +
    <install cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z%filever%-x64.msi' architecture="x64" />
 +
    <install cmd="%comspec% /c %SOFTWARE%\7zip\7zext.bat"><exit code="any"/></install>
  
      <install cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z920.msi' />
+
    <upgrade include="remove" />
 +
    <upgrade include="install" />
  
      <upgrade cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z920.msi' />
+
    <downgrade include="remove" />
 +
    <downgrade include="install" />
  
      <remove cmd='msiexec /qn /x{23170F69-40C1-2701-0920-000001000000}' />
+
    <remove cmd='wmic product where "name like &apos;7-Zip%%&apos;" call uninstall' />  
  
  </package>
+
</package>
 
</source>
 
</source>
 +
Almost the same with more variables:
 +
<source lang="xml">
 +
<package
 +
id='7zip'
 +
name='7-Zip'
 +
revision="%PKG_VERSION%"
 +
reboot="false"
 +
priority="0">
  
=== Using .msi for Uninstall===
+
<variable name="PKG_VERSION" value="19.00" />
 +
<variable name="FILE_VERSION" value="1900" />
 +
<variable name="PKG_SOURCE" value="%SOFTWARE%\7zip" />
 +
<variable name="PKG_NAME" value="7z%FILE_VERSION%.msi" architecture="x86" />
 +
<variable name="PKG_NAME" value="7z%FILE_VERSION%-x64.msi" architecture="x64" />
 +
<variable name="PKG_INSTALL_SWITCH" value="/qn /norestart" />
  
Alternatively to the use of the GUID you might use the MSI file for uninstall as well. This method has the advantage that since a new GUID string is used for each release, you need to search for the right ID at each release; using the MSI file obsoletes this step. However, with this approach you need to remember to leave older version(s) of the installer on your server.
+
<check type="uninstall" condition="exists" path="7-Zip %PKG_VERSION%" architecture="x86" />
 +
<check type="uninstall" condition="exists" path="7-Zip %PKG_VERSION% (x64 edition)" architecture="x64" />
 +
 +
<install cmd='msiexec /i "%PKG_SOURCE%\%PKG_NAME%" %PKG_INSTALL_SWITCH%' />
 +
<install cmd='%COMSPEC% /C regedit /s "%PKG_SOURCE%\7zext.reg"' />
 +
 +
<upgrade include="remove" />
 +
<upgrade include="install" />
  
<source lang="xml">
+
<downgrade include="remove" />
  <package id='7zip'
+
<downgrade include="install" />
        name='7-Zip'
+
        revision='465'
+
        priority='50'
+
        reboot='false' >
+
  
    <check type='uninstall' condition='exists' path='7-Zip 4.65' />
+
<remove cmd='wmic product where "name like &apos;7-Zip%%&apos;" call uninstall' />
 +
 +
</package>
 +
</source>
  
    <install cmd='msiexec /i "%SOFTWARE%\7zip\7z465.msi" /qn' />
+
== 7-Zip 9.38 (alpha) MSI installer (32-bit and 64-bit versions) ==
  
    <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z465.msi" /qn' />
+
Download the installers from: [http://sourceforge.net/p/sevenzip/discussion/45797/thread/49e6a4d4/ 7Zip Official Forum @ Sourceforge]
  
    <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z465.msi" /qn' />
+
<source lang="xml">
 +
<!-- 7-Zip -->
 +
<package id="7zip" name="7-Zip Packer" revision="7" reboot="false" priority="5900" >
 +
<check type='logical' condition='or'>
 +
<check type='uninstall' condition='exists' path='7-Zip 9.38' />
 +
<check type='uninstall' condition='exists' path='7-Zip 9.38 (x64 edition)' />
 +
</check>
 +
  <!-- If you do a .msi based install without first uninstalling the .exe
 +
version it will leave some files from the .exe based install intact
 +
as well as an entry in "Add/Remove Programs". -->
 +
<install cmd='%COMSPEC% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
 +
<install cmd='msiexec /i "%SOFTWARE%\7zip\7z938.msi" /qn' architecture='x86' />
 +
<install cmd='msiexec /i "%SOFTWARE%\7zip\7z938-x64.msi" /qn' architecture='x64' />
 +
<install cmd="regedit /s %SOFTWARE%\7zip\7zip.reg"/>
 +
 +
<upgrade cmd='%COMSPEC% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
 +
<upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z938.msi" /qn' architecture='x86' />
 +
<upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z938-x64.msi" /qn' architecture='x64' />
 +
<upgrade cmd="regedit /s %SOFTWARE%\7zip\7zip.reg"/>
  
  </package>
+
<remove cmd='msiexec /x "%SOFTWARE%\7zip\7z938.msi" /qn' architecture='x86' />
 +
<remove cmd='msiexec /x "%SOFTWARE%\7zip\7z938-x64.msi" /qn' architecture='x64' />
 +
</package>
 
</source>
 
</source>
  
== MSI installer package.xml for use with existing older exe based installs==
+
== 7-Zip 9.20 MSI installer (32-bit and 64-bit versions) ==
'''Background''' The hosts on my network are a mix of 7-Zip (various versions) .exe and .msi based installs. If you do a .msi based install without first uninstalling the .exe version it will leave some files from the .exe based install intact as well as an entry in "Add/Remove Programs".
+
 
+
Use this if you have existing .exe based installs of 7-Zip (such as 4.20) and you would like to uninstall them before switching to an .msi based install.
+
  
 
<source lang="xml">
 
<source lang="xml">
   <package id="7zip"
+
   <package id='7zip' name='7-Zip' revision='920' priority='0' reboot='false'>
        name="7-Zip"
+
        revision="465"
+
        reboot="false"
+
        priority="0">
+
  
    <check type="uninstall" condition="exists" path="7-Zip 4.65" />
+
  <check type='logical' condition='or'>
  
    <install cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
+
  <check type='uninstall' condition='exists' path='7-Zip 9.20' />
    <install cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z465.msi' />
+
  
    <upgrade cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />  
+
  <check type='uninstall' condition='exists' path='7-Zip 9.20 (x64 edition)' />
    <upgrade cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z465.msi' />
+
  </check>
  
    <remove  cmd='msiexec /qn /norestart /x %SOFTWARE%\7zip\7z465.msi' />
+
  <!-- If you do a .msi based install without first uninstalling the .exe
  </package>
+
        version it will leave some files from the .exe based install intact
</source>
+
        as well as an entry in "Add/Remove Programs". -->
  
== MSI installer for use with existing older exe based installs with mixed 32-bit/64-bit hosts==
+
  <install cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
  
On a 64-bit host, the 64-bit version is more useful, because the 32-bit version of 7-Zip doesn't integrate in the Windows Explorer.
+
  <install cmd='msiexec /i "%SOFTWARE%\7zip\7z920.msi" /qn' architecture='x86' />
  
'''Warning''': The approach demonstrated below which checks the value of "PROCESSOR_ARCHITECTURE" in the registry is flawed for several reasons:
+
  <install cmd='msiexec /i "%SOFTWARE%\7zip\7z920-x64.msi" /qn' architecture='x64' />
* When you remove the package, 7zip-x64 will never be detected as being successfully removed on 32bit systems (and vice versa), because the check on "PROCESSOR_ARCHITECTURE" will always return true.
+
* When you upgrade the package and increase the revision number, WPKG will detect this and try to execute the upgrade commands even if the check statements return true! However on a 32bit host the upgrade commands of 7zip-x64 will of course always fail, as will the upgrade commands of 7zip on a 64bit host.
+
* "''So please remember that checks are NOT there to check if a package applies to the system if the checks are true. Checks are there to verify that a package is installed properly and WPKG will run the commands over and over again until checks become true. In case of your checks they will never become true since the package will for sure not change the PROCESSOR_ARCHITECTURE or CurrentVersion value.''" (WPKG author Rainer Meier - [http://lists.wpkg.org/pipermail/wpkg-users/2010-January/006210.html wpkg-users])
+
  
A better approach is to either
+
  <install cmd='"%SOFTWARE%\7zip\7zext.bat">nul'><exit code="any"/></install>
A) put both packages "7zip" and "7zip-x64" in your package database without the checks on PROCESSOR_ARCHITECTURE and assign "7zip" only to 32bit hosts and "7zip-x64" only to 64bit hosts, or
+
B) create only one package that contains both the 32bit and 64bit installers of 7-Zip, and write a custom installer script that checks the operating system and installs the correct version of 7-Zip.
+
  
<source lang="xml">
+
  <upgrade cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
<?xml version="1.0" encoding="UTF-8"?>
+
  
<packages>
+
  <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z920.msi" /qn' architecture='x86' />
  
<package
+
  <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z920-x64.msi" /qn' architecture='x64' />
    id='7zip'
+
    name='7-Zip Packer'
+
    revision='465'
+
    priority='50'
+
    reboot='false'
+
    >
+
    <check type="logical" condition="or">
+
        <check
+
            type="registry"
+
            condition="equals"
+
            path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
+
            value="AMD64"
+
            />
+
    <check
+
        type='uninstall'
+
        condition='exists'
+
        path='7-Zip 4.65'
+
        />
+
    </check>
+
  
    <!-- First Uninstall the .exe -->
+
  <upgrade cmd='"%SOFTWARE%\7zip\7zext.bat">nul'><exit code="any"/></upgrade>
    <install cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
+
    <install cmd='msiexec /i "%SOFTWARE%\7zip\7z465.msi" /qn /norestart' />
+
  
    <!-- If you do a .msi based install without first uninstalling the .exe
+
  <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z920.msi" /qn' architecture='x86' />
        version it will leave some files from the .exe based install intact
+
        as well as an entry in "Add/Remove Programs". -->
+
    <upgrade cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
+
    <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z465.msi" /qn /norestart' />
+
  
</package>
+
  <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z920-x64.msi" /qn' architecture='x64' />
 +
</package>
 +
</source>
  
<package
 
    id='7zip-64'
 
    name='7-Zip 4.65 (x64 edition)'
 
    revision='465'
 
    priority='50'
 
    reboot='false'
 
    >
 
    <check type="logical" condition="or">
 
        <check
 
            type="registry"
 
            condition="equals"
 
            path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
 
            value="x86"
 
            />
 
        <check
 
            type='uninstall'
 
            condition='exists'
 
            path='7-Zip 4.65 (x64 edition)'
 
            />
 
    </check>
 
  
    <!-- First Uninstall the .exe -->
+
== File Associations ==
    <install cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
+
    <install cmd='msiexec /i "%SOFTWARE%\7zip\7z465-x64.msi" /qn /norestart' />
+
  
    <!-- If you do a .msi based install without first uninstalling the .exe
+
=== Via VBScript ===
        version it will leave some files from the .exe based install intact
+
        as well as an entry in "Add/Remove Programs". -->
+
    <upgrade cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
+
    <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z465-x64.msi" /qn /norestart' />
+
  
</package>
+
This simple script requires two parameters:
 +
  <script_name>.vbs ASSIGN|REMOVE <path_to_list_of_extensions>
  
  
</packages>
+
Running it ASSIGNs or REMOVEs file extension handlers from registry. The extensions must be listed in <path_to_list_of_extensions> file, ie. "filetypes-definitions.txt":
 +
 
 +
<source lang="dos">
 +
001
 +
7z
 +
arj
 +
bz2
 +
bzip2
 +
cab
 +
cpio
 +
deb
 +
dmg
 +
gz
 +
fat
 +
gz
 +
gzip
 +
hfs
 +
iso
 +
lha
 +
lzh
 +
lzma
 +
ntfs
 +
rar
 +
rpm
 +
split
 +
squashfs
 +
swm
 +
tar
 +
taz
 +
tbz
 +
tbz2
 +
tgz
 +
tpz
 +
txz
 +
vhd
 +
wim
 +
xar
 +
xz
 +
#z # let the Windows handle zip files
 +
#zip # let the Windows handle zip files
 
</source>
 
</source>
  
== EXE installer package.xml ==
+
Best way to use script with WPKG would be to:
 +
 
 +
* run it as ASSIGN with server-based list on install
 +
* copy server-based list to local installation folder
 +
* on uninstall, run it as REMOVE with local list
 +
 
 +
That way, on uninstall we remove only the originally assigned extensions:
  
 
<source lang="xml">
 
<source lang="xml">
  <package id="7zip"
+
<!-- Register file handlers from server list -->
        name="7-Zip"
+
<install cmd='%CMD_CSCRIPT% "%PKG_SOURCE%\filetypes-register.vbs" ASSIGN "%PKG_SOURCE%\filetypes-definitions.txt"' />
        revision="464"
+
        reboot="false"    
+
<!-- Copy date-of-install definitions into local disk, we'll use it at reinstallation -->
        priority="0">
+
<install cmd='%CMD_COPY% "%PKG_SOURCE%\filetypes-definitions.txt" "%PKG_DESTINATION%"' />
  
    <check type="file" condition="exists" path="%PROGRAMFILES%\7-Zip\7zFM.exe" />
+
<!-- Try to unregister file handlers from local list -->
 +
<remove cmd='%CMD_CSCRIPT% "%PKG_SOURCE%\filetypes-register.vbs" REMOVE "%PKG_DESTINATION%\filetypes-definitions.txt"'>
 +
<exit code="any"/>
 +
</remove>
 +
</source>
  
    <install cmd='%SOFTWARE%\7zip\7z464.exe /S'>
+
The script code, '''please note''' that it uses standard Windows zip icon for files (standardizes user experience):
    <exit code="0" />
+
    </install>
+
  
    <remove cmd='"%PROGRAMFILES%\7-Zip\Uninstall.exe" /S'>
+
<source lang="vb">
        <exit code="0"/>
+
' Common system objects, comment unused
    </remove>
+
'Set objNetwork = CreateObject("WScript.Network")
 +
'Set objShellAp = CreateObject("Shell.Application")
 +
Set objWShell = CreateObject("WScript.Shell")
 +
'Set objConnection = CreateObject("ADODB.Connection")
 +
'Set objCommand = CreateObject("ADODB.Command")
 +
'Set objSysInfo = CreateObject("ADSystemInfo")
 +
'Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
 +
Set objFSO = CreateObject("Scripting.FileSystemObject")
 +
'Set colOS = objWMIService.ExecQuery( "Select * from Win32_OperatingSystem" )
 +
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
  
  </package>
+
' Registry defaults
</source>
+
Const HKEY_LOCAL_MACHINE = &H80000002
 +
strBaseRegKey = "Software\Classes\"
 +
strKeyDefault = ""
  
== MSI Installer package.xml, sets 7-zip as default archive application ==
+
' Program files path
 +
strProgramFiles = objWShell.ExpandEnvironmentStrings( "%ProgramFiles%" )
  
In meantime, while 7-zip author considers installer switches for file associations, you can use registry files to do it yourself.
+
' Require and verify arguments, if arguments incorrect or missing - quit
 +
If WScript.Arguments.Count >= 2 Then
  
<source lang="xml">
+
Select Case WScript.Arguments.Item( 0 )
<packages>
+
  <package id="7zip"  
+
Case "REMOVE"
        name="7-Zip"
+
boolDelete = True
        revision="465"  
+
Case "ASSIGN"
        priority="0"
+
boolDelete = False
        reboot="false">
+
Case Else
    <check type="uninstall" condition="exists" path="7-Zip 4.65"/>
+
 +
WScript.Quit( 2 )
 +
 +
End Select
 +
 +
strFileTypes = WScript.Arguments.Item( 1 )
 +
 +
Else
 +
WScript.Quit( 2 )
 +
End If
  
    <install cmd="msiexec /qn /norestart /i %SOFTWARE%\7zip\7z465.msi"/>
+
' If types definition file does not exist, quit
    <install cmd="regedit /s %SETTINGS%\7zip.reg"/>
+
If Not objFSO.FileExists( strFileTypes ) Then WScript.Quit( 1 )
  
    <upgrade cmd="msiexec /qn /norestart /i %SOFTWARE%\7zip\7z465.msi"/>
+
' Open text file and proceed with each line
    <upgrade cmd="regedit /s %SETTINGS%\7zip.reg"/>
+
Set objFileTypes = objFSO.OpenTextFile( strFileTypes, 1 )
  
    <remove cmd="msiexec /qn /x{23170F69-40C1-2701-0465-000001000000}"/>
+
Do While objFileTypes.AtEndOfStream <> True
  </package>
+
</packages>
+
</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
+
' Get a line, trimmed from all whitespace and comments ("#*")
 +
    strFileType = TrimEx( objFileTypes.ReadLine )
 +
 +
' If line not empty or commented
 +
If strFileType <> "" Then
 +
 +
' Check what we want to do
 +
If Not boolDelete Then
 +
 +
' Create all necessary keys
 +
 +
objReg.CreateKey HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType
 +
 +
objReg.SetStringValue HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType, strKeyDefault, "7-Zip" & "." & strFileType
 +
objReg.SetStringValue HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType, "PerceivedType", "compressed"
 +
objReg.SetStringValue HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType, "Content Type", "application/x-" & strFileType & "-compressed"
 +
 +
objReg.CreateKey HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType
 +
objReg.SetStringValue HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType, strKeyDefault, UCase( strFileType ) & " archive"
 +
 +
objReg.CreateKey HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\DefaultIcon"
 +
objReg.SetStringValue HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\DefaultIcon", strKeyDefault, "%SystemRoot%\system32\zipfldr.dll"
 +
 +
objReg.CreateKey HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\shell\open\command"
 +
objReg.SetStringValue HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\shell\open\command", strKeyDefault, """" & strProgramFiles & "\7-Zip\7zFM.exe"" ""%1"""
 +
 +
Else
 +
 +
' Delete all necessary keys recursively
 +
 +
DeleteKeyRecursive HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType
 +
DeleteKeyRecursive HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType
 +
 +
End If
 +
 +
End If
 +
 +
Loop
  
Shortly explained what the script is doing:
+
WScript.Quit( 0 )
  
* This batch grabs the extension from the with space delimited extension list (EXTN=001-9 ... zip-1)
+
Sub DeleteKeyRecursive( objHive, strBaseRegKey )
* <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.
+
objReg.EnumKey objHive, strBaseRegKey, arrSubKeys
 +
 
 +
If IsArray( arrSubKeys ) Then
 +
For Each strSubKey In arrSubKeys
 +
DeleteKeyRecursive objHive, strBaseRegKey & "\" & strSubKey
 +
Next
 +
End If
 +
 +
objReg.DeleteKey objHive, strBaseRegKey
 +
 
 +
End Sub
 +
 
 +
Function TrimEx( strText )
 +
 +
Set objRE = New RegExp
 +
objRE.Multiline = False
 +
objRE.Global = True
 +
 +
' Trim whitespaces
 +
objRE.Pattern = "\s*"
 +
strText = objRE.Replace( strText, "" )
 +
 +
' Trim all comments (if comment char is first in the line, it will return empty string)
 +
objRE.Pattern = "#.*$"
 +
strText = objRE.Replace( strText, "" )
 +
 +
TrimEx = strText
 +
 +
End Function
 +
</source>
  
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)%)
+
=== Via Batch file ===
  
 
<source lang="dos">
 
<source lang="dos">
 +
REM This is 7zext.bat
 
@echo off
 
@echo off
  
 
SET SC=HKLM\Software\Classes
 
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-1
 
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-1
 +
REM Version 9.20 checked from registry and altered. 1 differences: now cpio-12, removal split-9, addition: gz-14
 +
SET Extn=001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-12 deb-11 dmg-17 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 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 %%j IN (%Extn%) DO (
Line 230: Line 350:
 
</source>
 
</source>
  
Alternative the .reg file:
+
What the script is doing:
  
 +
* This batch grabs the extension from the 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.
 +
 +
=== Via REGEDIT (.reg file) ===
 +
 +
<source lang="xml">
 +
<install cmd="regedit /s %SETTINGS%\7zip.reg"/>
 +
</source>
 +
 +
The .reg file:
 
<source lang="reg">
 
<source lang="reg">
 
Windows Registry Editor Version 5.00
 
Windows Registry Editor Version 5.00
  
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.001]
 +
@="7-Zip.001"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.7z]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.7z]
 
@="7-Zip.7z"
 
@="7-Zip.7z"
Line 251: Line 384:
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.dmg]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.dmg]
 
@="7-Zip.dmg"
 
@="7-Zip.dmg"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.fat]
 +
@="7-Zip.fat"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.gz]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.gz]
 
@="7-Zip.gz"
 
@="7-Zip.gz"
Line 265: Line 400:
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lzma]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lzma]
 
@="7-Zip.lzma"
 
@="7-Zip.lzma"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.ntfs]
 +
@="7-Zip.ntfs"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.rar]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.rar]
 
@="7-Zip.rar"
 
@="7-Zip.rar"
Line 271: Line 408:
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.split]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.split]
 
@="7-Zip.split"
 
@="7-Zip.split"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.squashfs]
 +
@="7-Zip.squashfs"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.swm]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.swm]
 
@="7-Zip.swm"
 
@="7-Zip.swm"
Line 285: Line 424:
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tpz]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tpz]
 
@="7-Zip.tpz"
 
@="7-Zip.tpz"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.txz]
 +
@="7-Zip.txz"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.vhd]
 +
@="7-Zip.vhd"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.wim]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.wim]
 
@="7-Zip.wim"
 
@="7-Zip.wim"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xar]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xar]
 
@="7-Zip.xar"
 
@="7-Zip.xar"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xz]
 +
@="7-Zip.xz"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.z]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.z]
 
@="7-Zip.z"
 
@="7-Zip.z"
Line 294: Line 439:
 
@="7-Zip.zip"
 
@="7-Zip.zip"
  
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.001]
 +
@="001 Archive"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.001\DefaultIcon]
 +
@="C:\\Program Files\\7-Zip\\7z.dll,9"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.001\shell\open\command]
 +
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.7z]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.7z]
 
@="7z Archive"
 
@="7z Archive"
Line 341: Line 492:
 
@="C:\\Program Files\\7-Zip\\7z.dll,17"
 
@="C:\\Program Files\\7-Zip\\7z.dll,17"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.dmg\shell\open\command]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.dmg\shell\open\command]
 +
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.fat]
 +
@="fat Archive"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.fat\DefaultIcon]
 +
@="C:\\Program Files\\7-Zip\\7z.dll,21"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.fat\shell\open\command]
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gz]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gz]
Line 383: Line 540:
 
@="C:\\Program Files\\7-Zip\\7z.dll,16"
 
@="C:\\Program Files\\7-Zip\\7z.dll,16"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzma\shell\open\command]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzma\shell\open\command]
 +
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.ntfs]
 +
@="ntfs Archive"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.ntfs\DefaultIcon]
 +
@="C:\\Program Files\\7-Zip\\7z.dll,22"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.ntfs\shell\open\command]
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rar]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rar]
Line 401: Line 564:
 
@="C:\\Program Files\\7-Zip\\7z.dll,9"
 
@="C:\\Program Files\\7-Zip\\7z.dll,9"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.split\shell\open\command]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.split\shell\open\command]
 +
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.squashfs]
 +
@="squashfs Archive"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.squashfs\DefaultIcon]
 +
@="C:\\Program Files\\7-Zip\\7z.dll,24"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.squashfs\shell\open\command]
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.swm]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.swm]
Line 443: Line 612:
 
@="C:\\Program Files\\7-Zip\\7z.dll,14"
 
@="C:\\Program Files\\7-Zip\\7z.dll,14"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tpz\shell\open\command]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tpz\shell\open\command]
 +
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.txz]
 +
@="txz Archive"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.txz\DefaultIcon]
 +
@="C:\\Program Files\\7-Zip\\7z.dll,23"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.txz\shell\open\command]
 +
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.vhd]
 +
@="vhd Archive"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.vhd\DefaultIcon]
 +
@="C:\\Program Files\\7-Zip\\7z.dll,20"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.vhd\shell\open\command]
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.wim]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.wim]
Line 455: Line 636:
 
@="C:\\Program Files\\7-Zip\\7z.dll,19"
 
@="C:\\Program Files\\7-Zip\\7z.dll,19"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xar\shell\open\command]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xar\shell\open\command]
 +
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xz]
 +
@="xz Archive"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xz\DefaultIcon]
 +
@="C:\\Program Files\\7-Zip\\7z.dll,23"
 +
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xz\shell\open\command]
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.z]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.z]
Line 470: Line 657:
 
</source>
 
</source>
  
== MSI installer package.xml for 7-zip x64 ==
 
 
For the 64 bit version of 7-Zip you just have to change the check-flag. This is the method, which sets 7-Zip as default application for archives.
 
 
<source lang="xml">
 
<package id="7zip-x64"
 
        name="7-Zip x64"
 
        revision="465"
 
        reboot="false"
 
        priority="0">
 
      <check type="uninstall" condition="exists" path="7-Zip 4.65 (x64 edition)" />
 
      <install cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z465-x64.msi' />
 
          <install cmd="regedit /s %SETTINGS%\7zip.reg"/>
 
      <upgrade cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z465-x64.msi' />
 
          <upgrade cmd="regedit /s %SETTINGS%\7zip.reg"/>
 
      <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z465-x64.msi" /qn' />
 
  </package>
 
</source>
 
 
== 7-Zip EXE installer options ==
 
 
"Use the "/S" parameter to do a silent installation and the "/D=dir" parameter to specify the "output directory". These options are case-sensitive. 7-Zip uses the NSIS installer by Nullsoft." - http://www.7-zip.org/faq.html
 
 
== 7-ZIP 9.10 (beta) MSI installer for 32bit and 64bit hosts ==
 
 
<source lang="xml">
 
<?xml version="1.0" encoding="utf-8" ?>
 
<packages>
 
<package
 
    id='7zip'
 
    name='7-Zip 9.10'
 
    revision='910'
 
    priority='50'
 
    reboot='false'
 
    >
 
 
    <check type="logical" condition="or">
 
        <check
 
            type="registry"
 
            condition="equals"
 
            path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
 
            value="AMD64"
 
            />
 
    <check
 
        type='uninstall'
 
        condition='exists'
 
        path='7-Zip 9.10'
 
        />
 
    </check>
 
 
    <!-- First Uninstall the .exe -->
 
    <install cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
 
    <install cmd='msiexec /i "%SOFTWARE%\7zip\7z910.msi" /qn /norestart' />
 
 
    <!-- If you do a .msi based install without first uninstalling the .exe
 
        version it will leave some files from the .exe based install intact
 
        as well as an entry in "Add/Remove Programs". -->
 
    <upgrade cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
 
    <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z910.msi" /qn /norestart' />
 
 
    <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z910.msi" /qn' />
 
</package>
 
 
<package
 
    id='7zip-64'
 
    name='7-Zip 9.10 (x64 edition)'
 
    revision='910'
 
    priority='50'
 
    reboot='false'
 
    >
 
    <check type="logical" condition="or">
 
        <check
 
            type="registry"
 
            condition="equals"
 
            path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
 
            value="x86"
 
            />
 
        <check
 
            type='uninstall'
 
            condition='exists'
 
            path='7-Zip 9.10 (x64 edition)'
 
            />
 
    </check>
 
 
    <!-- First Uninstall the .exe -->
 
    <install cmd='%comspec% /c if exist "%PROGRAMFILES(x86)%\7-Zip\Uninstall.exe" "%PROGRAMFILES%(x86)\7-Zip\Uninstall.exe" /S' />
 
    <install cmd='msiexec /i "%SOFTWARE%\7zip\7z910-x64.msi" /qn /norestart' />
 
 
    <!-- If you do a .msi based install without first uninstalling the .exe
 
        version it will leave some files from the .exe based install intact
 
        as well as an entry in "Add/Remove Programs". -->
 
    <upgrade cmd='%comspec% /c if exist "%PROGRAMFILES(x86)%\7-Zip\Uninstall.exe" "%PROGRAMFILES%(x86)\7-Zip\Uninstall.exe" /S' />
 
    <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z910-x64.msi" /qn /norestart' />
 
 
    <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z910-x64.msi" /qn' />
 
</package>
 
 
</packages>
 
</source>
 
  
 
== Links ==
 
== Links ==
Line 578: Line 666:
  
 
[[category:Silent Installers]]
 
[[category:Silent Installers]]
[[Category:NSIS]]
 

Latest revision as of 19:50, 10 May 2020

A free file compressor/extractor: www.7-zip.org

7-Zip 19.00 MSI installer (32-bit and 64-bit versions)

<package 
    id='7zip' 
    name='7-Zip' 
    revision="%version%"
    reboot="false"
    priority="1">

    <variable name="version" value="19.00" />
    <variable name="filever" value="1900" />

    <check type="uninstall" condition="exists" path="7-Zip %version%" architecture="x86" />
    <check type="uninstall" condition="exists" path="7-Zip %version% (x64 edition)" architecture="x64" />

    <install cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z%filever%.msi' architecture="x86" />
    <install cmd='msiexec /qn /norestart /i %SOFTWARE%\7zip\7z%filever%-x64.msi' architecture="x64" />
    <install cmd="%comspec% /c %SOFTWARE%\7zip\7zext.bat"><exit code="any"/></install>

    <upgrade include="remove" />
    <upgrade include="install" />

    <downgrade include="remove" />
    <downgrade include="install" />

    <remove cmd='wmic product where "name like &apos;7-Zip%%&apos;" call uninstall' /> 

</package>

Almost the same with more variables:

<package 
	id='7zip' 
	name='7-Zip' 
	revision="%PKG_VERSION%"
	reboot="false"
	priority="0">

	<variable name="PKG_VERSION"		value="19.00" />
	<variable name="FILE_VERSION"		value="1900" />
	<variable name="PKG_SOURCE"		value="%SOFTWARE%\7zip" />
	<variable name="PKG_NAME"		value="7z%FILE_VERSION%.msi" architecture="x86" />
	<variable name="PKG_NAME"		value="7z%FILE_VERSION%-x64.msi" architecture="x64" />
	<variable name="PKG_INSTALL_SWITCH"	value="/qn /norestart" />

	<check type="uninstall" condition="exists" path="7-Zip %PKG_VERSION%" architecture="x86" />
	<check type="uninstall" condition="exists" path="7-Zip %PKG_VERSION% (x64 edition)" architecture="x64" />
 
	<install cmd='msiexec /i "%PKG_SOURCE%\%PKG_NAME%" %PKG_INSTALL_SWITCH%' />
 	<install cmd='%COMSPEC% /C regedit /s "%PKG_SOURCE%\7zext.reg"' /> 
	
	<upgrade include="remove" />
	<upgrade include="install" />

	<downgrade include="remove" />
	<downgrade include="install" />

	<remove cmd='wmic product where "name like &apos;7-Zip%%&apos;" call uninstall' /> 
 
</package>

7-Zip 9.38 (alpha) MSI installer (32-bit and 64-bit versions)

Download the installers from: 7Zip Official Forum @ Sourceforge

<!-- 7-Zip -->
<package id="7zip" name="7-Zip Packer" revision="7" reboot="false" priority="5900" >
	<check type='logical' condition='or'>
	<check type='uninstall' condition='exists' path='7-Zip 9.38' />
	<check type='uninstall' condition='exists' path='7-Zip 9.38 (x64 edition)' />
	</check>
	   <!-- If you do a .msi based install without first uninstalling the .exe
		version it will leave some files from the .exe based install intact
		as well as an entry in "Add/Remove Programs". -->
	<install cmd='%COMSPEC% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' /> 
	<install cmd='msiexec /i "%SOFTWARE%\7zip\7z938.msi" /qn' architecture='x86' />
	<install cmd='msiexec /i "%SOFTWARE%\7zip\7z938-x64.msi" /qn' architecture='x64' />
	<install cmd="regedit /s %SOFTWARE%\7zip\7zip.reg"/>
		
	<upgrade cmd='%COMSPEC% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />
	<upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z938.msi" /qn' architecture='x86' />
	<upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z938-x64.msi" /qn' architecture='x64' />
	<upgrade cmd="regedit /s %SOFTWARE%\7zip\7zip.reg"/>

	<remove cmd='msiexec /x "%SOFTWARE%\7zip\7z938.msi" /qn' architecture='x86' />
	<remove cmd='msiexec /x "%SOFTWARE%\7zip\7z938-x64.msi" /qn' architecture='x64' />
</package>

7-Zip 9.20 MSI installer (32-bit and 64-bit versions)

  <package id='7zip' name='7-Zip' revision='920' priority='0' reboot='false'>

  <check type='logical' condition='or'>

   <check type='uninstall' condition='exists' path='7-Zip 9.20' />

   <check type='uninstall' condition='exists' path='7-Zip 9.20 (x64 edition)' />
  </check>

   <!-- If you do a .msi based install without first uninstalling the .exe
        version it will leave some files from the .exe based install intact
        as well as an entry in "Add/Remove Programs". -->

   <install cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' /> 

   <install cmd='msiexec /i "%SOFTWARE%\7zip\7z920.msi" /qn' architecture='x86' />

   <install cmd='msiexec /i "%SOFTWARE%\7zip\7z920-x64.msi" /qn' architecture='x64' />

   <install cmd='"%SOFTWARE%\7zip\7zext.bat">nul'><exit code="any"/></install>

   <upgrade cmd='%comspec% /c if exist "%PROGRAMFILES%\7-Zip\Uninstall.exe" "%PROGRAMFILES%\7-Zip\Uninstall.exe" /S' />

   <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z920.msi" /qn' architecture='x86' />

   <upgrade cmd='msiexec /i "%SOFTWARE%\7zip\7z920-x64.msi" /qn' architecture='x64' />

   <upgrade cmd='"%SOFTWARE%\7zip\7zext.bat">nul'><exit code="any"/></upgrade>

   <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z920.msi" /qn' architecture='x86' />

   <remove cmd='msiexec /x "%SOFTWARE%\7zip\7z920-x64.msi" /qn' architecture='x64' />
 </package>


File Associations

Via VBScript

This simple script requires two parameters:

 <script_name>.vbs ASSIGN|REMOVE <path_to_list_of_extensions>


Running it ASSIGNs or REMOVEs file extension handlers from registry. The extensions must be listed in <path_to_list_of_extensions> file, ie. "filetypes-definitions.txt":

001
7z
arj
bz2
bzip2
cab
cpio
deb
dmg
gz
fat
gz
gzip
hfs
iso
lha
lzh
lzma
ntfs
rar
rpm
split
squashfs
swm
tar
taz
tbz
tbz2
tgz
tpz
txz
vhd
wim
xar
xz
#z		# let the Windows handle zip files
#zip	# let the Windows handle zip files

Best way to use script with WPKG would be to:

* run it as ASSIGN with server-based list on install
* copy server-based list to local installation folder
* on uninstall, run it as REMOVE with local list

That way, on uninstall we remove only the originally assigned extensions:

<!-- Register file handlers from server list -->
<install cmd='%CMD_CSCRIPT% "%PKG_SOURCE%\filetypes-register.vbs" ASSIGN "%PKG_SOURCE%\filetypes-definitions.txt"' />
		
<!-- Copy date-of-install definitions into local disk, we'll use it at reinstallation -->
<install cmd='%CMD_COPY% "%PKG_SOURCE%\filetypes-definitions.txt" "%PKG_DESTINATION%"' />

<!-- Try to unregister file handlers from local list -->
<remove cmd='%CMD_CSCRIPT% "%PKG_SOURCE%\filetypes-register.vbs" REMOVE "%PKG_DESTINATION%\filetypes-definitions.txt"'>
	<exit code="any"/>
</remove>

The script code, please note that it uses standard Windows zip icon for files (standardizes user experience):

' Common system objects, comment unused
'Set objNetwork		= CreateObject("WScript.Network")
'Set objShellAp		= CreateObject("Shell.Application")
Set objWShell		= CreateObject("WScript.Shell")
'Set objConnection	= CreateObject("ADODB.Connection")
'Set objCommand		= CreateObject("ADODB.Command")
'Set objSysInfo		= CreateObject("ADSystemInfo")
'Set objWMIService	= GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set objFSO			= CreateObject("Scripting.FileSystemObject") 
'Set colOS			= objWMIService.ExecQuery( "Select * from Win32_OperatingSystem" )
Set objReg			= GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

' Registry defaults
Const HKEY_LOCAL_MACHINE = &H80000002
strBaseRegKey = "Software\Classes\"
strKeyDefault = ""

' Program files path
strProgramFiles = objWShell.ExpandEnvironmentStrings( "%ProgramFiles%" )

' Require and verify arguments, if arguments incorrect or missing - quit
If WScript.Arguments.Count >= 2 Then

	Select Case WScript.Arguments.Item( 0 )
	
		Case "REMOVE"
			boolDelete = True
		Case "ASSIGN"
			boolDelete = False
		Case Else
			
			WScript.Quit( 2 )		
			
	End Select
	
	strFileTypes = WScript.Arguments.Item( 1 )
	
Else
	WScript.Quit( 2 )
End If

' If types definition file does not exist, quit
If Not objFSO.FileExists( strFileTypes ) Then WScript.Quit( 1 )

' Open text file and proceed with each line
Set objFileTypes = objFSO.OpenTextFile( strFileTypes, 1 )

Do While objFileTypes.AtEndOfStream <> True

	' Get a line, trimmed from all whitespace and comments ("#*")
    strFileType = TrimEx( objFileTypes.ReadLine )
	
	' If line not empty or commented
	If strFileType <> "" Then
			
		' Check what we want to do
		If Not boolDelete Then
			
			' Create all necessary keys
			
			objReg.CreateKey 		HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType
			
			objReg.SetStringValue 	HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType, strKeyDefault, "7-Zip" & "." & strFileType
			objReg.SetStringValue 	HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType, "PerceivedType", "compressed"
			objReg.SetStringValue 	HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType, "Content Type", "application/x-" & strFileType & "-compressed"
			
			objReg.CreateKey 		HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType
			objReg.SetStringValue 	HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType, strKeyDefault, UCase( strFileType ) & " archive"
			
			objReg.CreateKey 		HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\DefaultIcon"
			objReg.SetStringValue 	HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\DefaultIcon", strKeyDefault, "%SystemRoot%\system32\zipfldr.dll"
			
			objReg.CreateKey 		HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\shell\open\command"
			objReg.SetStringValue 	HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType & "\shell\open\command", strKeyDefault, """" & strProgramFiles & "\7-Zip\7zFM.exe"" ""%1"""
		
		Else
			
			' Delete all necessary keys recursively
			
			DeleteKeyRecursive		HKEY_LOCAL_MACHINE, strBaseRegKey & "." & strFileType
			DeleteKeyRecursive		HKEY_LOCAL_MACHINE, strBaseRegKey & "7-Zip" & "." & strFileType
		
		End If
		
	End If
	
Loop

WScript.Quit( 0 )

Sub DeleteKeyRecursive( objHive, strBaseRegKey )

	objReg.EnumKey objHive, strBaseRegKey, arrSubKeys

	If IsArray( arrSubKeys ) Then
		For Each strSubKey In arrSubKeys
			DeleteKeyRecursive objHive, strBaseRegKey & "\" & strSubKey
		Next
	End If
	
	objReg.DeleteKey objHive, strBaseRegKey

End Sub

Function TrimEx( strText )
	
	Set objRE = New RegExp
	objRE.Multiline = False
	objRE.Global = True
	
	' Trim whitespaces
	objRE.Pattern = "\s*"
	strText = objRE.Replace( strText, "" )
	
	' Trim all comments (if comment char is first in the line, it will return empty string)
	objRE.Pattern = "#.*$"
	strText = objRE.Replace( strText, "" )
	
	TrimEx = strText
	
End Function

Via Batch file

REM This is 7zext.bat
@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-1
REM Version 9.20 checked from registry and altered. 1 differences: now cpio-12, removal split-9, addition: gz-14
SET Extn=001-9 7z-0 arj-4 bz2-2 bzip2-2 cab-7 cpio-12 deb-11 dmg-17 fat-21 gz-14 gzip-14 hfs-18 iso-8 lha-6 lzh-6 lzma-16 ntfs-22 rar-3 rpm-10 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
        )
)

What the script is doing:

* This batch grabs the extension from the 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.

Via REGEDIT (.reg file)

 <install cmd="regedit /s %SETTINGS%\7zip.reg"/>

The .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.001]
@="7-Zip.001"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.7z]
@="7-Zip.7z"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.arj]
@="7-Zip.arj"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bz2]
@="7-Zip.bz2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bzip2]
@="7-Zip.bzip2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.cab]
@="7-Zip.cab"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.cpio]
@="7-Zip.cpio"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.deb]
@="7-Zip.deb"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.dmg]
@="7-Zip.dmg"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.fat]
@="7-Zip.fat"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.gz]
@="7-Zip.gz"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.gzip]
@="7-Zip.gzip"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.hfs]
@="7-Zip.hfs"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.iso]
@="7-Zip.iso"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lha]
@="7-Zip.lha"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lzh]
@="7-Zip.lzh"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.lzma]
@="7-Zip.lzma"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.ntfs]
@="7-Zip.ntfs"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.rar]
@="7-Zip.rar"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.rpm]
@="7-Zip.rpm"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.split]
@="7-Zip.split"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.squashfs]
@="7-Zip.squashfs"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.swm]
@="7-Zip.swm"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tar]
@="7-Zip.tar"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.taz]
@="7-Zip.taz"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tbz]
@="7-Zip.tbz"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tbz2]
@="7-Zip.tbz2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tgz]
@="7-Zip.tgz"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.tpz]
@="7-Zip.tpz"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.txz]
@="7-Zip.txz"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.vhd]
@="7-Zip.vhd"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.wim]
@="7-Zip.wim"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xar]
@="7-Zip.xar"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xz]
@="7-Zip.xz"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.z]
@="7-Zip.z"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.zip]
@="7-Zip.zip"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.001]
@="001 Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.001\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,9"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.001\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.7z]
@="7z Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.7z\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.7z\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.arj]
@="arj Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.arj\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,4"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.arj\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.bz2]
@="bz2 Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.bz2\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.bz2\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.bzip2]
@="bzip2 Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.bzip2\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.bzip2\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.cab]
@="cab Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.cab\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,7"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.cab\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.cpio]
@="cpio Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.cpio\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,12"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.cpio\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.deb]
@="deb Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.deb\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,11"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.deb\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.dmg]
@="dmg Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.dmg\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,17"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.dmg\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.fat]
@="fat Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.fat\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,21"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.fat\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gz]
@="gz Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gz\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,14"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gz\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gzip]
@="gzip Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gzip\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,14"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.gzip\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.hfs]
@="hfs Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.hfs\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,18"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.hfs\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.iso]
@="iso Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.iso\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,8"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.iso\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lha]
@="lha Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lha\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,6"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lha\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzh]
@="lzh Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzh\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,6"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzh\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzma]
@="lzma Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzma\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,16"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.lzma\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.ntfs]
@="ntfs Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.ntfs\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,22"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.ntfs\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rar]
@="rar Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rar\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,3"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rar\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rpm]
@="rpm Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rpm\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,10"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.rpm\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.split]
@="split Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.split\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,9"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.split\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.squashfs]
@="squashfs Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.squashfs\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,24"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.squashfs\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.swm]
@="swm Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.swm\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,15"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.swm\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tar]
@="tar Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tar\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,13"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tar\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.taz]
@="taz Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.taz\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,5"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.taz\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tbz]
@="tbz Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tbz\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tbz\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tbz2]
@="tbz2 Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tbz2\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tbz2\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tgz]
@="tgz Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tgz\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,14"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tgz\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tpz]
@="tpz Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tpz\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,14"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.tpz\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.txz]
@="txz Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.txz\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,23"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.txz\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.vhd]
@="vhd Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.vhd\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,20"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.vhd\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.wim]
@="wim Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.wim\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,15"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.wim\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xar]
@="xar Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xar\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,19"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xar\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xz]
@="xz Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xz\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,23"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.xz\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.z]
@="z Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.z\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,5"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.z\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.zip]
@="zip Archive"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.zip\DefaultIcon]
@="C:\\Program Files\\7-Zip\\7z.dll,1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\7-Zip.zip\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""


Links