none
How to simulate (or force) restart required error (3010) when running setup for SQL Server Express

    Question

  • I'm writing an installer that runs (if needed) setup for SQL Server Express.  I want to make sure that my installer responds to this error appropriately.  What is the best way simulate (or force) this error to test that my installer responds correctly?
    Monday, January 28, 2019 4:27 PM

All replies

  • Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager.  Add a key for PendingFileRenameOperations.
    • Proposed as answer by Av111 Monday, January 28, 2019 6:13 PM
    Monday, January 28, 2019 4:54 PM
  • Could you be a little more explicit?  I'm not used to working with the Windows Registry.  I tried using MoveFile to schedule a text file for delete on reboot while I ran setup with the following command:

    "setup.exe /qs /ACTION=Install /INSTANCENAME=SQLEXPRESS  /IACCEPTSQLSERVERLICENSETERMS"

    It ran without any errors.

    Tuesday, February 5, 2019 12:32 AM
  • Good day bjasperson,

    As I understand it, This question is not related to SQL Server but to the developing of the installer.

    There is a property "REBOOT" which you can use when you develop you installer or you can use ORCA tool and add the ScheduleReboot to the msi. Please check if the bellow links help you solve the issue. If not, then I recommend to take the question to developing forums according the language and technologies which you use for the developing of the installer

    https://docs.microsoft.com/en-us/windows/desktop/msi/reboot

    https://social.msdn.microsoft.com/Forums/en-US/76b10777-0cf4-4043-b3aa-5d0d1ba16d1b/msi-installer-reboot-custom-action?forum=winformssetup

    https://stackoverflow.com/questions/1178327/force-reboot-from-custom-action-in-msi-in-c-sharp


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]

    Tuesday, February 5, 2019 2:42 AM
    Moderator
  • Thank you, but my question is not how to schedule a reboot.  My question is about how to get the SQL Server installer to return with error 3010 (reboot required).  I want to make sure that my installer prompts the user to reboot if and only if I get that error.  In order to test my program, I want to force the SQL Server installer to return with that error.  It seems that Hilary Cotter has the solution I need, but for some reason I'm not getting their solution to work.
    Monday, February 11, 2019 7:19 PM
  • If you programmatically look for this registry key and see the PendingFileRenameOperations key your install program should then prompt the user to manually restart the machine, or force a restart after X seconds. Otherwise the install can continue.

    The ExitWindowsEx Function will do the restart.

    https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-exitwindowsex

    Monday, February 11, 2019 7:30 PM
  • Thank you, but my question is not how to schedule a reboot.  My question is about how to get the SQL Server installer to return with error 3010 (reboot required).  I want to make sure that my installer prompts the user to reboot if and only if I get that error.  In order to test my program, I want to force the SQL Server installer to return with that error.  It seems that Hilary Cotter has the solution I need, but for some reason I'm not getting their solution to work.

    Hi,

    >> My question is about how to get the SQL Server installer to return with error 3010 (reboot required). 

    This is not something that is in the SQL Server scope, but in the installer side, and the installer is an application which you develop => This is done in the application scope and you control the application not using SQL Server but using code in C#for example, which is why this will fits for forums that deal with developing the application (the installer) and not for forums that deal with SQL Server scope issue/question

    * If you have a question related to "how to cook a cake", will you asked a cook or a farmer? The Farmer familiar with the eggs but not with how to use the eggs for a cake. SQL Server experts  familiar with the SQL Server but not necessarily with developing the installer app. In the developers forums people familiar with the developing of the installer


    signature   Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]    [Linkedin]


    Monday, February 11, 2019 11:34 PM
    Moderator