Displaying variable values in text boxes on dialog

Got a problem you cannot solve? Try here.
Post Reply
jimdalrymp
Posts: 13
Joined: Wed Jun 20, 2007 2:34 pm
Location: St. Louis, MO USA

Displaying variable values in text boxes on dialog

Post by jimdalrymp »

I want to display a default database name in a text box on a custom dialog.

At the top of my script:

Set Persistent Variable DEFAULTDBNAME to RMSDBSQL

In the text property of the text box:

$DEFAULTDBNAME$

When I run the setup in debug mode, the text box is just blank. A watch shows that the variable is populated with "RMSDBSQL".

What am I doing wrong?

Also, I have two option buttons:

Server Authentication
Windows Authentication

The Checked property for the Server control is True and the Checked property for the Windows control is False, but when the dialog displays in debug mode, the Windows control is checked and the Server control is not checked. What is going on?

Thanks for the help.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Set your build mode to uncompressed and remove the debug flag and see if that fixes your problem.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
jimdalrymp
Posts: 13
Joined: Wed Jun 20, 2007 2:34 pm
Location: St. Louis, MO USA

Post by jimdalrymp »

Thank you for the quick reply.

I have been using the Uncompressed build mode and the Debug Build check box was not checked.

I place a LABEL control onto the form where the caption property referenced a variable in the script and it displayed the variable value on the form without a problem. So it seems that the problem is how to do this using an EDIT control?
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

You may want to provide more details or post a minimum version of your project which illustrates this issue.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
jimdalrymp
Posts: 13
Joined: Wed Jun 20, 2007 2:34 pm
Location: St. Louis, MO USA

Post by jimdalrymp »

Attached is a folder with a sample project that shows a script variable successfully displayed in a label control on the welcome form, but unsuccessfully displayed in a edit control on the same form.

Thanks again for your help.

File Attached:

TestCustomDialog.zip
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Mistake. You have to set Object Behavior -> Receives Information to [Written Variable Value] and Object Behavior -> Writes Values to Variable to your variable name.

Double click the edit box to see all object behaviors.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

Jim,

I don't think edit boxes work the same way as labels. That is, pumping the variable name into the text property will not work like it will pumping the variable name into the label caption.

Instead, you might as well remove the variable name from the text property. Then double-click on the edit box and select the Object Behavior tab. Change the Receives Information and select [Written Variable Value] and in Write Values to Variable enter $DEFAULTINSTANCE$. That will give the default value you are after and you can then edit it as necessary at runtime. You should then be good-to-go.

Hope this helps.

EDIT: I just noticed that Michael beat me by a few minutes with the same answer. His pre-confirms mine. :wink:
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
jimdalrymp
Posts: 13
Joined: Wed Jun 20, 2007 2:34 pm
Location: St. Louis, MO USA

Post by jimdalrymp »

That did the trick. Thank you!
Post Reply