[wix-users] custom windows service - disabling FilesInUse

David Bernhard d.bernhard at wbi.at
Sun Mar 31 23:56:16 PDT 2019


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/


More information about the wix-users mailing list