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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With