-
QuestionI built an installer which installs and starts a service. Everything installs fine. When I attempt an uninstall and look in the log, the InstallValidate step reports files in use as they are still being used by the service when the uninstall is launched. This triggers the reboot popup. It seems InstallValidate occurs before InstallInitialize and since service manipulation requires elevated privileges, the service can't be stopped before InstallInitialize. By the time the uninstall gets to the RemoveFiles step, the service has been stopped and deleted. I do not see any errors in the log during this step so I think the files were deleted successfully. I know I can suppress the reboot prompt and hope that everything else is ok but that could hide other problems. Is there a solution whereby the service is stopped and deleted before the validation of files occurs? It would appear that file validation needs to happen in the deferred stage (after InstallInitialize) and be scheduled after service stop and deletion. Note: This also applies to the uninstall phase of a major upgrade which is more problematic as the user intends to continue using the product. I tried the solution mentioned here (#4917) of having separate ServiceControl elements and reversing the order but that didn't work. I don't understand how it could if indeed the steps are ordered the way I see them. Open Source Maintenance Fee
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Off the top of my head, I thought the Windows Installer's use of the Restart Manager tackled this problem. Are you suppressing any of the restart functionality in your package? |
Beta Was this translation helpful? Give feedback.
I am just recently noticing your response. I wanted to do some testing without any changes to the REBOOT or MSIRESTARTMANAGERCONTROL properties to confirm the actual behavior before responding.
It turns out that it is not the service that is triggering the reboot required popup but rather a process that is started by the service. This makes sense as the installer would not be aware of that process.
When the service is stopped, this causes the process to also stop so eventual file removal is successful.
I think I'll just have to suppress the popup.
Thanks for pointing me in the right direction.