Failing to start Windows service after a MajorUpgrade with WiX

Debugging Results: Following a lot of debugging (by original poster – OP) this turned out to be a known MSI issue described here:
https://wix-users.narkive.com/EMfQPDrM/a-bug-get-reg-sz-when-using-type-integer. Nice search work.

What is in a DWORD? (a REG_SZ apparently): Essentially MSI “converts” a DWORD value found via a RegistrySearch
operation to a formatted string – REG_SZ – during upgrade
installations (could be more involved too). This causes services that
expect a DWORD value to fall over on startup during major
upgrades. A very exotic error.

Workaround: One can try to “solve” this problem by making the service code capable of reading both DWORD and REG_SZ.
This yields a more robust solution than solving the problem in a
custom action since it is a “permanent” fix as long as the code is in
there (and the presence of the code alerts other developers about the
problem). Or maybe use only REG_SZ?


Quick Checks: Check the service password and login – obviously. Anything in the
Event Viewer? Windows Key + Tap R + eventvwr.msc + Enter. How to use the Event Viewer to troubleshoot problems with a Windows Service. Perhaps you can try to do a folder diff on the before and after folders and see if you see something unexpected in
the config files? Naturally there will be lots of binary
differences, but check the text files (also encoding). Check the MSI log file
again and search for "value 3" as described here: Tips For Checking MSI Log
Files
. Manually copy the new files in place and attempt to start the service via the services.msc applet.


Service Experts: Windows Services Frequently Asked Questions (FAQ). Content seems to be up to date – at face value at least.
These guys claim to be experts on services. I have no idea who they
are.

Look in the “Errors” section in the link above. Here are some
extracts:


Generic Check Lists: If none of the above does anything, maybe try these "torpedoes full spread" check-lists (just ideas to start debugging):


General Purpose Debugging: Throwing in some general-purpose debugging approaches.


Some Further Links:

Leave a Comment