I would like to know if there is a way how to use windows choose folder dialog instead of really bad looking one which is in WIX as a default.
问题:
回答1:
Burn: You can replace the whole MSI GUI by using WiX's Burn (bootstrapper and more) featuring a custom bootstrapper application. The bootstrapper application can do "anything" in terms of GUI.
Please see these similar questions & answers:
- WIX Installer with modern look and feel
- Changing text color to Wix dialogs
- Removing Default dialogs from MSI (please check all answers)
MSI: And yes, it should be possible to show the standard Windows directory selection dialog by hooking up a custom action to the MSI dialog's browse button click event - which will then invoke the Windows common dialog for folder section. Then you set the directory property from the custom action using either C++ or C# or even scripts I guess. Never tried scripts. This old C++ project could work with some minor massage. Or maybe the first section here.
I did this many years ago, and as I recall I ran into problems with dialog Z-order. In other words the folder selector dialog showed up underneath the MSI dialogs in some cases. I can't recall what I did to fix it, but I think it involved some dysfunctional send-keys stuff before I concluded that MSI dialogs are fundamentally flawed. I think a smoke test is in order before you waste significant time on it. That is the best advice I can cough up since I haven't tried it in years.
Some Links:
- MsiSetExternalUI function
- Custom Actions and User Interface
- Win32 - Select Directory Dialog from C/C++