3
votes

I'm trying to write an Installer for my Windows Service using WiX. My executable can register/unregister itself as a Windows Service using the command line parameters --install and --uninstall. This is what I came up with:

<CustomAction Id='InstallAsService' FileKey='CCWirelessServer.exe' ExeCommand='--install' Return='check' Impersonate='no' Execute='deferred' />
<CustomAction Id='InstallAsServiceRollback' FileKey='CCWirelessServer.exe' ExeCommand='--uninstall' Return='check' Impersonate='no' Execute='rollback' />
<CustomAction Id='UninstallAsService' FileKey='CCWirelessServer.exe' ExeCommand='--uninstall' Return='check' Impersonate='no' Execute='deferred' />

<InstallExecuteSequence>
  <Custom Action='InstallAsService' After='InstallFiles' >NOT Installed</Custom>
  <Custom Action='InstallAsServiceRollback' Before='InstallAsService' >NOT Installed</Custom>
  <Custom Action='UninstallAsService' Before='RemoveFiles' >Installed</Custom>
</InstallExecuteSequence>

Both install and uninstall basically work. But during uninstall I get the following message:

The setup must update files or services that cannot be updated while the system is running. If you choose to continue, a reboot will be required to complete the setup.

Despite this error message, the service gets unregistered and the files are deleted without a reboot. To me this looks like the installer is checking if CCWirelessServer.exe is opened before it executes my custom action.

So my question is: How do I need to modify my install execute sequence so that this error message does no longer appear?

1

1 Answers

1
votes

If you are developing for Windows Installer > 3.1 you can take a look at the MSIRESTARTMANAGERCONTROL-property to see if it it set properly or if other values would would stop displaying the message.

I could suppress the message using the following values:

 <Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" Secure="yes" />