From bb3dfbe95e62865895cf84dc3f1de016787a9299 Mon Sep 17 00:00:00 2001 From: Mark Young Date: Tue, 2 Feb 2016 10:56:42 -0700 Subject: windowssdk: Handle silent installer/uninstaller message boxes appropriately. If Silent Install or Uninstall is enabled, we want all the message boxes we have control over to automatically make a selection. In addition, return an error if we are supposed to reboot, and the silent install doesn't show the message for the user to choose. --- windowsRuntimeInstaller/InstallerRT.nsi | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/windowsRuntimeInstaller/InstallerRT.nsi b/windowsRuntimeInstaller/InstallerRT.nsi index 4a94f087..edea8b6a 100644 --- a/windowsRuntimeInstaller/InstallerRT.nsi +++ b/windowsRuntimeInstaller/InstallerRT.nsi @@ -435,10 +435,15 @@ Section "uninstall" Call un.DeleteDirIfEmpty # If any of the remove commands failed, request a reboot - IfSilent noreboot - IfRebootFlag 0 noreboot - MessageBox MB_YESNO "A reboot is required to finish the uninstall. Do you wish to reboot now?" IDNO noreboot - Reboot + IfRebootFlag 0 noreboot + MessageBox MB_YESNO "A reboot is required to finish the uninstall. Do you wish to reboot now?" /SD IDNO IDNO returnerror + Reboot + + returnerror: + + # Set an error message to output because we should reboot but didn't (whether because silent uninstall or user choice) + SetErrorLevel 3 # ERROR_TOO_MANY_OPEN_FILES + noreboot: ${Endif} @@ -480,7 +485,7 @@ FunctionEnd Function UninstallIfError ${If} ${Errors} # IHV's using this install may want no message box. - MessageBox MB_OK|MB_ICONSTOP "${errorMessage1}${errorMessage2}" + MessageBox MB_OK|MB_ICONSTOP "${errorMessage1}${errorMessage2}" /SD IDOK # Copy the uninstaller to a temp folder of our own creation so we can completely # delete the old contents. -- cgit v1.2.3