views:

218

answers:

3

I have a WiX based MSI that installs a service and some shortcuts (and lots of other files that don't).

The shortcut is created as described in the WiX docs with a registry key under HKCU as the key file. This is an all users install, but to get past ICE38, this registry key has to be under the current user.

When the service starts (it runs under the SYSTEM account) it notices that that registry key isn't valid (at least of that user) and runs the install again to "repair".

In the Event Log I get MsiInstaller Events 1001 and 1004 showing that "The resource 'HKEY_CURRENT_USER\SOFTWARE\MyInstaller\Foo' does not exist." This isn't surprising since the SYSTEM user wouldn't have this key.

I turned on system wide MSI logging and the auto-repair created its log file in the C:\Windows\Temp folder rather than a specific user's TEMP folder which seems to imply the current user was SYSTEM (plus the log file shows the "Calling process" to be my service).

Is there something I can do to disable the auto-repair functionality? Am I doing something wrong or breaking some MSI rule? Any hints on where to look next?

A: 

Split the components out into seperate features. By putting the service in it's own feature it won't do a scan for the other components.

Christopher Painter
A: 

If you use an advertised shortcut you don't need the HKCU registry entry.

sascha
This may sound odd, but where I work we actually don't like advertisement / repair. Our software is deployed in environments where although we cache the software, the customer does not like to see repairs, period.
Christopher Painter
A: 

To avoid the auto-repair you are seeing but still have the same effect, you could use ActiveSetup, which is a dead simple system that ensures each user has a program--usually a configuration program or script that configures the HKCU Registry settings--run exactly once.

(The first article linked above, something I wrote several years ago, compares the different methods, and if you didn't guess already, favors ActiveSetup...)

ewall

related questions