Integrate 7-Zip 23.01 natively

squally2k47

New Member
I'll show you how to install 7-zip natively, this means no post-setup is needed.
  • Go to image tab in NTLite → Right click mounted image → Explore mount directory
  • Download 7-Zip.7z → Drag "Program Files" and "ProgramData" folders to mount directory → Close mount directory
  • Go to registry tab in NTLite → Add → Registry files → 7-Zip.reg

I'll do more if this post gets good feedback, tools i used to make this:
RegFromApp (Track registry changes while installing 7-Zip)
ProcessActivityView (Track file changes while installing 7-Zip)
 

Attachments

  • 7-Zip.7z
    1.5 MB
This idea isn't new, but it's a time consuming process which needs to be repeated for each of your apps.

You have to confirm all filesystem and reg changes are correctly tracked. The preferred method (which also applies to non-NTLite images) is to boot into audit mode, then install your apps, before doing a sysprep generalize and capturing a finished image. So you do this process once, without needing to keep separate saved files and reg keys for every installed app.
 
Something that probably needs restating too, is a lot of automated and post-install stuff can be avoided entirely by using portable software. For example, registry files aren't necessary if you use the portable version of 7Zip, saving some steps and potential complications. It's not a solution for every program obviously, but many people are using freeware, such as 7Zip, Gimp, Chrome, NTLite, etcetera, and a lot of software of this nature has a portable option readily available. I think this gets overlooked a lot, based on the silent install questions we get, especially since portable is easier and safer.
 
In my opinion this is a very complex and non-native way of installing 7-Zip. Users are always recommended to download the 7-Zip installer from official web site and perform installation.

If users would like to perform file associations automatically, there are 2 built-in Windows command that would get the job done. The below example associates .7z files with 7-Zip:

Code:
ftype 7-Zip.7z="C:\Program Files\7-Zip\7zFM.exe" "%1"
assoc .7z=7-Zip.7z

No other registry changes are required for 7-Zip to function normally as far as I know.
 
No other registry changes are required for 7-Zip to function normally as far as I know.
You're looking at an oversimplified picture of what's happening in reality.

With ProcMon and a registry changes monitor, it's possible to track what goes on during app installation. For example, things like creating the uninstaller reg keys. Without capturing them, then it's not possible to do a clean uninstall or upgrade afterwards.

