Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
928 views
in Technique[技术] by (71.8m points)

windows installer - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...