Prevent installation if reboot not performed


1 comment

  • Avatar

    Currently no flag is set by the installer that a reboot is required.

    InstallBuilder stores data in PendingFileRenameOperations key in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager to set files to be deleted. Those keys are read at Windows boot time to delete the files and removed.

    You can check for existence of this registry key, however, it may be there in other cases as well - so it may be used as a warning at most, and may trigger the warning even if uninstaller for your application was not run.

    Usually locked files remain if uninstallation was performed while application was running. It may be a better idea to perform a check if the application is running by doing:

    <preUninstallationActionList> <showWarning> <ruleEvaluationLogic>or</ruleEvaluationLogic> <text>Please stop ${project.shortName} before proceeding with the uninstallation.</text> <ruleList> <fileIsLocked> <path>${installdir}/myapp.exe</path> </fileIsLocked> <fileIsLocked> <path>${installdir}/service.exe</path> </fileIsLocked> </ruleList> </showWarning> </preUninstallationActionList>

    You can also ask the user if he/she wants to continue with the uninstallation by using <showQuestion> action.

Please sign in to leave a comment.