Advanced package for 7-zip

In the previous post I covered how you could create a basic package for 7-zip to deploy out to users, however this does not do some basic things such as register file type associations in windows… I have since created a vbscript “wrapper” that does the following:

sets the install directory

runs the 7-zip silent install

checks the install returned OK

reads the file types to associate with 7-zip

removed any associations that already exist for those file types

create the new association with 7-zip

create the folder icon and 7-zip file open actions

returns 0 if succeeded – useful if deploying via SCCM

The code should be posted below and includes comments for each of the sections. The code is a little rough around the edges but does work on the handful of systems (XP, x86) I have tested it on. Note that the icon for file association will not appear until after a reboot but it does work immediately after running.