[wix-users] custom windows service - disabling FilesInUse

Blair Murri osito at live.com
Mon Apr 1 01:11:18 PDT 2019


Windows Installer (aka MSI) filters the executables connected to the services it is managing, but knows nothing about executables who's lifetime is managed vía any other route (including custom actions). For those, you have two possible solutions: 1) use your own UI and filter them yourself in that UI, or 2) stop the services from a non-elevated custom action scheduled before costing (if your permissions or APIs somehow permit that).

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of David Bernhard via wix-users <wix-users at lists.wixtoolset.org>
Sent: Sunday, March 31, 2019 11:56:16 PM
To: WiX Toolset Users Mailing List
Cc: David Bernhard
Subject: Re: [wix-users] custom windows service - disabling FilesInUse

Sure.

Current code:
<CustomAction Id="InstallTS" BinaryKey="WixCA" DllEntry="CAQuietExec" Impersonate="no" Execute="deferred" Return="check"  />
<SetProperty Id="InstallTS" Value=""cmd" /V /C " "[INSTALLFOLDER]install/install.bat" [SERVICE_NAME]"" Sequence="execute" Before="InstallTS" />

<CustomAction Id="StopTS" BinaryKey="WixCA" DllEntry="CAQuietExec" Impersonate="no" Execute="deferred" Return="check" />
<SetProperty Id="StopTS" Value=""[INSTALLFOLDER]install/[PREVIOUS_PRUNSRV_NAME]" //SS//[PREVIOUS_SERVICE_NAME]" Sequence="execute" Before="StopTS" />

<CustomAction Id="UninstallTSProcrun" BinaryKey="WixCA" DllEntry="CAQuietExec" Impersonate="no" Execute="deferred" Return="check" />
<SetProperty Id="UninstallTSProcrun" Value=""[INSTALLFOLDER]install/[PREVIOUS_PRUNSRV_NAME]" //DS//[PREVIOUS_SERVICE_NAME]" Sequence="execute" Before="UninstallTSProcrun" />

<InstallExecuteSequence>
  <Custom Action="InstallTS" After="InstallFiles">NOT Installed</Custom>

  <!-- stop the service before uninstall-->
  <Custom Action="StopTS" After="InstallInitialize">Installed</Custom>

  <!-- uninstall after stopping the service -->
  <Custom Action="UninstallTSProcrun" After="StopTS">Installed</Custom>
</InstallExecuteSequence>

Tried with ServiceControl:
<Component Id="ServiceControl" Guid="{…}">
  <ServiceControl Id="WinService" Name="[SERVICE_NAME]" Stop="uninstall" />
</Component>

Tried to suppress InstallValidate
<InstallExecuteSequence>
  <InstallValidate Suppress="yes">1</InstallValidate>
</InstallExecuteSequence>
(Also tested with false condition)

And tried also with:
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
(and value “Disabled”)

I’m wondering how msi knows when updating a service (installed with ServiceInstall) that this service will get shut-down after “InstallValidate”.

Von: Adnan Shaheen [mailto:shaheen4qau at gmail.com]
Gesendet: Sonntag, 31. März 2019 16:39
An: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: David Bernhard <d.bernhard at wbi.at>
Betreff: Re: [wix-users] custom windows service - disabling FilesInUse

If you could paste the script related to service. Someone may be able to point you in the right direction.

Regards:
Adnan Shaheen.


On Sun, 31 Mar 2019 at 09:30, David Bernhard via wix-users <wix-users at lists.wixtoolset.org<mailto:wix-users at lists.wixtoolset.org>> wrote:
Hello wix-users,

I have an installer which installs a windows service (with apache prunsrv), so it's not installed by wix. And when I'm updating the application I'm always getting the "FilesInUse" dialog. Even though I'm stopping the service when uninstalling (but that's in a later sequence...).

To get rid of this dialog I tried several things.

*        Suppress the InstallValidate sequence

*        Use a ServiceControl to stop the service when uninstalling

*        Set MSIRESTARTMANAGERCONTROL to "Disable" (and "Disabled")

But none of them worked. Is the only solution to rebuild WixUIExtensions without the dialog?

I appreciate your help,
David


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list