Geeks With Blogs
Demystifying Windows Setups Windows Installer and the Technology That Surrounds It

I'd like to use this first post to introduce myself and tell you what qualifies me to talk about setups in the Windows Environment.  Over the last 6 years one of the primary functions of my job, no matter what company I have been at, has been to develop installations.  I have been working with Windows Installer pretty much since it was introduced, and before that spent time developing script-based installations using both Wise Solutions and InstallShield products.

Currently, I work for Wise Solutions which is now owned by Altiris.  My tool selection may be a little bias, but Windows Installer as a ground level technology is the same no matter what tool you are using.  In addition to the tools mentioned above, I have experience with Orca, WiX, OnCommand, ZeroG and a host of other installation tools from “smaller” less recognized companies.

I am a Senior Consultant for Wise, that is just a fancy way of saying I do whatever the customer needs.  I perform training, develop installations, work on repackaging projects, develop courseware, perform best practices assessments and a host of other services.  For a complete list, check out the Wise Professional Services website:

So this first post isn't just about me, I will add some Windows Installer know-how.  Windows Installer provides a great deal of functionality you can leverage as part of the service.  A question I seem to get a lot of is how to fix a broken installation.  This can be caused by many things.  For example, your installation may have incorrectly defined KeyPaths in the Components.  Another common “gotcha” is that an installation may not have been validated properly.

If the installation has already been deployed, fixing it can be difficult to say the least.  Sometimes a broken installation will even prevent you from removing the application properly.  Luckily, there is a tool that ships with the SDK that will aid in removing damaged installations from the computer.  The name of this tool is MsiZap.exe.  If you run MsiZap without any command line parameters, you will see the following:

Copyright (C) Microsoft Corporation.  All rights reserved.
MSIZAP - Zaps (almost) all traces of Windows Installer data from your machine.

Usage: msizap T[WA!] {product code}
       msizap T[WA!] {msi package}
       msizap *[WA!] ALLPRODUCTS
       msizap PWSA?!

       * = remove all Windows Installer folders and regkeys;
           adjust shared DLL counts; stop Windows Installer service
       T = remove all info for given product code
       P = remove In-Progress key
       S = remove Rollback Information
       A = for any specified removal, just change ACLs to Admin Full Control
       W = for all users (by default, only for the current user)
       M = remove a managed patch registration info
       G = remove orphaned cached Windows Installer data files (for all users)
       ? = verbose help
       ! = force 'yes' response to any prompt

CAUTION: Products installed by the Windows Installer may fail to function after using msizap

NOTE: MsiZap requires admin privileges to run correctly. The W option requires that the profiles for all of the users be loaded.

The following command line will remove a broken product for all users on the machine:

MsiZap.exe TW! {00000000-0000-0000-0000-000000000000}

This assumes that the broken product has a ProductCode of all zeros.  You will of course want to pass the ProductCode of the broken application.  What MsiZap does is remove all the Windows Installer registration information from the machine.  In effect, Windows Installer will no longer be aware of the application on the computer.  What it does not do is remove application resources, such as, files and registry keys.  This will need to be done manually.  However, you can now safely remove these items and not have to worry about Windows Installer performing self-healing operations on these resources.

Posted on Monday, July 18, 2005 7:44 AM Windows Installer , Personal , Wise Installation | Back to top

Comments on this post: Introduction

# re: Introduction
Requesting Gravatar...
I have been trying to solve some problems with my installation project and that is how I came across this article. It looked very promising but unfortunately it ended abruptly (wonder if it is incomplete).

My scenario is that I want to copy a large number of data files (100s if not 1000s) to the customer server as part of the installation. Since these files will keep changing, I dont want to embed them within the msi file. The problem is that I am unable to obtain, in the installer class, the path from which Setup was started so that I can access the data files to be copied. I tried many ways and most of them return Windows directory or something like that.

Please let me know if there is any way to get the path from which Setup.exe was started.


Left by Asad on Jan 20, 2006 1:20 PM

# re: Introduction
Requesting Gravatar...
Is the ResolveSource action in your installation? You could use that, but you could also check the registry key where the source resiliency is written.

Left by AJ Shurts on Jan 20, 2006 1:27 PM

# re: Introduction
Requesting Gravatar...
Thanks Shurts. I was not aware of ResolveSource action. Apparently, this should solve teh problem. I will try it on Monday and let you know of teh result.

Thanks again, Have a nice weekend...
Left by Asad on Jan 20, 2006 2:35 PM

# re: Introduction
Requesting Gravatar...
Thanks. My problem was solved without the need to make changes directly to msi file.


seems to be working now (correctly returning the sourec directory path). Wonder what was wrong before.
Left by Asad on Jan 23, 2006 10:13 AM

Your comment:
 (will show your gravatar)

Copyright © Aaron Shurts | Powered by: