This is how I have configured it, and even so: sometimes this happens.
I've tried to create the service on my own, and now when I upgrade, the Installer pops up a warning saying that my service is running and holding files ("file in use" dialog).
I tried stopping the service at various places/customAction locations, and the best place I could find that wouldn't cause this dialog window to open was in custom action "CostFinalize" and maybe it could be a bit after, but for sure it didn't work for me if I tried to stop the service from "InstallValidate" and downwards: because at validate install, it would tell me that the file is in use.
Please take a look at the log (my service name is: "Observer Indexer"):
Code: Select all
MSI (s) (84:74) [05:30:26:674]: RESTART MANAGER: Detected that application with id 2284, friendly name 'Observer Indexer', service short name 'Observer Indexer', of type RmService and status 1 holds file[s] in use.
MSI (s) (84:74) [05:30:26:674]: Note: 1: 2205 2: 3: ServiceControl
MSI (s) (84:74) [05:30:26:674]: Note: 1: 2228 2: 3: ServiceControl 4: SELECT `Name`,`Wait`,`Arguments`,`Event`, `Action` FROM `ServiceControl`, `Component` WHERE `Component_` = `Component` AND (`Action` = 0 OR `Action` = 1 OR `Action` = 2)
MSI (c) (C8:C4) [05:30:26:721]: RESTART MANAGER: Session opened.
MSI (c) (C8:C4) [05:30:26:721]: RESTART MANAGER: Detected that application with id 2284, friendly name 'Observer Indexer', service short name 'Observer Indexer', of type RmService and status 1 holds file[s] in use.
MSI (c) (C8:C4) [05:30:26:721]: Note: 1: 2262 2: ListBox 3: -2147287038
Info 2826. Control Description on dialog MsiRMFilesInUse extends beyond the boundaries of the dialog to the right by 13 pixels.
Info 2826. Control BottomLine on dialog MsiRMFilesInUse extends beyond the boundaries of the dialog to the right by 3 pixels.
Info 2826. Control BannerLine on dialog MsiRMFilesInUse extends beyond the boundaries of the dialog to the right by 3 pixels.
Putting the custom action to stop the service before "InstallInitialze" forces me to use "Immediate" and not "deferred with no impersonation" (which I'm not sure will always work).
However, if the installer is configured to install the service: it does NOT popup a window that tells me that files are in use, but then I have this problem that it sometimes disables the service which later causes the installation to fail...
Also, putting the custom action of stopping the Service at "StopServices" custom action location - which would seem like the right place: will cause the installer to popup the "files in use" window (because like I mentioned: it must be done much before that - for some reason...).
This popup of "files in use" happens only during upgrades: it does not happen when first time installing the product.
So my question is: how come if I use the built-in AdvancedInstaller services: "files in use" window doesn't popup - although - the service is STILL running! (and will stop later of course) but when I try to manually stop the Service: I have to do it BEFORE InstallValidate...
Dashut.