How to embed a UserControl in WIX installer?
Is there anyway to embed a usercontrol inside a WIX installer?
We're trying to replace an InstallShield installer with a WIX installer, however there are a couple of involved UserControls that the InstallShield installer embeds that would be easier to reuse t开发者_C百科han reimplement.
As far as I know, it is not possible to embed user controls inside Wix installers. This is because Wix simply outputs a standard Windows Installer MSI file, and that only supports limited types of controls.
That being said, you might want to look out for Burn, a newcomer to the Wix toolset expected later this year, which is likely to include support for custom UIs on top of Windows Installers.
There is nothing stopping you from having a custom action that displays a form, and having this custom action triggered when a button is pressed.
I have used this approach with great success to implement "picker controls". For example, have a text box with a button next to it, and when the button is clicked you display the standard AD "find user" dialog.
Or create a form that uses SMO to enumerate all the SQL Servers on the network and allow the user to pick one (and then enumerate the DBs on the server for them to pick).
So you could create a custom action that displays a form, and then host your user control in the form.
That being said, I await the release of Burn with great anticipation.
While you can wait for Burn (as mentioned in the other answers) you can also check out a program of mine called SharpSetup - it allows you to create installation logic using WiX (files, folders, registry entries, etc.) but create whole user interface using WinForms. This gives you great flexibility in what controls you can use (basically everything you have on VS toolbar), including custom UserControls.
精彩评论