The primary reason for not using this process is the extra work involved to deal with background noise. Snooping tools can collect a lot of data, and if you're not careful about filtering – it's possible to include too much or too little which is relevant. If your apps are fairly static (they don't get many upgrades), then the investment is acceptable.

There's also testing and validation. How do you know the minimum required changes are correctly captured? Do you want to be spending time maintaining this?

This concept like I've said isn't new. MSMG Toolkit does this (along with abbodi) with .WA add-on's. In a nutshell, they've deconstructed some apps into extracted folders and reg files which can be integrated into an image. Since this isn't an automated process, you have to trust whoever repacked the .WA did a correct job.

Whereas running the normal installer always does what the developer wanted.
 
You're looking at an oversimplified picture of what's happening in reality.

With ProcMon and a registry changes monitor, it's possible to track what goes on during app installation. For example, things like creating the uninstaller reg keys. Without capturing them, then it's not possible to do a clean uninstall or upgrade afterwards.

The primary reason for not using this process is the extra work involved to deal with background noise. Snooping tools can collect a lot of data, and if you're not careful about filtering – it's possible to include too much or too little which is relevant. If your apps are fairly static (they don't get many upgrades), then the investment is acceptable.

There's also testing and validation. How do you know the minimum required changes are correctly captured? Do you want to be spending time maintaining this?

This concept like I've said isn't new. MSMG Toolkit does this (along with abbodi) with .WA add-on's. In a nutshell, they've deconstructed some apps into extracted folders and reg files which can be integrated into an image. Since this isn't an automated process, you have to trust whoever repacked the .WA did a correct job.

Whereas running the normal installer always does what the developer wanted.
I actually agree with you for the point of "background noise" and "testing and validation".

I agree one can monitor with procmon or whatever registry monitor to check what is going, but I think you know not ALL registry changes you captured are related to the installation because Windows is a multitasking system, and registry is constantly changing and modified by multiple process, so I do not think I trust anything using the "capture" method. E.g., you cannot prove the registry is related to 7-Zip without verifying it deeply in detail.

I think we are in agreement with this part.

Btw, as a system administrator with 20+ years of experience, who wrote installation scripts using Inno Setup (the same installer as NTLite uses) and maintain computers for a large corporation (think about >10000 PCs), I do not maintain a single PC for home use (probably unlike most of you). Maintainability is first concern for me. That is the reason I suggest using official installers and performing customizations later.

What I do not fully agree is your statement about "normal" installers does what the developer wanted. Firstly, it is security common sense that we do not download unknown software from unknown sources. Secondly, we can customize the official installers via parameters and transforms in a certain way to satisfy our own needs. Microsoft Orca and Adobe Customization Wizard are two examples of this kind of tools.

Btw, I do not really "trust" other builders, and I build my own Chocolatey packages for the following applications and using it with "Microsoft Deployment Toolkit" to create my own custom image. Just in case anyone is interested.

Code:
7-Zip
AcrobatReader
dotnet6
Firefox
Firefox-ESR
GoogleChrome
IrfanView
IrfanViewPlugins
IrfanViewTW
LibreOffice
LibreOfficeHelp_en-US
LibreOfficeHelp_zh-TW
microsoft-ui-xaml-27
microsoft-ui-xaml-28
microsoft-vclibs-140
microsoft-windows-terminal
Paint.NET
PeaZip
PowerShell
Thunderbird
vcredist
VisualStudioCode
VLC
winget-cli

Take an example. Below is the installation code for automated install of 7-Zip

Code:
$ErrorActionPreference = 'Stop'

# Localize Chocolatey environment variables
$chocolateyPackageVersion = $env:chocolateyPackageVersion
$chocolateyPackageName = $env:chocolateyPackageName

# Define other local variables
$softwareName = '7-Zip'
$fileName = '7z2301-x64.msi'
$fileLocation = '\\desktop\DS-Create$\Applications'

# Define source location
$file = "$fileLocation\$softwareName\$fileName"

# Define install parameters
$installLog = "$env:TEMP\$chocolateyPackageName.$chocolateyPackageVersion.MsiInstall.log"
$silentArgs = "/passive /norestart /l*v `"$installLog`"

# Define Chocolatey parameter hash table
$packageArgs = @{
  packageName    = $chocolateyPackageName
  fileType       = 'msi'
  file           = $file
  softwareName   = $softwareName
  silentArgs     = $silentArgs
  validExitCodes = @(0, 3010, 1641)
}

Install-ChocolateyInstallPackage @packageArgs
 
Last edited:
"Phantom" installing 7zip is old hat, integrate 7zips sniffed installer reg file into image or post setup and add the program folder with $OEM$ folders. I can "install" HashTab and MediaTab just by registering dll's.

Ive been banging on about Portables for years. Programs that are installers only can be run portable, Portables can have Context Menu options.
The only programs i need to actually install are Nero and Sony Sound Forge.
 
I didn't want to start a separate thread and its a bit off-topic, but are there any components needed to have working 7-Zip and/or WinRAR context menu? I am not able to get either of them display context menu (old or new style) in Windows 11 explorer no matter what I do, install, re-install, but context menus for other software works without issues.

Associations with 7-Zip/RAR file types work, but not the context menu that allows users to quickly create archives, extract files, etc. The mentioned context menus do appear inside 7-Zip built-in explorer (file manager), but not in Windows 11 explorer. PeaZip context menu works, but I find PeaZip overly bloated.

I can't actually figure out how to bring Windows 11 new context menu style back. Only classic one works.
 
I didn't want to start a separate thread and its a bit off-topic, but are there any components needed to have working 7-Zip and/or WinRAR context menu? I am not able to get either of them display context menu (old or new style) in Windows 11 explorer no matter what I do, install, re-install, but context menus for other software works without issues.

Associations with 7-Zip/RAR file types work, but not the context menu that allows users to quickly create archives, extract files, etc. The mentioned context menus do appear inside 7-Zip built-in explorer (file manager), but not in Windows 11 explorer. PeaZip context menu works, but I find PeaZip overly bloated.

I can't actually figure out how to bring Windows 11 new context menu style back. Only classic one works.
test nanazip
 
Back
Top