Display files in a directory list control

2020-03-31 07:33发布

问题:

Is there a way for user to select a specific file using BrowseDlg? All i can find is that you can select only a folder!! I believe File selection is one of the "common" functionality in use.

Can anyone provide some suggestion on how this can be achieved.

Thanks!

Update

I am thinking of creating a C# custom aciton for this, as all other CA in project are in C#. But I am not sure about few things....

  1. How can I sequence this CA dialog with my exsiting UI sequence.
  2. How to trigger a CA on a button click from one of my custom dialog.
  3. How to get the file path back from File Browse CA to be further used by WIX.

The other CAs that I have created does not have any UI associated.

Please advice. Thanks!

回答1:

Actually, Windows Installer doesn't have anything built-in for the "Browse for file" dialog. Various vendors offer their custom solutions, like Advanced Installer and InstallShield.

Anyway, this all ends up in a custom dialog and custom action for Browse button. You can find an example of this here (search for "File Browse Dialog" on that page). The package you'll find contains the custom action, sample solution and some notes. It is based on InstallShield, but you can take at least custom action from there (creating a custom dialog in WiX is not that hard). As a last resort, you can try to implement this CA yourself.



标签: wix wix3.5