1

I have an installer written in Wix which sometimes prompts the user to reboot after repair. How can this occur and how to remove this behavior?

1

3 Answers 3

3

Two techniques:

1) Identify the cause of the reboot and avoid it. ( Examples: stop service, kill process )

2) Suppress reboot using the REBOOT property. Note repair may not be effective until after the reboot.

1 is usually the best way to go.

6
  • What can cause the reboot?
    – Brainless
    Jul 15, 2015 at 14:48
  • Typically a locked file hence why stopping processes that might have file locks. Jul 16, 2015 at 1:43
  • Why the repair may not be effective until after the reboot? My installer only deploys some files and write registry keys. In that case is it safe to use the REBOOT property?
    – Brainless
    Jul 16, 2015 at 2:35
  • 1
    If the installer needed to repair a locked file and the old file was wrong and the new file is correct then the new file won't be available until after the reboot. I suggest reading up on the Win32 MoveFile function and the PendingFileRenameOperations pattern. Jul 16, 2015 at 2:43
  • 1
    Realize that MSI is declarative. They abstract what needs to be done from how it gets done. The latter is very seldom documented as you don't need to know. Presumably the InstallFiles and MoveFiles standard actions use MoveFileEx with the MOVEFILE_DELAY_UNTIL_REBOOT argument. You can search StackOverflow for those two words to see how frequently it comes up. Jul 16, 2015 at 11:52
2

The most common reason for a reboot after repairs is a file was accessed by the installer that the application still had a lock on. This is usually identifiable in the repair logs (sometimes it takes a bit of looking to find the file the installer had trouble with). If you are unable to find the information you need in your logs, post them here and we will take a look at them with you.

2
1

Add this property somewhere relevant in your WXS file, and make sure nothing is overriding the value to something else. This will cause the reboot prompt to not occur and not have the reboot occur even if it was detected as necessary when running silently, as silent reboot prompts will automatically trigger the reboot sequence when you don't set this property's value to "ReallySuppress".

<Property Id="REBOOT" Value="ReallySuppress" />

You can read up on it here if you like: https://msdn.microsoft.com/en-us/library/windows/desktop/aa371101

1
  • 1
    >> Add this property somewhere relevant in your WXS file << I found that I needed to define this property as a child element of Product, after the Package element had been defined. Apr 6, 2018 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.