2

I have marked the following dialog as Hidden in WiX but yet it is still show on an uninstall when files are in use:

<Dialog Id="FilesInUse" X="50" Y="50" Width="361" Height="177" Title="[ProductName] Files in Use" Hidden="yes">
  <Control Id="RetryButton" Type="PushButton" X="99" Y="150" Width="81" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}&amp;Try Again" TabSkip="no" Default="yes">
    <Publish Event="EndDialog" Value="Retry" />
  </Control>
  <Control Id="ContinueButton" Type="PushButton" X="186" Y="150" Width="81" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}&amp;Continue" TabSkip="no">
    <Publish Event="EndDialog" Value="Ignore" />
  </Control>
  <Control Id="ExitButton" Type="PushButton" X="273" Y="150" Width="81" Height="18" Text="{\VSI_MS_Sans_Serif13.0_0_0}E&amp;xit Installation" TabSkip="no" Cancel="yes">
    <Publish Event="EndDialog" Value="Exit" />
  </Control>
  <Control Id="ListFilesInUse" Type="ListBox" X="8" Y="64" Width="348" Height="62" Property="FileInUseProcess" Text="{\VSI_MS_Sans_Serif13.0_0_0}MsiFilesInUse" TabSkip="no" Sunken="yes" Sorted="yes" />
  <Control Id="InstallBodyText" Type="Text" X="6" Y="9" Width="345" Height="43" Text="{\VSI_MS_Sans_Serif13.0_0_0}The following applications are using files which the installer must update. You can either close the applications and click &quot;Try Again&quot;, or click &quot;Continue&quot; so that the installer continues the installation (a reboot may be required to replace these files on a restart)." TabSkip="yes" NoPrefix="yes">
    <Condition Action="show"><![CDATA[REMOVE=""]]></Condition>
    <Condition Action="hide"><![CDATA[REMOVE<>""]]></Condition>
  </Control>
  <Control Id="RemoveBodyText" Type="Text" X="6" Y="9" Width="345" Height="36" Text="{\VSI_MS_Sans_Serif13.0_0_0}The following applications are using files which the installer must remove. You can either close the applications and click &quot;Try Again&quot;, or click &quot;Continue&quot; so that the installer continues the installation (a reboot may be required to replace these files on a restart)." TabSkip="yes" NoPrefix="yes">
    <Condition Action="show"><![CDATA[REMOVE<>""]]></Condition>
    <Condition Action="hide"><![CDATA[REMOVE=""]]></Condition>
  </Control>
</Dialog>

How can I suppress this dialog?

Note: This dialog needs to be present or else the installer throws error 2803: dialog view did not find a record for the dialog. I just need to not display it to the user somehow, or (if possible) to choose a selection for them.

Alexandru
  • 12,264
  • 17
  • 113
  • 208
  • This might be relevant to your issue - http://stackoverflow.com/questions/6913332/wix-installer-problem-why-does-restartmanager-mark-service-as-rmcritical-and-no/8147540#8147540 – jbudreau Mar 24 '15 at 20:03

1 Answers1

3

According to the tips on installsite (see below), this does not seem not possible, since it is a Windows OS behavior. From my own experience, an alternative way to bypass this issue is to have a custom action to detect the running process and then prompt user that the process is running, close that app before uninstall. Uninstall an app while it is running is not good, it may leave some files and registry entries unless you do a clean uninstall next time or manually delete them.

How do I prevent the FilesInUse Dialog from displaying?

Set the Attributes column of the Dialog table for the FilesInUse dialog to 0.

Depending on your authoring tool, this is equivalent to marking the dialog to be "hidden", "modeless", and "NoMinimize".

Note that this trick will only work if your setup runs with full or reduced user interface. In basic UI mode Windows Installer uses its own built-in dialogs instead of the dialogs you authored in the msi file.

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Frank Zhang
  • 509
  • 2
  • 7
  • I've tried setting `NoMinimize="yes" Hidden="yes" Modeless="yes"` on the dialog, but like you've said, during uninstalls, it runs in basic UI mode, and as a result of this, the MSI presents its own FilesInUse dialog with the following text: `The following applications should be closed before continuing the install`. You may be right as I cannot find a solution for this. I tried to see if I could hack around it by forcing full UI uninstalls. You can't. – Alexandru Mar 23 '15 at 18:54
  • A parent app uses my app (keeps restarting it as well). I can't kill the parent app because customers might lose their data, so I wait for them to close the parent app and block execution with prompts. I then kill my app after the parent dies and before the install. The custom action that prompts requires administrator permissions for registry access and for getting active processes, so I had to place it after `InstallInitialize` and before `InstallFinalize` (had to make it deferred). The problem is that this FilesInUse dialog comes before `InstallInitialize`. its a chicken and egg problem. – Alexandru Mar 23 '15 at 19:07
  • I'd like to give it a few more days to see if someone else has any other workarounds or ideas but if they don't I will award you with the bounty since this is a tough problem and likely doesn't have a straightforward solution if at all. – Alexandru Mar 23 '15 at 19:14
  • 1
    @Alexandru Playing with Windows will sometimes have such situation, MSI service is a black box to client like us other than the public APIs. I am also expecting if someone else has a straightforward solution, this issue sounds common to some windows installer users/developers. – Frank Zhang Mar 24 '15 at 05:44