cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

Best practice for unfinished state after losing power?

I have a Basic MSI project and during the middle of the Execute phase of the installation, I lost power. I had already set some registry keys, and placed files in folders on the target system. However, the product wasn't registered with Windows (there is no key under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall), so Windows doesn't think the product is installed.

So when I try to uninstall through the MSI by running maintenance mode, it gets an error because Windows doesn't see it as installed. If I try to run the MSI again, it installs as if the product hadn't been installed.

Is there a best practice concerning what to do in these situations?
Labels (1)
0 Kudos
3 Replies
Cary_R
Level 11

Hi There,

It's unlikely that there's any such best practices to speak of. From what you describe, the machine could be in any number of states.

If you're just looking to recover this one machine, I'd recommend first checking into msizap.exe command line arguments to see if you can get it to clean up any registration data associated with that product code:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa370523(v=vs.85).aspx

Then, clearing out any files installed by the application, and removing any SharedDll counts:

http://blogs.flexerasoftware.com/installtalk/2010/11/cleaning-up-your-shared-dlls-registry-references-for-msis.html

And then attempting the install again.
0 Kudos
anom217
Level 8

Thanks. I'm aware of msizap and have used it before, but I need a solution that I could include in my MSI, to check if the machine is in an unstable state and then revert to a stable state.
0 Kudos
Cary_R
Level 11

Automating this sort of cleanup is dangerous, in my opinion. In part because the fix for the "unstable" state may differ fairly widely depending on the root cause.

The tack I would take is to detect the unstable state(s), and trigger an Error (Type 19) custom action that exits the install with an informational message instructing the user what to do, and where to go to find manual cleanup instructions.
0 Kudos