msi + wmi and "Reboot" process

Jul 26, 2016 at 10:56 AM
Edited Jul 26, 2016 at 10:59 AM

I am trying to use the msi file along with the WMI system.
Using the Win32_Product class and the "Install" method of the WMI we able to install the msi file anywhere into network. The "Install" method works well.

In case of using the "Reinstall" method with the msi file I have got the problem/feature....
After reinstallation process the target machine goes to reboot. It not good in my case at all.

Do I have any way to prevent the rebooting of the machine during the reinslattation?
May be you can suggest any properties into your library to forbid the reboot?
Jul 26, 2016 at 12:05 PM
Edited Jul 26, 2016 at 1:00 PM
I have used the property REBOOT:
ManagedProject project = new ManagedProject("TestMsiAgent",
                        new Property("REBOOT", "ReallySuppress") {IsDeferred = true},
and it seems to work!

Is the property REBOOT=ReallySuppress solves the problem with rebooting the target machine?
Jul 27, 2016 at 3:18 AM
Edited Jul 27, 2016 at 3:18 AM
I am glad you solved it but the mystery remains. Why did it reboot? Wix# doesn't provide and direct facility for rebooting. May be it even should... but it doesn't. So you couldn't do it by accident. After some googling I got an impression that the nature of the install may trigger it (e.g. installing drivers). Also it is evident that "...the installer automatically prompts for a restart if it needs to replace any files in use during the installation." and upgrade falls under this very scenario.

I would like to incorporate your work around into the codebase. Can you please tell me if making IsDeferred was required for your case. MSI documentation doesn't say anything about it but may be it doesn't work otherwise.