Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reference the Reboot Pending Property in Burn (WiX)

How do I reference the RebootPending property in a Burn (WiX) bootstrapper? I know the property name is RebootPending, which is actually referencing the MsiSystemRebootPending property in Windows Installer.

I'm currently trying something like this:

<bal:Condition Message="There is a restart pending. Please restart your computer before  attempting to install !(loc.ProductName).">RebootPending = 0</bal:Condition>

But it's always true, even when Windows Update has just finished an update and needs to restart.

Is my syntax wrong? Should my condition have [RebootPending] instead?

Having been informed that the RebootPending property inside Burn may not correspond exactly to the property that Windows Installer uses, how else would I ensure that my application does not attempt to install when a reboot is pending?

like image 272
Jason Kulatunga Avatar asked Jun 04 '12 00:06

Jason Kulatunga


2 Answers

Burn doesn't use MSI's MsiSystemRebootPending because it operates outside an installation transaction. So Burn uses ISystemInformation::RebootRequired instead. There's no guarantee that MSI and ISystemInformation::RebootRequired have the same idea about whether a reboot is required, since MSI doesn't document with MsiSystemRebootPending reflects.

like image 93
Bob Arnson Avatar answered Oct 02 '22 16:10

Bob Arnson


For some general ideas see tool WhyReboot. Here is what it does:

Examines documented registry locations for post-reboot file copy/rename/delete operations.

Examines documented registy locations for "Run Once" applications: these will run once on the next reboot, and are probably used by an installer to perform post-reboot file cleanup and other operations such as registry manipulation.

Examines Wininit.ini on Win9x/ME platforms for pending file rename/delete operations.

like image 22
Jacob Seleznev Avatar answered Oct 02 '22 14:10

Jacob Seleznev