Any administrator will relate to the dread of receiving an application that arrives as a setup.exe file. Notoriously difficult and sometimes seemingly impossible to deploy, they often arrive with little or no help files.
There are a few techniques that you can employ to help mitigate some of the anxiety a setup.exe can bring, and this chapter will cover the tried-and-tested ones that I have employed during my years of application deployment.
Discovering the Setup.exe Silent Install/Uninstall Parameters
A silent installation or uninstallation of any application is imperative when deploying to end users when using Intune. Finding the silent install and uninstall command line switches for these can be tricky. Here are a few techniques to try if you’ve not had any luck with the (rarely) supplied documentation.
EXEs Have Registry Information Too
It’s worth pointing out that you won’t just find MSI installation information at the 32-bit and 64-bit registry uninstall subkeys (as you learned in the previous chapter), you will also find information on setup.exe.
In-Built Help
Internet Search
There’s no shame in throwing your hands in the air and having to search the Internet for the information you need. You may discover a blog where someone has figured this all out for you already, and there is certainly no need to reinvent the wheel.
On many an occasion, I have found what I need by visiting the official website of the application I was trying to deploy; often there is install advice for admins and sometimes an MSI alternative to download. Failing that, it’s always worth reaching out to their technical support email or phone number to see if they can help; I have had success using this method on rare occasions.
MSI Extraction
Sometimes it’s downright impossible to obtain or figure out the silent uninstall command line switches for a setup.exe. It’s always preferable to deploy an MSI and therefore another technique to try in this situation is MSI extraction.
Some, but not all, setup.exe files are wrappers for MSI files, and it may be possible to extract the MSI from them.
MSI Extraction Method #1
MSI Extraction Method #2
This technique can work well and is worth your time trying. Many setup programs extract their contents to a temporary location first, and in some cases, the extracted contents may include an MSI.
To use this extraction technique, manually install the program but just before you click “Next” to commence the install, browse to the %temp% directory (in the Run menu type %temp%), and locate the folder that contains the program extracted files.
Once you have done that, if present, copy the MSI to another location before you cancel the manual install process you started.
This method always worked well on Java runtime executables (JRE) which for many now, along with Adobe Flash, are thankfully a deployment of the past.
You learned in Chapter 1 that when scripting paths it was better to use PowerShell’s environment variables; these environment variables always resolve to specific locations. Windows also has environment variables, and you access them by surrounding the variable name with a percentage symbol (%). The example you just saw in MSI Extraction Method #2 uses the %temp% environment variable which will always resolve to C:Users{username}AppDataLocalTemp. To see a list of environment variables and their values, try typing set in a command window.
Example MSI Extraction
Let’s look at how you could extract the MSI from the FUSION Excel Connect Client 32bit.exe application that has been used as an example throughout this chapter so far.
At this stage, this is far as you need to go, although on some Setups you may need to go to the next stage by clicking next. The main takeaway is that you do not click through to the stage where the installation would take place – you want to stop just before that process.
Just like that, you have an MSI that can be deployed.
Setups can be a pain to deploy and sometimes no amount of effort will result in a deployable application. Having said that, take some solace that in over 15 years of application deployment I have only ever experienced this once.
Summary
This chapter has been a breeze compared to the previous ones. You have learned that the dreaded setup.exe application installer may not be as scary as it seems.
You learned that you could query the registry much as you would for MSIs for the same uninstall string information and were reminded of searching for online help or documentation that may assist in building the command line parameters required.
Failing all of that, you learned two simple MSI extraction techniques that, if successful, enable a far superior MSI deployment instead.
Next up, it’s all about detection rules and their various types, and finally, you will see some PowerShell coding.