Windows Installer - Troubleshooting MSI

Posted June 14, 2003

Chat Date: May 13, 2003

Please note: Portions of this transcript have been edited for clarity

Chat Participants:

  • Carolyn, Developer on the Windows Installer team
  • Chris, Developer on the Windows Installer Team
  • YuanQing, Test Lead on the Windows Installer Team
  • Om, Program Manager on the Windows Installer Team
  • Eric Sassaman, Windows SDK Community Lead (PSS)

Moderator: Eric (Microsoft)
Welcome to today's Chat. Our topic is Windows Installer - Troubleshooting MSI. Questions, comments, and suggestions are welcome. Let's introduce our hosts for today!

Host: Carolyn (Microsoft)
Hello! I'm Carolyn, a developer on the Windows Installer team. I have been on the Windows Installer team for almost four years and specialize in patching and upgrades, digital signatures, and overall architecture.

Host: YuanQing (Microsoft)
I am YuanQing, test lead of Windows Installer.

Host: Chris (Microsoft)
Greetings! I'm Chris, a developer on the Windows Installer Team. I've been working on MSI for about five years, with my areas of focus including custom actions, security, validation, source resolution, and overall architecture.

Moderator: Eric (Microsoft)
Welcome everyone, let's get started!

Host: Carolyn (Microsoft)
Q: Is there a comprehensive list somewhere of what will make a Patch fail and specifically fail with no indication that it failed?

A: Unfortunately there isn't a comprehensive list of what will make a patch fail. As for failing with no indication of failure, that is generally not commonplace. The only real instance that I know of is when you remove components from a feature (which isn't supported in small/minor updates). As for general patch failures, the most common causes are generally related to sequence number issues. Typically the failure will result from the inability to find a file in a cabinet which can happen if you mis-author your PCP file or don't maintain the file sequence numbers. Other common failures with byte-level patching occur if the file on disk cannot be patched by the patch in the file. This usually happens if your patch wasn't created to target that version.

Host: YuanQing (Microsoft)
Q: Are patches limited to update one specific installer database to another?

A: No. A patch could have multiple targets and multiple upgrade images.

Host: Chris (Microsoft)
Q: How do you make the MSI abort/cancel once in Execute Deferred? There is custom action 19, but supposedly doesn't work in deferred mode.

A: Thats correct, type 19 custom actions are currently immediate-only custom actions. Since action conditions are evaluated in the immediate phase (even for deferred actions), a deferred type 19 custom action would always fail and trigger a rollback. (Why not fail earlier rather than later is the logic). To fail from a deferred custom action based on logic in the custom action, return a failure code or user-cancel code from the custom action, as documented in the MSI documentation ("Custom Action Return Values") You can also post more verbose messages from using the MsiProcessMessage API.

Host: Carolyn (Microsoft)
Q: If a MSI file comes without directions on creating MST or modifications to the install, such as settings, how might you create one?

A: For those products that do come with directions, I would highly suggest that you follow them since that is generally the only supported method. (For example, Office requires usage of the Office Customization and Installation Wizard for support of transforms.) Outside of that, you can configure feature states and property values with a MST. The latest version of Orca provides you with the ability to create a transform. Additionally, there are admin-specific tools provided by InstallShield, Wise and others for generating transforms. https://www.installsite.org has a good overview of available authoring tools and features. You might also want to check out https://www.appdeploy.com for more admin oriented tools

Host: Chris (Microsoft)
Q: I launch a program in the Uninstall Event of the Cusotm Actions, is there a variable I can pass to let it know that it is actually upgrading a previous version instead of unistalling - my uninstall action script is running everytime I upgrade

A: The UPGRADINGPRODUCTCODE property is set to the product code of the new version.

Host: YuanQing (Microsoft)
Q: Ok, I’m a complete beginner at creating windows installers. When I create a new version of an application and create an installer for it I want the installer to detect the older version and replace it with the new version. However i get an error message that says that I have to uninstall the old version in control panel first. How do I get round this? Is there any way to automate this uninstall / reinstall process?

A: You can author your package to include following actions: FindRelatedProducts, MigrateFeatureStates and RemoveExistingProducts. You also need to author "Upgrade" table to include the products that you want to remove.

Host: Carolyn (Microsoft)
Q: Why was MsiSpy removed from the SDK?

A: There were several problems with maintaining MsiSpy and some issues with how well it worked. Therefore the tool was removed from the SDK. A "resurrection" of MsiSpy is under consideration for a future version of the SDK. Note that MsiSpy used the standard MSI API set, so it would be possible to develop your own custom version of the tool.

Moderator: Eric (Microsoft)
Q: Is the SDK Documentation not going to be in .chm format anymore?

A: I believe the Windows SDK folks have made a permanent move to the latest help engine and won't be going back to the older .chm format, but I'd have to verify with the SDK team for a definitive answer. However I very seriously doubt they will go *back* to the old format, though, which requires different authoring tools, build process, etc.

Host: Chris (Microsoft)
Q: Will future versions of the installer be more forgiving of some issues when patching or offer some sort of override function?

A: We are working on making some improvements for patching in the next version of MSI, but there are not really any details available at this time. Look for more information soon.

Host: Om (Microsoft)
Q: When is the next version of MSI due? which will include multiple patch support; patch uninstall

A: MSI30 will include support for applying multiple patches and patch uninstall among other features. The MSI30 release will ship in first quarter of 2004

Host: Chris (Microsoft)
Q: If we are rolling out XP machines in a Win2000 AD network, is it more benificial to use RIS images and then send install MSI's or RIPrep images with software already installed? If we send updates to those imaged apps what happens?

A: Your biggest concern with using pre app-installed RIS images is going to be in source management. Because MSI mantains a set of sources for each product, those sources are incorporated into the RIS image and targeted at every machine. This may cause difficulty in source management. Not being an expert in AD, I can't provide definitive answers about issues there, but there could also be problems with "pulling into management" an existing product when the machine is then joined to AD.

Host: Carolyn (Microsoft)
Q: when uninstalling how can you recursively remove files and directories where the subdirectories and files were not created by the installer and we don't know what they are called?

A: You should be able to accomplish this with authoring of the RemoveFile table, which also allows for the use of wildcard specifications. Just be sure to set the InstallMode to msidbRemoveFileInstallModeOnRemove so that the file is removed when the component to which it belongs to becomes absent. You can also dynamically populate this table with a custom action that runs during uninstall as well.

Host: Om (Microsoft)
Q: Om -- is there a Beta planned?

A: MSI30 Beta1 is planned for summer 2003. Additional details and participation guidelines for the Beta program will be posted in the MSI newsgroup. Stay tuned and we will post links to the MSI newsgroups at the end of the chat

Host: Chris (Microsoft)
Q: When the "My Documents" location is redirected to a mapped drive letter that is currently disconnected, the msi install will fail. Is there a way to prevent this?

A: First troubleshooting suggestion would be to check your directory table to verify that you don't have the MyDocumentsFolder or anything under the MyDocumentsFolder (such as MyPictures) in your directory table. This will cause MSI to try to determine the properties of the folder, which will require access to the folder.

Host: Carolyn (Microsoft)
Q: LockPermissions don't inherit correctly in the Registry. Currently the practice is to have an entry per subkey, which can get quite messy. Are there any tools or other methods Recommended to resolve this issue?

A: Unfortunately, the LockPermissions table is quite limited in what can be accomplished with it. Improved support for the LockPermissions table is under consideration in a future version of the Installer. If you are unable to get the behavior you desire, you could also use custom actions. I would recommend a data driven approach where one custom action reads a custom table in your MSI and then creates the appropriate deferred-execution and rollback custom actions. There is a similar example of this in the Windows Installer SDK (see the custom action documentation for creating user accounts on the local computer)

Host: Chris (Microsoft)
Q: How can I create exclusive features?

A: MSI does not have native support for exclusive features, however you can implement this functionality by using the Feature state APIs from a custom action (DLL or VBScript)

Host: Carolyn (Microsoft)
Q: If I do a nested install of msi files the daughter msi willn't show up in Add/Remove even if I set ARPSYSTEMCOMPONENT to 1. Is this correct?

A: Yes, ARPSYSTEMCOMPONENT in the "daughter" msi would prevent it from showing up in Add/Remove programs. You should also be aware of the limitations of using nested installations -- particularly with respect to being able to service them.

Host: Carolyn (Microsoft)
Q: I have component X for feature A. A is installed but the condition for X is false so X is not enabled. Still MSI caches the icons for X in the guid folder and on uninstall those icons are not removed.

A: This is a known issue with the current version of Windows Installer.

Host: Chris (Microsoft)
Q: Users without administration privaleges can't use my installer. Is there any way round this?

