Install 7-Zip (25.01) with default file associations

cris2k47

Member
Messages
47
Reaction score
31
  1. Download and prepare 7-Zip (x64):
  2. Registry tweak for 7-Zip associations:
  3. File associations XML:
    • In your Windows installation source, create this folder path:
      sources\$OEM$\$$\System32\
    • Place your file inside:
      OEMDefaultAssociations.xml
    • Final tree structure example:
      Code:
      <Your ISO root>\
      │   setup.exe
      │   ...
      └───sources
          └───$OEM$
              └───$$
                  └───System32
                      │   OEMDefaultAssociations.xml
<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
<Association Identifier=".7z" ProgId="7-Zip.7z" ApplicationName="7-Zip File Manager" />
<Association Identifier=".zip" ProgId="7-Zip.zip" ApplicationName="7-Zip File Manager" />
<Association Identifier=".rar" ProgId="7-Zip.rar" ApplicationName="7-Zip File Manager" />
<Association Identifier=".001" ProgId="7-Zip.001" ApplicationName="7-Zip File Manager" />
<Association Identifier=".cab" ProgId="7-Zip.cab" ApplicationName="7-Zip File Manager" />
<Association Identifier=".iso" ProgId="7-Zip.iso" ApplicationName="7-Zip File Manager" />
<Association Identifier=".xz" ProgId="7-Zip.xz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".txz" ProgId="7-Zip.txz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".lzma" ProgId="7-Zip.lzma" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tar" ProgId="7-Zip.tar" ApplicationName="7-Zip File Manager" />
<Association Identifier=".cpio" ProgId="7-Zip.cpio" ApplicationName="7-Zip File Manager" />
<Association Identifier=".bz2" ProgId="7-Zip.bz2" ApplicationName="7-Zip File Manager" />
<Association Identifier=".bzip2" ProgId="7-Zip.bzip2" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tbz2" ProgId="7-Zip.tbz2" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tbz" ProgId="7-Zip.tbz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".gz" ProgId="7-Zip.gz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".gzip" ProgId="7-Zip.gzip" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tgz" ProgId="7-Zip.tgz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tpz" ProgId="7-Zip.tpz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".zst" ProgId="7-Zip.zst" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tzst" ProgId="7-Zip.tzst" ApplicationName="7-Zip File Manager" />
<Association Identifier=".z" ProgId="7-Zip.z" ApplicationName="7-Zip File Manager" />
<Association Identifier=".taz" ProgId="7-Zip.taz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".lzh" ProgId="7-Zip.lzh" ApplicationName="7-Zip File Manager" />
<Association Identifier=".lha" ProgId="7-Zip.lha" ApplicationName="7-Zip File Manager" />
<Association Identifier=".rpm" ProgId="7-Zip.rpm" ApplicationName="7-Zip File Manager" />
<Association Identifier=".deb" ProgId="7-Zip.deb" ApplicationName="7-Zip File Manager" />
<Association Identifier=".arj" ProgId="7-Zip.arj" ApplicationName="7-Zip File Manager" />
<Association Identifier=".vhd" ProgId="7-Zip.vhd" ApplicationName="7-Zip File Manager" />
<Association Identifier=".vhdx" ProgId="7-Zip.vhdx" ApplicationName="7-Zip File Manager" />
<Association Identifier=".wim" ProgId="7-Zip.wim" ApplicationName="7-Zip File Manager" />
<Association Identifier=".swm" ProgId="7-Zip.swm" ApplicationName="7-Zip File Manager" />
<Association Identifier=".esd" ProgId="7-Zip.esd" ApplicationName="7-Zip File Manager" />
<Association Identifier=".fat" ProgId="7-Zip.fat" ApplicationName="7-Zip File Manager" />
<Association Identifier=".ntfs" ProgId="7-Zip.ntfs" ApplicationName="7-Zip File Manager" />
<Association Identifier=".dmg" ProgId="7-Zip.dmg" ApplicationName="7-Zip File Manager" />
<Association Identifier=".hfs" ProgId="7-Zip.hfs" ApplicationName="7-Zip File Manager" />
<Association Identifier=".xar" ProgId="7-Zip.xar" ApplicationName="7-Zip File Manager" />
<Association Identifier=".squashfs" ProgId="7-Zip.squashfs" ApplicationName="7-Zip File Manager" />
<Association Identifier=".apfs" ProgId="7-Zip.apfs" ApplicationName="7-Zip File Manager" />
</DefaultAssociations>
 

Attachments

Last edited:
5/16/2024: updated with new 7zip 24.05, including all compatible file associations
 

Attachments

  • 7zipassoc.png
    7zipassoc.png
    24.3 KB
Ty!!! This last 4 days i was struggling with File Assoc reading multiple posts for firefox, 7zip and klite(For my own ISO). Microsoft recommend the import/export DefaultAssoc.xml but many post here say this not work.I have a question the OEMdefault.xml dont work alone? Its necesary put reg keys with it to work ? Ty All from argentina and excuse me if i have a bad english.
 
Both files are necessary, you might also want to look at this post for Firefox integration.
Install Firefox as default browser, Pin to Start Menu & Taskbar, and Install uBlock Origin [W11]

To set firefox and 7-zip associations use:
<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
<Association Identifier=".htm" ProgId="FirefoxHTML-308046B0AF4A39CB" ApplicationName="Firefox" />
<Association Identifier=".html" ProgId="FirefoxHTML-308046B0AF4A39CB" ApplicationName="Firefox" />
<Association Identifier="http" ProgId="FirefoxURL-308046B0AF4A39CB" ApplicationName="Firefox" />
<Association Identifier="https" ProgId="FirefoxURL-308046B0AF4A39CB" ApplicationName="Firefox" />
<Association Identifier=".7z" ProgId="7-Zip.7z" ApplicationName="7-Zip File Manager" />
<Association Identifier=".7z" ProgId="7-Zip.7z" ApplicationName="7-Zip File Manager" />
<Association Identifier=".zip" ProgId="7-Zip.zip" ApplicationName="7-Zip File Manager" />
<Association Identifier=".rar" ProgId="7-Zip.rar" ApplicationName="7-Zip File Manager" />
<Association Identifier=".001" ProgId="7-Zip.001" ApplicationName="7-Zip File Manager" />
<Association Identifier=".cab" ProgId="7-Zip.cab" ApplicationName="7-Zip File Manager" />
<Association Identifier=".iso" ProgId="7-Zip.iso" ApplicationName="7-Zip File Manager" />
<Association Identifier=".xz" ProgId="7-Zip.xz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".txz" ProgId="7-Zip.txz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".lzma" ProgId="7-Zip.lzma" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tar" ProgId="7-Zip.tar" ApplicationName="7-Zip File Manager" />
<Association Identifier=".cpio" ProgId="7-Zip.cpio" ApplicationName="7-Zip File Manager" />
<Association Identifier=".bz2" ProgId="7-Zip.bz2" ApplicationName="7-Zip File Manager" />
<Association Identifier=".bzip2" ProgId="7-Zip.bzip2" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tbz2" ProgId="7-Zip.tbz2" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tbz" ProgId="7-Zip.tbz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".gz" ProgId="7-Zip.gz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".gzip" ProgId="7-Zip.gzip" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tgz" ProgId="7-Zip.tgz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tpz" ProgId="7-Zip.tpz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".zst" ProgId="7-Zip.zst" ApplicationName="7-Zip File Manager" />
<Association Identifier=".tzst" ProgId="7-Zip.tzst" ApplicationName="7-Zip File Manager" />
<Association Identifier=".z" ProgId="7-Zip.z" ApplicationName="7-Zip File Manager" />
<Association Identifier=".taz" ProgId="7-Zip.taz" ApplicationName="7-Zip File Manager" />
<Association Identifier=".lzh" ProgId="7-Zip.lzh" ApplicationName="7-Zip File Manager" />
<Association Identifier=".lha" ProgId="7-Zip.lha" ApplicationName="7-Zip File Manager" />
<Association Identifier=".rpm" ProgId="7-Zip.rpm" ApplicationName="7-Zip File Manager" />
<Association Identifier=".deb" ProgId="7-Zip.deb" ApplicationName="7-Zip File Manager" />
<Association Identifier=".arj" ProgId="7-Zip.arj" ApplicationName="7-Zip File Manager" />
<Association Identifier=".vhd" ProgId="7-Zip.vhd" ApplicationName="7-Zip File Manager" />
<Association Identifier=".vhdx" ProgId="7-Zip.vhdx" ApplicationName="7-Zip File Manager" />
<Association Identifier=".wim" ProgId="7-Zip.wim" ApplicationName="7-Zip File Manager" />
<Association Identifier=".swm" ProgId="7-Zip.swm" ApplicationName="7-Zip File Manager" />
<Association Identifier=".esd" ProgId="7-Zip.esd" ApplicationName="7-Zip File Manager" />
<Association Identifier=".fat" ProgId="7-Zip.fat" ApplicationName="7-Zip File Manager" />
<Association Identifier=".ntfs" ProgId="7-Zip.ntfs" ApplicationName="7-Zip File Manager" />
<Association Identifier=".dmg" ProgId="7-Zip.dmg" ApplicationName="7-Zip File Manager" />
<Association Identifier=".hfs" ProgId="7-Zip.hfs" ApplicationName="7-Zip File Manager" />
<Association Identifier=".xar" ProgId="7-Zip.xar" ApplicationName="7-Zip File Manager" />
<Association Identifier=".squashfs" ProgId="7-Zip.squashfs" ApplicationName="7-Zip File Manager" />
<Association Identifier=".apfs" ProgId="7-Zip.apfs" ApplicationName="7-Zip File Manager" />
</DefaultAssociations>
 
Last edited:
Besides importing reg keys, I would also suggest you have a look at the Windows built-in commands "ftype" and "assoc". While I now use PeaZip instead of 7-Zip because of better-looking UI, I think you have done exactly what I would do in the XML if I would deploy 7-Zip. Thank you for the nice work.
 
Ty All, I had not seen that post ty cristhian2k47
Yes i was trying with firefox with ublock and add ons and see posts about making msi or exe repack but the problem with associations detour my attention. Ty for all the replys my ISO is taking shape :D.

 
This method of association works absolutely fine on 10 21H2, but on 11 24H2, there is no default association. Crazy all the stuff thats breaking on 24H2. But maybe it will work again with legacy setup, so will try that first and come back here for a new solution if stays broken.
 
Legacy Setup has nothing to do with protected File Type Associations. You might want to remove User Choice Protection, its only function is to block user changes to file associations and certain desktop reg settings.
 
This method of association works absolutely fine on 10 21H2, but on 11 24H2, there is no default association. Crazy all the stuff thats breaking on 24H2. But maybe it will work again with legacy setup, so will try that first and come back here for a new solution if stays broken.
I will look into this, maybe 7-Zip changed registry keys on new version.
 
Legacy Setup has nothing to do with protected File Type Associations. You might want to remove User Choice Protection, its only function is to block user changes to file associations and certain desktop reg settings.
Have I achieved this by removing that service blocking Set User FTA binary? If yes, does the registry import in ntlite run before that service is disabled?

Yeah it is UCPD, this I changed on the image I am about to test, so maybe it will work from now on then.
 
I will report back tomorrow, but removing the protection didnt work for this however, I will move the reg file to post setup as mentioned here. Its currently in the wrong place it seems. If needs be I will use the FTA tool, but the reg file is good, I compared it to working system.
 
instead of mounting directory, put xml file in:
sources\$OEM$\$$\System32\OEMDefaultAssociations.xml

it goes in ISO folder instead of mount directory, if it works i will update the post (it should cuz i use this in 24h2 with media creation tool and installing 7z through unattended file).
 
thanks! i updated the post with new steps, in the future when im not lazy ill do a script to add 7zip associations into OEMDefaultAssociations.xml instead of replacing the full default file.
 
Back
Top