© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
O. HeaumeUnderstanding Microsoft Intunehttps://doi.org/10.1007/978-1-4842-8850-4_3

3. Setup.exe

Owen Heaume1  
(1)
West Sussex, UK
 

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.

If you are lucky, the supplier of the application may include the exact command line in the registry, required for silent uninstall too as shown in Figure 3-1.

A screenshot of a list of ten files. The file titled quiet uninstall string with its type and data is annotated.

Figure 3-1

A lucky find! Querying the registry for the uninstall string

In-Built Help

Typing: setup.exe /? (You may need to replace the word ‘setup’ with the application name if it is named differently) at a command prompt may provide you with the command line switches you are going to need. Make sure that you are in the same working directory as the setup.exe file when you do this. (See Figure 3-2)

A screenshot of a window. A dialog box of fusion excel connect client 64-bit is open with a selected ok button at the bottom.

Figure 3-2

A setup.exe displaying help – a rare find indeed

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

This is the quickest of the two extraction methods. Try to extract the MSI from setup.exe using a program like 7-Zip. (Right-click the setup.exe and select one of the “Extract” options.) The resulting extraction may provide you with the required MSI file. Figure 3-3 shows an attempted MSI extraction using 7-Zip.

A check-in menu of fusion excel connect client 64-bit is open. A file 7-zip is opened in which extract to fusion excel connect client 64-bit option is selected.

Figure 3-3

Attempting to extract an MSI using 7-Zip

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.

Tip

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.

Double-click the exe installer to begin the installation. (See Figure 3-4)

A screenshot of a window headed fusion excel connect client 32 bit. It is to open the InstallShield wizard for fusion excel connect. The next button is selected at the bottom.

Figure 3-4

Begin the MSI extraction process by manually running the setup.exe installation

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.

Leaving the Installation GUI on screen, type %temp% in the Run menu to view the contents of the temp directory. (See Figure 3-5)

A dialog box of a run. Percent temp percent is written in the open tab. Below it, the ok button is selected.

Figure 3-5

Navigating to the Temp directory using the environment variable shortcut

In the Temp directory, click the Date Modified title to view it in date order. Figure 3-6 shows only one entry coinciding with the date and time of extraction and this should be the folder containing the setup contents.

A screenshot of a window. Under the file tab, the quick-access files are open. A file under the temp folder, and the heading, date modified, is annotated.

Figure 3-6

Using detective skills to match the directory Date Modified time to the time the setup.exe was launched

Double-click the matching folder, and there it is – the much sought-after prize. Copy the MSI to a different location and only then cancel the exe installation that was started. (See Figure 3-7)

A screenshot depicts a list of five files with the names and modified dates. A file titled fusion excel connect client 31-bit dot m s i is highlighted.

Figure 3-7

Case closed: the MSI has been located and can be copied to another location before canceling the setup.exe installation

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.33.157