Hey Alain,

Take a look at my answer to this problem on stackoverflow -
http://stackoverflow.com/questions/6913332/wix-installer-problem-why-does-restartmanager-mark-service-as-rmcritical-and-no/8147540#8147540

Basically, you can 'lie' about the custom action and mark it as
immediate instead of deferred.  The drawback is that if your install
fails and rollsback, the service you've shut down will still be shut
down.  Up to you whether or not that's an appropriate risk for your
product.

- Joel

On Sat, Jun 15, 2013 at 11:11 AM, Alain Forget <afor...@cmu.edu> wrote:
> I'm still wrestling with this request to restart on uninstall. To recap, I 
> have an MSI that when I install it, and then try to uninstall it, it usually 
> tells the user that some of the files to be uninstalled are in use and will 
> require a reboot. However, this should not be, because the services that are 
> using the files will stop immediately upon request.
>
> The problem seems to be that the installer is making the determination that 
> the files are in use before even trying to stop services. Looking at the 
> uninstall log, during FileCost, the installer determines that multiple 
> "folder had been blocked by the 1 mask argument (the folder pair's 
> iSwapAttrib member = 0)", which I think means it's in use? Furthermore, at 
> InstallValidate, "RESTART MANAGER: Did detect that a critical application 
> holds file[s] in use, so a reboot will be necessary." Note that both 
> InstallValidate and FileCost come before StopServices (see 
> http://msdn.microsoft.com/en-us/library/aa372038).
>
> It had been suggested that I should stop the services myself with "net stop". 
> So I attempted to do so with this in my .wxs:
>
> <!-- Silently stop my services (with elevated privileges; Execute="deferred", 
> see http://wix.sourceforge.net/manual-wix3/qtexec.htm ) -->
> <CustomAction Id="Set_cmdStopMyService" 
> Property="cmdStopClientCommModuleService" Value="net stop [#myService]" />
> <CustomAction Id="cmdStopMyService" Execute="deferred" BinaryKey="WixCA" 
> DllEntry="CAQuietExec" Return="check" Impersonate="no" />
>
> <InstallExecuteSequence>
>         <Custom Action="Set_cmdStopMyService" Before="CostInitialize" 
> ></Custom>
>         <Custom Action="cmdStopMyService" Before="CostInitialize" ></Custom>
> </InstallExecuteSequence>
>
> However, candle / light don't allow it:
>
> error LGHT0204 : ICE77: cmdStopMyService is a in-script custom action.  It 
> must be sequenced in between the InstallInitialize action and the 
> InstallFinalize action in the InstallExecuteSequence table
>
> Following Light's recommendation wouldn't solve my problem, because 
> InstallInitialze happens long after the uninstaller has decided that the 
> files are in use.
>
> So I'm completely stumped and would appreciate some suggestions.
>
> Alain
>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to