Hi Stephen,
Thanks for posting. Although we cannot do this with VS.Net's Setup project,
we can achieve the goal with Windows Installer Platform SDK tools. The
following steps are for your reference:
1. Install Windows Installer Platform SDK at the following site:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ 2. Install the "Orca.msi" included.
3. Create a new Setup project. Add 2 Registry search for the project.
Accept their default name settings. So they should be associated with
properties "REGISTRYVALUE1" and "REGISTRYVALUE2".
4. Add a "Textboxes (A)" dialog.
5. Build the project.
6. Use Orca to open the MSI generated.
7. Go to the "CustomAction" table. Change the row with
"CustomTextA_SetProperty_EDIT1" to the following:
Action, Type, Source, Target
CustomTextA_SetProperty_EDIT1, 307, EDITA1, [REGISTRYVALUE1]
Add the following row:
Action, Type, Source, Target
CustomTextA_SetProperty_EDIT1_2, 307, EDITA1, [REGISTRYVALUE2]
8. Go to the "InstallUISequence" table. Change the existing row with
"CustomTextA_SetProperty_EDIT1" to the following:
Action, Condition, Sequence
CustomTextA_SetProperty_EDIT1, REGISTRYVALUE1<>"", 701
Note that we only add the condition REGISTRYVALUE1<>"". We do not need to
change the action name or the sequence number.
Add a new row in the "InstallUISequence" table:
Action, Condition, Sequence
CustomTextA_SetProperty_EDIT1_2, REGISTRYVALUE1="", 705
9. Save and exit.
When we launch the MSI, the installation program will attempt to read from
the registry and assign the values to properties REGISTRYVALUE1 and
REGISTRYVALUE2. In the "Textboxes (A)" dialog, if REGISTRYVALUE1 is not
empty, the TextA.Edit1's value will be assigned with it (by the custom
action "CustomTextA_SetProperty_EDIT1"). If the REGISTRYVALUE1 is empty,
the TextA.Edit1's value will come from REGISTRYVALUE2 (by the custom action
"CustomTextA_SetProperty_EDIT1_2").
Please give it a try and see whether this helps or not.
Regards,
Felix Wang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights.