WiX major upgrade doesn't complete installation until spawned

Go To StackoverFlow.com

1

I created an installer based upon the code I found here. If a previous version of the app exists, I want the installer to delete it before installing the new one.

If it's a clean install, everything goes well.

If it's an upgrade, a weird thing happens. As expected, the old version is removed, the registry is changed, and shortcuts are placed on the desktop. Oddly, the primary file doesn't exist in the application folder when the installer completes.

Upon launch after an upgrade, a small installer message box pops up and states "Please wait while Windows configures -app name-..". After this quick message, the file exists as it should in the app folder, and the app launches.

Prior to launch though, it's not there. I even tried a reboot before launching the app to see if that would place the file if it's stuck in a some kind of cache.

Anyone ever see this behavior? It's a bit like this questiom, but it happens on every upgrade.

2012-04-04 22:30
by Tony


1

Oddly, the primary file doesn't exist in the application folder when the installer completes.

This is a common problem with windows installer upgrades if components are not managed correctly. You'll typically see that the missing file re-appears if you launch the installer into maintenance mode from the control panel and do a "repair". In this case, windows repaired the application automatically when you launched it.

A few possible explanations of the top of my head:

  1. the new version of your installer installs this file in a component with a new GUID. This causes problems because Component GUIDs should remain stable.

  2. your installer installs multiple files per component. This causes problems because whether a component should be installed is determined by the keypath, and only one file can be the keypath. Stick to one file per component.

  3. The "new version" of the file actually has a lower version number. Such an "upgrade" doesn't work correctly.

2012-04-05 08:27
by Wim Coenen
Of your possible explanations, only the first fits my scenario. I'll see if I can find the original app's component GUID. If I can't, is there a way to force the file drop upon install - Tony 2012-04-05 15:11
@Tony: Not that I know. The problem is not so much that the file isn't installed, but that it is uninstalled when the old version of the product is removed at the end of the installation process. Changing the GUID messes up the component reference counting mechanism - Wim Coenen 2012-04-05 15:38
I tried reusing the old component GUID for the primary file, but the problem still exists. This time, the installer forced a reboot too. I did notice that the old installer had all of its files under that one component entry - Tony 2012-04-05 17:17
@Tony: the reboot means that the upgrade of some file was delayed because it was in use by a process. Are you installing a service which was still running when you tried to upgrade it - Wim Coenen 2012-04-05 22:26
No, there shouldn't be any processes affected. The new installer removes the old version's files (two Word docs and a shortcut to a web page) and installs a new Word doc (to replace the two older ones). The other things the new installer does is a) it adds the document's folder to the Office trust center's trusted locations and b) creates a shortcut to the Word doc on the desktop - Tony 2012-04-06 14:24
Ads