Replies: 1 comment
-
You can use the
We've had bad experiences with this approach though, where a reboot is almost always pending. Most probably false positives. This might be related to a change in functionality in Wix 4. I don't understand what they mean here:
https://wixtoolset.org/docs/fourthree/faqs/#timing-changes-for-detection |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a Custom BA that creates my software's MSI, a custom Burn UI, and a bootstrapper that bundles a few prerequisites for my software. I have some users having issues when installing with my installer. Their issue seems to be that their machine needs to be restarted before running the installer. After they restart their machine, that seems to resolve their issues. Not a common issue, but I would still like to resolve this. I have not found much straightforward information online about how to resolve this. I have this following code in my Custom BA:
private bool IsRebootRequired()
{
// Check Pending File Rename Operations
using (var sessionManager = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Session Manager"))
{
if (sessionManager != null && sessionManager.GetValue("PendingFileRenameOperations") != null)
{
return true;
}
}
}
I then use this method first thing in the "Run" method:
// Check for pending reboot
if (IsRebootRequired())
{
this.Engine.Log(LogLevel.Error, "A pending reboot has been detected. Installation cannot proceed.");
System.Windows.MessageBox.Show(
"A system reboot is required before running this installation. Please restart your computer and try again.",
"Restart Required",
System.Windows.MessageBoxButton.OK,
System.Windows.MessageBoxImage.Warning);
There seems to always be some internet files or other values in the PendingFileRenameOperations that do not matter. Does anyone have a solution for this? Not sure how other installers check if the machine needs a restart before installing. I am somewhat new to the WiX community so any resources or direction would be greatly appreciated
Beta Was this translation helpful? Give feedback.
All reactions