A: That depends on what is enforcing the restriction. If you have a launch condition set to check the "AdminUser" property, then using the "Privileged" property will allow your app to install when the app is blessed by an administrator through deployment, even if the user is not an Admin. If the install is being blocked by MSI policy, then the MSI policies can be configured on the machine to meet the security behavior desired by the admin, which may or may not allow your app to install. If you are looking for a way for your application to be installable by non-admin users even without deployment, then the app must only write to locations where the user has access to make modifications. There is no way for an app to "elevate itself" to have rights beyond what the user normally has.

Host: Carolyn (Microsoft)
Q: If you set a Property (PUBLIC or Private) at install time, it's not cached in the local MSI. When a repair is triggered, the default value from the Property table replaces the one set dynamically, losing your changes. Is there a workaround for this?

A: If you need the values to persist, then you'll need to use the registry to store the values and AppSearch to look for them. The values of properties in the installation are not persisted. You should think of these as local variables. They are only going to be available for the lifetime of the install transaction.

Host: Carolyn (Microsoft)
Q: Here is a stupid question, what is Windows Installer compared to an application such as Wininstall? Do they do the same thing?

A: WinInstall isn't an application per se. It's really what we call a repackager. Windows Installer is a system service responsible for installing applications on the machine. WinInstall can be used to generate .MSI packages that the Windows Installer will install.

Host: YuanQing (Microsoft)
Q: Will future versions of MSI allow for uninstalling a patch?

A: Yes, next version of MSI 3.0 will support patch uninstall

Host: Carolyn (Microsoft)
Q: I have an MSI friend who wants to create a folder during installation, but mark it as hidden. Is it possible?

A: Yes, it is possible. Natively with the installer you can create a folder. However, there currently is no native support for setting attributes. You can add a custom action that will set the attributes (including hidden) for the folder.

Host: Chris (Microsoft)
Q: Sometimes on uninstall the cached .msi is not removed because msiexec keeps a handle open on it. I saw this using the procexp tool. How to determine what custom action or process is causing this?

A: This is a difficult thing to determine because there are many possible reasons for the file remaining. The easiest one to detect is when a custom action has a handle open. This can usually be detected by looking for message 2769 in the log file, which will indicate which custom action has MSIHANDLEs open at the time they are closed. Unfortunately, if the reason that the file can't be deleted is due to some transient issue such as a virus-scanner checking the file, then it is difficult to determine the source of the problem.

Host: Carolyn (Microsoft)
Q: Is there a way to write to each user's HKCU hive during a silent install?

A: This is a non-trivial problem. There is no current solution in MSI but it is something that is under consideration in a future version (TBD). There are a number of difficulties especially when having to deal with roaming user profiles and the availability of other user profile data.

Host: Chris (Microsoft)
Q: Sorry to be sarcastic, but when would all the native support be available? It seems that most of the common tasks are not included with MSI.

A: Different users have different views of what "common tasks" are for their installer. (To use an example from this chat, many applications do not need to create hidden folders, but do need to configure a SQL server). MSI is constantly adding support for new functionality, but it is impossible to say when any specific new behavior will be added. The Custom Action support in MSI was added to handle cases where applications need to perform actions that MSI does not support natively.

Host: Carolyn (Microsoft)
Q: What is the best way to do a nested install and have the daughter show up in Add/Remove

A: You don't want the nested install to show up in Add/Remove programs because it cannot be managed independently of the parent installation. All operations on the nested installation must happen within the context of the parent install. If you want the installation to be independent, then you should use a bootstrapper to install your packages (one after the other).

Host: Carolyn (Microsoft)
Q: Does MSI work for the Pocket PC?

A: No, MSI does not work on Pocket PC.

Host: Chris (Microsoft)
Q: Is it possible to replace a variable placeholder in a text file located in the msi database before installing the text file? Ex: replace all text instances of "%MyVar%" with the value of property [MyProperty]?

A: Not directly, however the MsiFormatRecord API can be used to format arbitrary strings using the standard MSI text substitution rules (including substition of component paths, etc). You could use this to format the text after the install.

Host: Carolyn (Microsoft)
Q: I have a product A and a SP a. When A is install from the local CD and then the SP a is installed again from the local CD ,The SP ask foe the original CD with product A, When do so [insert CD of product A into the local CD] the installation ask for the for the SP CD and the fail to continue

