Page 1 of 1

Select license file depending on a variable

Posted: Thu Feb 27, 2020 2:10 am
by andre
Hello,
I'm using the latest version of IA11 as a registered user and I have a question about the license file
(in support files): I would like to be able to select the license file
which will be displayed depending on a variable value get as a
parameter of my setup.

Example 1: mysetup.exe PARAM=A
In this case, I would like to display the support file called licenseA.txt

Example 2: mysetup.exe PARAM=B
In this case, I would like to display the support file called licenseB.txt

Is it possible to do such a thing with IA11? If yes, can you help me
because I don't know how to do.

As an alternative if it is not possible to change the support file for
the license, is there a way to dynamically change the text of the
license?

Thank you for all of your answers.

Best regards,
Andre

Re: Select license file depending on a variable

Posted: Thu Feb 27, 2020 3:10 pm
by FrancescoT
yes, you can ...but you have to use a custom approach for loading the text files conditionally, and then displaying the loaded txt content.

- You should add your txt files to SUPPORTDIR.
https://www.installaware.com/forums/viewtopic.php?f=2&t=10676

To conditionally load your txt file on the base of a variable value passed from command line, declare a script variable at the very beginning of your man script, and assign it to itself (this automatically assigns the CMD line parameter MY_CMD_PARAM to the script variable, ex: mysetup.exe MY_CMD_PARAM=A).

For example:

Code: Select all

Set Variable MY_CMD_PARAM to $MY_CMD_PARAM$
   ...
Set Variable TEXT_FILE_CONTENT to
if Variable MY_CMD_PARAM Equals A
  Read from Text File #READALL\$SUPPORTDIR$\licA.txt into Variable TEXT_FILE_CONTENT
end
(*) consult the product documentation for details on "Read from Text File" command.


Finally to display the loaded content (TEXT_FILE_CONTENT), add a MEMO Control to your custom "EULA dialog", and enter $TEXT_FILE_CONTENT$ into the "LINE property (TMemoStrings)" of the control.

Hope this helps you.

Re: Select license file depending on a variable

Posted: Mon Mar 02, 2020 6:02 am
by andre
Hi Francesco,

This is exactly what I would like to do.
Thank you very much for your help.

Best regards,
Andre

Re: Select license file depending on a variable

Posted: Mon Mar 02, 2020 2:22 pm
by FrancescoT
:D