开发者

Including modified FilesInUse dialog in WIX project

I have a modified FilesInUse dialog. Just including it in project and changing reference in UI does not help - I get "ICE20: Standard Dialog: 'FilesInUse' not found in Dialog table" error when building installation project.

Browsing the Net I've found one advice - to supress ICE validation for ICE20. Well, building the project with such settings works fine, and the msi also works fine, but I'm not sure that's a good solution to the problem.

Another advice was to modify FilesInUse and remove WixUIExtension from references, but as far as I know this way I'll end up with cop开发者_如何转开发ying all the needed dialog files to my project. This I'd like to avoid.

So, what can be done to include my custom FilesInUse in WIX project correctly?


You could use a custom FilesInUse Dialog in the following manner:

<Fragment>
<UI>
  <Dialog Id="FilesInUse" Width="370" Height="270" Title="Your product name">
    <Control Id="Retry" Type="PushButton" X="304" Y ="243" Width="56" Height="17" Text="Retry" Default="yes" Cancel="yes">
      <Publish Event="EndDialog" Value="Retry">1</Publish>
    </Control>
    <Control Id="Ignore" Type="PushButton" X="235" Y ="243" Width="56" Height="17" Text="Ignore">
      <Publish Event="EndDialog" Value="Ignore">1</Publish>
    </Control>
    <Control Id="Exit" Type="PushButton" X="235" Y ="243" Width="56" Height="17" Text="Exit">
      <Publish Event="EndDialog" Value="Exit">1</Publish>
    </Control>
    <Control Id ="InUseFiles" Type="ListBox" Width="300" Height="150" X="30" Y ="60" Property="FileInUseProcess" Sorted="yes" TabSkip="yes" />
  </Dialog>
</UI>
</Fragment>

You just have to reference this Dialog into your Custom InstallDialog with the tag

<DialogRef Id="FilesInUse" />

All the tags mentioned are part of the ICE20 Dialog Requierements

Hope this helps. Have a nice day.


OK, I just spent some time trying to figure out how to solve this problem.

Though there are some good references in suggested thread, I think the FilesInUse dialog is a bit more specific to customize, so I decided to write a more concrete solution to the problem.

See, the problem is that MSI uses the FilesInUse dialog automatically, so if you try to change it somehow, you get errors such as FilesInUse not existing in Dialog table or duplicate FilesInUse dialog in table if you are referencing your custom dialog from other files.

The solution I found working was not to use DialogRef to Wix's FilesInUse dialog at all, but to make my custom dialog in main UI file (Where I would normally put DialogRef to FilesInUse) and name it FilesInUse.

Hope this helps other people having the same problem.


One more wrinkle is that the custom FilesInUse dialog will not be displayed when clicking Uninstall in Programs and Features since the uninstall is run with UILevel 3, so only the built-in FilesInUse will be displayed.

To work around that include this in your product.wxs:

<Property Id="ARPNOREMOVE" Value="1" />

Then when users press the Change (or Modify) button in Programs and Features, the Maintenance dialog will have a Remove button they can use to uninstall, and that will show custom dialogs. Products like Visual Studio only have a Change/Modify button.

One more thing is that Apps and Features (Windows 10) will disable the Modify button if the Uninstall key doesn't have a ModifyPath setting. It should be set to

MsiExec.exe /I{<yourproductcode>}

Your bootstrapper will need to do this. Not sure if the MSI can set it.


If building on the command line: light.exe -sice:ICE20...

If working in Visual Studio: Right click your setup project, select "Properties", Select "Tool settings" on left side of screen, Add "ICE20" to the "Suppress Specific ICE validation:" edit box.


See the related question and answers here: WiX replace dialog

User Yan Sklyarenko answered on Mar 25 '11:

Couple of articles to help you:

WiX Tutorial

Neil Sleightholm's article

You should find all the info you need for your case there.

User Bob Arnson answered on Mar 25 '11:

See "Changing the UI sequence of a built-in dialog set" in the topic "Customizing Built-in WixUI Dialog Sets" in WiX.chm.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