Upgrade 7-zip to 18.05 in mixed environment.
Our enterprise has a mix of Windows 7, 8.1 and 10. Windows 7 is mixed x86 and x64. Win 7 and Win8 x64 has mixed 32bit and 64bit 7-zip. 7zip is mixed several versions with no consistency.
We want to bring everyone up to v18.05 because of a vulnerability in 18.03 and previous versions explained here: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-10115
Installations were being done manually and during deployment with MDT.
Goals:
-
If device does not have 7-zip installed it will not get 7zip installed now
-
Be sure <v18.05 is uninstalled and v18.05 is installed.
-
If x64 OS has 32bit application it should be replaced with 64bit application
I've pushed out applications before but not with the 2nd and 3rd goals. I'm not sure how to uninstall all old versions without knowing which versions they could be, or uninstalling 32bit application on x64 OS and installing 64bit application.
Thanks for any input.
Posted May 4, 2018, 12:38 AM UTC
This seems like it would be easy enough to script. I would use PSAppDeploy Toolkit to script the upgrade to version 18.05. You can easily detect the OS version, 32-bit/64-bit etc with powershell scripting.
Create an application that detects all old versions of 7-Zip. A detection rule that looks for 7z.exe less than version 18.05 should work.
Create an application for 7-Zip 18.05. Use supersedence to upgrade devices that are detected as having older versions of 7-Zip installed.
Alternatively you could also create a device collection with a query that looks for whether or not 7-Zip is installed and deploy your script to that collection.
This is exactly what I did here. The magic you need in PSADT is:
This means you only need a single deployment regardless of OS or architecture.
The MSI seems to be removing the old installs ok on my machines but YMMV and you may need to clean up machines in the pre-install section.
I'm curious, did you write your own OS arch detection, or is $is64Bit built-in? Very new to PSADT, here, appreciate the script.
It's built-in.
Going to use the help files to learn more, thank you.