Windows Installer InstallAware for Windows Installer Header Image Windows Installer without Rocket Science

  InstallAware Blog


How to install (or remove) a third party MSI using InstallAware

Hello everybody! In this post I’m going to show you how to install third party MSI files using InstallAware. We’ll achieve this functionality using the (Un)Install MSI Setup and File Bag MSIcode commands.

First, what does the File Bag command do? Think of it as an extended support files mechanism. While support files (also called Creatives in the InstallAware IDE’s visual designers) are a great way to add temporary files to your setup, they lack the ability to recurse into multiple folders. Support files also cannot be placed inside a web media block – they always go inside the main setup.exe file. So File Bag is essentially a fix for these two problems – this command lets you add temporary files to your setup which are only available while setup is running (and not permanently installed on the end-user system), is web media block friendly, and also supports recursion.

Next, what does (Un)Install MSI Setup do? As the name implies, it can install or uninstall an MSI based setup. The beauty of this command, as opposed to using another built-in command like Run Program to install third party MSI files, is that it captures native progress as well as the final error/success state of the installation, along with any textual error description text if applicable. This makes your setup look more professional: even the progress of external setups will be displayed in your own custom dialogs at install time, and you can provide very effective error handling and troubleshooting.

Now that we’ve gotten the preliminaries out of the way, lets get to work. A good example of to use the File Bag command is in our own pre-built setup script for the Microsoft .NET Framework 3.0. You can add this runtime to your setup and then switch to the MSIcode view to investigate how we’ve used the command.

The File Bag MSIcode statement:

And the File Bag command window:

The pre-defined compiler variable #IADIR# simply returns InstallAware‘s main installation folder, which is the parent folder of the setup files for the .NET 3 Framework. In this field, you can enter any path you like, or just a single file name – as long as it points to the file(s) you want to add to your setup as a temporary resource.

The other interesting field in this command window is the NET30_FILEBAG variable. You may enter any custom variable in this field (as long as you pre-initialize it using the Set Variable command to an empty value). You should always provide a variable in this field, because the temporary location where File Bag makes your “bagged files” available at runtime will always change from machine to machine and setup to setup. So unless you provide a variable in this field, you won’t be able to access your bagged files at runtime, which beats the whole purpose of using File Bag in the first place!

Next lets take a look at the command window for the (Un)Install MSI Setup plug-in.

The Action tab indicates the installation/uninstallation mode and passes additional command line parameters to setup:

When installing an MSI file, you typically enter ADDLOCAL=ALL here, to install all of the features that are provided with the MSI. When uninstalling, you typically enter REMOVE=ALL. You are free to set any other MSI properties using this field, to install precisely those features that you require, or perform a customized MSI installation.

The Package tab specifies the MSI package to use, by filename (used when installing) or by package GUID (used when uninstalling):

When installing, you’ll want to specify the full path to the third party MSI file. The path will always be composed of the variable populated by File Bag, followed by the subfolder (if any) and the MSI file name. When uninstalling, you may again reference the MSI file by its full file path; alternately you may simply reference it by its unique package GUID (the GUID may be found by opening up your MSI package in Orca, navigating to the Property table, and copying the full value, including the squiggly parenthesis, corresponding to the ProductCode property). Using the GUID can be more advantageous when uninstalling, since you won’t need to provide access to the MSI file (often inconvenient to do at uninstall time – you hardly want to prompt your end-users for a setup CD when they’re just trying to remove your product).

Here’s an MSIcode snippet that shows the proper placement of the (Un)Install MSI Setup command for use at uninstall time:

And this is how the Action tab would look for the command when uninstalling (again, feel free to add additional properties):

So now, you know all you need to add temporary files to your setup, and to run third party MSIs, even natively capturing their native setup progress, to install or remove them :)

One last thing worthy of mention is the Setup Decompressor. This is a very handy tool that InstallAware originally built for Microsoft in 2005, to optimize the compressibility of their then-current .NET 1.1 Framework. This tool works with MSI (and a few other file types) and decompresses their data. However, it doesn’t just “extract” data like unzipping a ZIP file. What it does is, it first extracts the data, then re-inserts it back into the original file, in unmodified form – only uncompressed this time (think of it like re-creating a ZIP file with “stored” compression, so the files inside the ZIP archive are not compressed but just stored as-is).

Why would anybody want to do this? Data Compression 101: No matter how good a compression algorithm is, it cannot recompress data that has been compressed before. So for example, lets say you have a 10 MB file, and when you ZIP it, it goes down to 5 MB, and when you CAB it, it goes down to 3 MB…you might think that when you CAB the 5 MB ZIP, it would again come down to 3 MB…but that’s not the case. You still get a 5 MB CAB – because the 5 MB ZIP has already eliminated redundancies in the original uncompressed data stream (even though it did a worse job at it than the CAB).

InstallAware‘s compression algorithm is far better than the compression used in MSI files, but if you feed it pre-compressed data (such as “off-the-shelf” MSI files, which are always compressed using CAB), it won’t be able to reduce file sizes any further. For this reason, you want to run the Setup Decompressor on your MSI files before packaging your setup with InstallAware. Since Setup Decompressor is non-destructive, it will never harm your MSI files or change the files they contain in any way – other than reversing their compression. And this way, InstallAware is free to work miracles in compressing your MSI files!

Just take a look at .NET Framework sizes, when packaged natively (as by Microsoft) and with InstallAware (after pre-processing by the Setup Decompressor). Typical size savings are 40% over the already compressed size of the native Microsoft files, and sometimes as high as 67% (as in the case of the .NET Framework 1.1 with SP1 inlined). You’ll be pleased to know that the Setup Decompressor also works with other file types – such as CAB, MSM, MSP, and even some kinds of EXE files. Just try it out!

To open the Setup Decompressor tool, click the Decompress button in the Tools group on the Design tab of the InstallAware IDE:

All you have to after this is click the Browse button and select the MSI file you want to decompress. Click Decompress and the fully automated Setup Decompressor gets to work for you – and provides live status update as it investigates the various archives and streams inside your MSI file. I also recommend checking the Backup original file option – just in case you run into a bug that we haven’t encountered yet ;)

So, that’s it for now. In my next post, we’ll cover a related topic, “How to run a third party EXE using InstallAware“. Until then!

Thank you,

Panagiotis Kefalidis
Software Design Team Lead
InstallAware Software Corporation

14 Responses to “How to install (or remove) a third party MSI using InstallAware”

  1. Lex Y. Li Says:

    Quite a useful post. Will the next post talk about how to install/uninstall third party installers such as NSIS powered as well? Or it will be a separate post

  2. Panagiotis Says:

    The next post will be sth like it. I’m going to describe how you can Install/Uninstall third party .exe files (using parameters). NSIS produces .exe files, so I guess you’ll get your answers.

  3. Cvecara Beograd Says:

    I precisely desired to say thanks again. I am not confident what I could possibly have tried in the absence of those concepts contributed by you relating to such a subject. It had become a distressing condition in my view, however , being able to view the well-written tactic you processed it created me to weep more than joy. Very grateful for your guidance and believe you realize what an wonderful job you’re doing instructing others with the aid of a web website. Most likely you haven’t come across any of us.

  4. Says:

    You are not the general blog writer, man. You certainly have something powerful to add to the net. Such a wonderful blog. I will revisit again for more.

  5. Says:

    lawful graile oberstein weiring sizzlin change butter bodines archdiocese

  6. googleblog Says:

    I simply wanted to compose a brief comment to be able to say thanks to you for the fantastic hints you are placing on this site. My time consuming internet research has finally been paid with reasonable facts and techniques to go over with my company. I ‘d suppose that most of us site visitors are really blessed to be in a fabulous site with many wonderful people with good advice. I feel pretty blessed to have encountered your weblog and look forward to some more enjoyable minutes reading here. Thanks a lot again for everything.

  7. yahoo Says:

    Thank you a lot for giving everyone a very breathtaking opportunity to read critical reviews from this website. It really is so lovely and stuffed with a great time for me personally and my office colleagues to visit your web site minimum three times in 7 days to find out the new issues you have got. And lastly, I am just certainly pleased considering the eye-popping points you serve. Certain 1 ideas on this page are definitely the most effective I’ve ever had.

  8. glogspot Says:

    Useful information. Fortunate me I found your web site by chance, and I am stunned why this accident did not took place earlier! I bookmarked it.

  9. glogspot Says:

    Great blog here! Additionally your web site loads up fast! What web host are you using? Can I am getting your associate hyperlink for your host? I wish my website loaded up as quickly as yours lol

  10. Affiliat Program Says:

    I blog frequently and I seriously appreciate your information. Your article has truly peaked
    my interest. I will take a note of your site and keep
    checking for new details about once a week. I subscribed to your
    Feed as well.

  11. Says:

    I haven’t checked in here for some time as I thought it was acquiring boring, but the last few posts are great quality so I guess I’ll add you back to my everyday bloglist. You deserve it my friend

  12. Says:

    Just blowing some free time on Digg and I found your post . Not typically what I prefer to learn about, but it was definitely worth my time. Thanks.

  13. Says:

    How-do-you-do? an amazing blog post dude. Thnkx But I’m having problem with ur rss feed. Unable to subscribe. Is there anybody else facing similar rss feed issue? Anybody who knows please respond. Thanks in advance

  14. Sammy Ambriz Says:

    Great content. Fast turnaround

Leave a Reply