Application Packaging Introduction: Part 1

  • 13 April 2020
  • Sean Huggans

Due to the wide spread of installer types used by different vendors, application packaging in Windows can be a pretty confusing area to get started in. This blog series will provide a basic introduction early on, in hopes of delving into more specific topics as we go. Packaging an application can vary in difficulty from a straightforward installation taking around 20 minutes to a complex or tricky application soaking up weeks of your time to figure out. This series is meant to provide guidance around some of the challenges in this space, and should serve as a good starting point for anyone looking to master this area of systems management. In part 1, we outline some of the common types of installations out there and how to get started automating a basic installation of each. Enjoy!

  1. Standalone Application: These are apps you don't actually "Install" with an installer, you just copy the downloaded directory structure or exe somewhere on the system (ideally Program Files) and create shortcuts to them. This is sometimes referred to as a "file plant installation".  When packaging these, you are essentially creating an installer that does the file copy, as well as shortcut creation along with any other configuration (either through registry settings, INI, Config, or other settings files for options).
    1. You can automate these via an installation script (preferably PowerShell, although batch or cmd scripts work as well - the latter two are legacy methods and PowerShell should really be used instead).
    2. You can also create an installation MSI which can plant the files and create shortcuts, etc. using tools available for these sorts of tasks (talked about more in the MSI installers section below).
  2. MSI Installers: MSI is a standard Windows format installer.  You call upon the MSIExec utility to install, uninstall, or update MSIs.
    1. Install: msiexec.exe /i "C:\Temp\AppABCInstaller.msi" /qn /l*v "C:\Temp\Application ABC Install.log" would be an example of a basic silent installation with an MSI.
    2. Uninstall: msiexec.exe /x "C:\Temp\AppABCInstaller.msi" /qn would be an example of a basic silent uninstall with an MSI.
    3. MSI customization: MSIs have several options that can be set within them.  There are several tools out there that can perform this task (Flexera InstallShield (Admin Studio), The Wix Toolkit, or Microsoft Orca are few), as well as building msi installers from scratch.  You should never directly modify a vendor provided MSI to set options as this is typically unsupported by the vendor.  Instead, the same tools that modify and create MSI installers can be used to generate what is called a "transform" file or MST.  The MST contains all the customizations you set, and "layers" on top of an MSI installation, resulting in the stock vendor's provided MSI installing with default options overriden by the provided MST file.
      1. msiexec.exe /i "C:\Temp\AppABCInstaller.msi" TRANFORMS="C:\Temp\CustomOptionsANC.mst" /qn /l*v "C:\Temp\App ABC Install.log" is an example of an installation utilizing a transforms file to provide customizations needed.
  3. EXE Installers: This is where this gets the most interesting. Many installers are released by the vendor in an EXE file.  Not all EXE installers are created equal, and sometimes take some hunting around on the vendors site, forums on the web, or even self discovery to find available installation switches to perform a silent installation. While some vendors create their own exe installers that little or no information is published about, many vendors utilize one of several well known types of EXE installer creation utilities. In those cases, finding command line options is usually pretty simple. Many of the well-known EXE installer types along with general guidance are listed below:
    1. InstallShield: If you notice the installer is an installshield type installer, the available switches will depend on the version of InstallShield used to create the installer. Typically these are similar, but may require using a different syntax such as a dash vs. a slash when calling the exe. Most of the InstallShield installers can be called to run silently, providing any optional parameters needed via the usage of an "ISS answer" file.
      1. Creating an InstallShield ISS answer file: Installshield answer files can be created by "recording" an installation using the InstallShield installer you are trying to package.
        1. On the machine you are using to package applications (preferably a virtual machine dedicated to this purpose), copy the installer to a location (Ex: "C:\Temp\App ABC\Setup.exe"). Some installers require the rest of the files to be included with the installer, you will need to experiment with this to find out.
        2. Launch an elevated command prompt (Start Menu -> "CMD" in search -> right click cmd.exe -> Run as Administrator)
        3. Launch the setup.exe using the /r switch (EX: "C:\Temp\App ABC\Setup.exe" /r). This will cause the installer to run in "record" mode.
        4. Click through your installer, selecting the settings you need as you go (these may be check boxes, radio button selections, or providing a server name if this is a client/server application).
        5. Once you are finished installing the application, the options you can find the ISS answer file at "C:\Windows\setup.iss", save this file as "AppABC.iss" somewhere for later.
        6. Uninstall the application, or revert the virtual machine.
      1. Install with an InstallShield installer (typical): Setup.exe /s /f1"C:\Temp\App ABC\AppABC.iss" /f2"C:\Temp\App ABC Install.log"
        1. For some InstallShield installers, you may need to use dashes (0) instead of slashes (/).
      2. Install with an InstallShield installer (EXE wrapped MSI): Sometimes you may notice that an InstallShield EXE is used to wrap an installer. In many of these cases, it is possible to pass MSIExec parameters through to the MSI. This can be done in the following fashion: setup.exe /s /v:"/qn /l*v C:\Temp\AppABCInstall.log"
      3. Uninstall with an InstallShield installer: setup.exe /uninst
        1. In some cases, you may need to include a /s switch to get this to occur silently
    2. Wix: If you notice the installer is an Wix type installer...
      1. Install with a Wix installer: Try the following switches: /quiet, /q, /silent, /s, -quiet, -q, -silent, -s
        1. You can also try providing the -norestart or /norestart switches to override a built in reboot kicked off the by the installer.

      2. Uninstall with a Wix installer: Try the following switches: /uninstall, -uninstall
  4. Other or Unknown EXE types: If you aren't sure what type of EXE installer you have, or if you know it's none of the other well-known types, you may be able to find installation switches for it still.
    1. First thing to try: try and see if the installer itself has a help switch, many of them do. This will tell you the available command line switches for the installer.
      1. Method A: setup.exe /?
        1. You can also try "setup.exe -?"
      2. Method B: setup.exe -help
        1. You can also try "setup.exe --help"
    2. Second thing to try: Start searching the web for information on "silent installation" or "silent install" along with your app name. Try including the actual name of the installer file in your search if it's something other than setup.exe. Someone may have struggled through this and found switches, or even talked to the vendor to confirm that none are available. This can save you a ton of work and frustration.
      1. As much a Microsoft product supporter as I may be, I have to admit I have way better luck using Google for this sort of thing than other search engines.
    3. Third thing to try: If you can't find any information about your application's installer, you may need to contact the vendor to ask if there are silent installation switches available. Sometimes you will find out directly from them that their application cannot be installed silently.
      1. If you do end up contacting the vendor and finding information, please remember to post the information somewhere. TechNet, Reddit, ITNinja, SpiceWorks, etc. are all fantastic places for this sort of information. You may save someone else all of the frustration you went through with this particular application by doing so!
      2. If an application does not support silent installation: You still have options. There are several ways you can "recreate" and installer for the application, or even virtualize an installation of the application you can then use to deploy out the application.
        1. App-V: You can use the App-V sequencer to virtualize an installation of this application. This is a great option for applications that do not change often. Updates to any of the application's files will not save, therefore, you will need to re-sequence new versions of the application each time they are released. The good thing is, this is a really seamless process, and you can even include older versions of dependency apps within the virtualized application package which override newer versions actually installed on a workstation the virtualized application is running on. There is a slight learning curve associated with App-V. I am by no means an expert with it, and it's already well documented elsewhere so I won't cover it here. If you would like to get started with App-V, Tim Mangan has fantastic resources available on his site to help understand and master the technology: What is App-V and how does it work?
        2. Repackager: This in my opinion is a really quick/dirty (we don't like quick/dirty, but I am glad Flexera does have this product for when needed) way to package an app as a last resort when nothing else works. Documentation is covered pretty well by Flexera here.

Vendor Links

Error | visuaFUSION Systems Solutions Blog

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /mnt/home/visuafus/public_html/bahusa.net/includes/common.inc:2861) in drupal_send_headers() (line 1551 of /mnt/home/visuafus/public_html/bahusa.net/includes/bootstrap.inc).
  • Error: Call to undefined function mail() in DefaultMailSystem->mail() (line 79 of /mnt/home/visuafus/public_html/bahusa.net/modules/system/system.mail.inc).

Error

The website encountered an unexpected error. Please try again later.