SQL Server 2016 SP2 Express - Pending Restart Problem - Advanced Installer Community
allan.tolentino
Posts: 2
Joined: Mon Dec 02, 2019 5:45 pm

SQL Server 2016 SP2 Express - Pending Restart Problem

Hi Everyone,

The installer that we created has a SQL Server 2016 SP2 Express as a prerequisite and is currently running into a problem in some machines due to a pending restart requirement. In order to mitigate the issue, we created a PowerShell Inline Script (CheckPendingReboot) that checks for values in the registry for any pending restarts and sets an AI property (REBOOT_FLAG_PROP) to true, otherwise false if no restart needed. If true, a dialog window will check the value of this property and a window will block the user from continuing with the installation until the machine has restarted. Please refer to the attached powershell script for reference
CheckPendingReboot.txt
(3.32 KiB) Downloaded 266 times

It has worked for most machines, however, we are puzzled as to why the custom action would not be triggered to some. I crosschecked the log files of two machines that both have pending restarts (machine A where the installer blocked the user and machine B that didn't); I noticed that the log file in machine B a line that the property has been set. These machines are running in Windows 10 OS. See below line missing from machine B

MSI (c) (34!8C) [18:04:40:333]: PROPERTY CHANGE: Modifying REBOOT_FLAG_PROP property. Its current value is '0'. Its new value: '1'.

Attached log files of the machines:
package_machines.zip
(2.04 KiB) Downloaded 255 times

Because of the property not being set correctly, the installation throws an error when it tries to install SQL Server due to the pending restart. Below is the log message by the SQL installer

One or more affected files have operations pending.
You should restart your computer to complete this process.


Error message thrown by the installer
Error.png
Error.png (4.22 KiB) Viewed 3081 times

So the real question would be: Are there any particular scenarios that the custom actions would not work or particular configurations that we might have missed? Do let me know if the info given above is lacks some details.

Regards,
Allan
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: SQL Server 2016 SP2 Express - Pending Restart Problem

Hello Allan and welcome to Advanced Installer forums,

I could notice, in your PowerShell script, that the condition of setting the property is: SQL not installed AND the result of your function.

I've had a look over your CheckPendingReboot function and I could notice the fact that you are verifying 3 registry entries.

Basically, here I think that the property is not set due to the conditions not being met. From my experience so far with this, I know that there might be more than 3 registry entries that need to be checked in order to detect if a reboot is pending or not. Basically, here I think that a reboot is pending, but it is not detected by your function, therefore the property is not set (on machine B).

For more information about the registry entries that can be checked to see whether a reboot is pending or not can be found in the following thread:

Pending reboot loop, unable to install

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
allan.tolentino
Posts: 2
Joined: Mon Dec 02, 2019 5:45 pm

Re: SQL Server 2016 SP2 Express - Pending Restart Problem

Hi Catalin,

I will check out the different registries mentioned in the linked post and get back to you with my feedback. Thank you very much for the response!

Regards,
Allan
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: SQL Server 2016 SP2 Express - Pending Restart Problem

You are always welcome, Allan.

Hope that helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”