I've recently created a setup project for my C# .NET Windows Forms Application.
In my User Interface Editor I have:
- Start
- Welcome
- Textboxes (A)
- Installation Folder
- Confirm Installation
In the Textboxes (A) dialog I have one edit field that I want to make mandatory.
How can I do that? I've downloaded the Orca editor. Is there a simple way to use that to do that?
These are the two goals I hope to achieve (goal 1 at least):
Any help is appreciated.
Thanks!
Windows Installer Dialog definitions are located in CommonExtensions\Microsoft\VSI\bin\VsdDialogs
folder under the IDE folder of the deployed version of VS, for example for a VS 2017 it is something like this:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\VSI\bin\VsdDialogs\
In that folder, go to 0
and 1033
folders, run orca
as administrator and change the VsdCustomText1Dlg.wid
file which is for Textboxes (A)
.
Note 1: You can create a new windows installer dialog by copying that file and renaming it to
MyCustomDialog.wid
. Then open it in orca and go toModuleDialog
table and change theDisplayName
toMy Custom Dialog
. Make sure you copy the file in both1033
and0
. Then in VS, you can add an instance of this dialog using User Interface Editor of Setup project.
Note 2: You can also edit the
msi
file usingOrca
and edit the control conditions, but if you do so, then every time you build the setup project, you need to repeat editing of themsi
file. So editing.wid
makes more sense.
Note 3: Combining conditions of fields using
AND
andOR
is possible as well. For more information, take a look at ControlCondition Table and Conditional Statement Syntax
To make the Edit1
value mandatory and enable or disable Next button:
Run orca
as administrator
Open the wid
file which you used for adding the custom dialog.
In ControlCondition
, in addition to existing rows add the following rows:
┌──────────────┬──────────────┬──────────────┬──────────────┐
│ Dialog_ │ Control_ │ Action │ Condition │
├──────────────┼──────────────┼──────────────┼──────────────┤
...
│ CustomTextA │ NextButton │ Disable │ EDITA1="" │
│ CustomTextA │ NextButton │ Enable │ EDITA1<>"" │
└──────────────┴──────────────┴──────────────┴──────────────┘
Save the file and make sure you have the same file in both 1033
and 0
folders.
Close Orca
Rebuild setup project.
Install it.
As a result you will see such behavior: