PDA

View Full Version : Is it possible to use the same dialog twice?



arrigob
09-09-2010, 07:18 AM
I am trying to create an installer that will prompt the user once to choose a shared directory on their computer and then prompt a second time asking what directory to install too.

I tried creating a second "Select Install Folder" dialog (meaning I would have two of the same dialog type) but whenever I change one of the two, the second one always changes with the changes made to the first one. Any ideas on how I should go about this?

linder
09-09-2010, 07:30 AM
Hello,

First of all, yes, it is possible to use the same dialog type multiple times. You have to store the result in different variables and (if the text is different), you have to use different text resources.

BTW, and you can even let the user do all this from the same dialog. Did you already download the Examples package which includes the "Learning SetupBuilder Part I" bible? It comes with interesting examples. Check the custom dialog source code projects and the "Destination Folders 1.sb7" project.

http://www.lindersoft.com/downloads_licensed.htm

The "Learning SetupBuilder Part I" is the official "Everything you ever wanted to know about SetupBuilder but were afraid to ask" introductory material. This "SetupBuilder Bible" is a compendium of tips, tricks, warnings, and resources for SetupBuilder users of every ability level.

Does this help?

Friedrich

arrigob
09-09-2010, 08:49 AM
Yes that does for that question, and thanks a lot for the quick response.

But, another question has spawned since then. I have been looking through the documentation you referred me to and can't seem to grasp how the identifier works.

You spoke above saying " (if the text is different), you have to use different text resources". That is the part I am working on. I added a different variable for the dialog, but I need to change the dialog text to say something different than the other dialog I am also using.

Are text resources what identifiers are? I can't seem to change the identifier sections, it only lets me change text. I can use script editor all day but the dialogs are confusing me, sorry. Could you explain how to change the text for each dialog when using two of the same dialog? Thanks so much for your help.

linder
09-09-2010, 09:18 AM
:)

Text resources are a perfect tool to support multiple-languages in the installer. Instead of "hard-coding" text, you can use text resources to display different text messages based on the selected installer language.

See attached textresources1.jpg screenshot. The "Text Info" points to the #DLG_DESTINATION_TEXT# text resource which is defined in the "Text and Messages" Visualizer. This text resource displays "Please enter the location where you would like to install the program. You may type a new folder name or click the Change button to find a new location."

To create another "Text Info" for another dialog, go to the Text and Messages Visualizer (see attached textresources2.jpg) and select the "Custom" section. Then right-click and select "Add Resource Group". Here you can add all your own custom text resources. Right-click and select "Add Identifier". This will create a new identifier and you can enter your own text. For example: "This is new text to be displayed in the yadayada dialog..."

Then, in your 2nd "Select Install Folder" dialog (or wherever you want), use the newly created #SB_NEW_IDENTIFIER1# text resource (see attached textresource3.jpg) and you are done ;)

Does this help?

Friedrich

arrigob
09-09-2010, 10:00 AM
PERFECT! That is exactly what I needed and well written may I add. Great support as always!

linder
09-09-2010, 10:30 AM
You are very welcome :)

Friedrich