A: Is your service pack distributed as a MSP or MSI? Also what version of the Windows Installer are you using? There were some issues with CD handling that were fixed in Windows Installer 2.0. Additionally, Windows Installer 2.0 minimized the number of cases where the Installer would need access for the original source during the application of the patch.

Host: Chris (Microsoft)
Q: Is it possible to convert API handle to Automation Session? Vice Versa?

A: Unfortunately, this is not possible.

Host: Om (Microsoft)
Q: Thanks for the answer on nested installs but what's a bootstrapper?

A: A bootstrapper can be used to consolidate the install of muliple MSIs. You can review the .Net framework bootstrapper example for additional informationMicrosoft .NET Framework Setup.exe Bootstrapper Sample https://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/830/msdncompositedoc.xml

Host: Chris (Microsoft)
Q: Using an SQL statement in VBS like : "SELECT Key FROM Registry WHERE Root='1'" fails. Whenever you reference the "Key" column in an SQL query it fails. I can work around, but find the behaviour strange?

A: The problem is that the word "Key" is a SQL keyword. (CREATE TABLE .... PRIMARY KEY") To use KEY (or any other SQL keyword) as a literal string, enclose it in single quotes. To use a keyword as a column or table name in a query, enclose it in grave accent marks (sometimes called back ticks).

Host: YuanQing (Microsoft)
Q: Is there a way to have a patch and a full install in the same file, and have the file decide which is needed? uninstall of a previous version will be a problem because of error in old msi (oops)

A: You can create a setup.exe that will detect whether an older version of application is installed and make decision whether to install or patch.

Host: Carolyn (Microsoft)
Q: Planning to add support for dotnexfx.exe download to MsiStuff?

A: Interesting request. I'll add it to the list. I believe that the bootstrapper provided with Visual Studio Installer in Visual Studio .NET has this ability already (documentation for accomplishing this can be found on MSDN). The source code for the web download bootstrapper provided in the Windows Installer SDK is also provided, so it's possible that this could be added by you as well.

Host: Chris (Microsoft)
Q: Can MSI's created for WIndows XP Pro be used on XP Pro Tablet edition unchanged?

A: I am not aware of any problems running MSIs on Table Edition. However MSI does not natively expose (through a property, etc) the fact that it is a tablet edition of the OS. If you need to detect that, you would need to perform the logic in a custom action (and then perhaps set a property which can be used in a launch condition or to conditionally install components).

Host: Carolyn (Microsoft)
Q: The SP is distributed as an msp file, I have used for both the main version and the SP WI 2.0

A: Okay, and based on your original description the MSP file is distributed on CD -- correct? This sounds like something that may have been fixed in Windows XP SP1. Unfortunately I can't confirm that this was the problem with only this amount of information. You may consider following up in the microsoft.public.platformsdk.msi newsgroup where you can provide more details of the problem.

Host: Chris (Microsoft)
Q: Does MS have plans for a general purpose Windows Installer diagnostic utility?

A: In the SDK there is a tool which is helpful in analyzing log files to detect failure cases (WiLogUtl). It can read the log file, assign various log entries to each process, track component states, and detect common failures. Beyond that, Microsoft does not provide any troubleshooting tools.

Host: Carolyn (Microsoft)
Q: Why aren't the patchpackage and other patch tables populated after patching an admin image? or are we authoring something wrong?

A: No, you aren't doing anything wrong. That behavior is expected. A patch consists of at a minimum, one set of transforms. Each set contains two transforms. One transform is the database authoring transform (the delta between your target and update .msi) and the other transform is the patch-specific transform (containing the PatchPackage, Patch, and Media tables wiring). When patching an administrative image, only the database authoring transform is persisted to the package. Thus, the PatchPackage and Patch tables won't be changed. Those tables aren't needed in the admin image since the application of the patch updates all of the files in the admin image itself.

Moderator: Eric (Microsoft)
Thanks for joining us today and thanks for the questions. It's time for us to go now. If we couldn't get to your question, please post it in one of the following newsgroups: news://msnews.microsoft.com/microsoft.public.platformsdk.msi for developer questions

news://msnews.microsoft.com/microsoft.public.windows.msi for end-user/administrator questions

For further information on this topic please visit the following:

For further information on this topic please visit the following:

Newsgroups: microsoft.public.platformsdk.msi

MSI Transcripts: Read the archive of past MSI chats.

Website: Visit the Microsoft Windows Installer site.

Top of pageTop of page