Load EULA dynamically?

For all your non-technical questions.
AndrewC
Posts: 23
Joined: Tue Feb 06, 2007 8:11 pm

Load EULA dynamically?

Postby AndrewC » Tue Feb 06, 2007 8:25 pm

In the User Interface section, I see a way I can statically enter EULA text, but what I'd like to do is load that dynamically from a file. How can I do that?

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Wed Feb 07, 2007 1:37 am

You can set the receives information field for the control to nothing, set the lines property to a variable, and then use Read from Text File to populate that variable at runtime.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

AndrewC
Posts: 23
Joined: Tue Feb 06, 2007 8:11 pm

Postby AndrewC » Thu Feb 15, 2007 10:11 pm

I'm doing something wrong but I am not sure what. In the Form designer's Define Interactive Characteristics dialog, Object Behavior tab, I set RichEdit1's Receive Information combo to <none>. In script, I read RTF text from a file into a variable named LICENSETEXT. I can put a label on the dialog and set the label's caption to $LICENSETEXT, and that works fine, but I haven't found a way to successfully load RichEdit1.Lines.

I've tried using Object Rules tab in the Define Interactive Characteristics dialog, adding the rule: "If (RichEdit1.Visible = True) THEN RichEdit1.Lines := $LICENSETEXT$;". I've also tried "If (RichEdit1.Visible = True) THEN RichEdit1.Lines := LicenseLabel.Caption;" where LicenseLabel is the hidden label on the dialog that has its caption set to $LICENSETEXT$.

It compiles fine, but at runtime it gets 'Invalid property value'. So what's the trick of loading a RichEdit's Lines property?

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Fri Feb 16, 2007 8:02 am

Did you click the "..." button in the Lines property of the Object Properties window for the richedit control? That would be the correct approach for what you are trying to do.
Candice Jones

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

AndrewC
Posts: 23
Joined: Tue Feb 06, 2007 8:11 pm

Postby AndrewC » Fri Feb 16, 2007 7:35 pm

I assume you are saying I should set the Lines property to $LICENSETEXT$ so it'll load the contents of that variable? When I tried that, I got "RichEdit line insertion error".

When I tried loading LICENSETEXT with plain text instead of RTF, I don't get an error at runtime, but all I get is the first line of the license file. Is there some property that controls adding multiple lines that I'm missing? I have maxlength set to 0.

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Sun Feb 18, 2007 4:16 pm

How did you try to read in the RTF file? Sounds like you tried to read in a formatted file and that naturally caused an error. Read from Text File works well with plain text files, but might not fare so well with files containing binary data. Also it has a switch to enable reading in an entire file - so you don't have to code a loop for it. Just press F1 for the switch syntax while the window is showing.

You can also call CopyFileA or MoveFileA in kernel32.dll through Call DLL Function, renaming one of your multiple possible license files to the form InstallAware expects them in at runtime.
Candice Jones

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Non-Technical”

Who is online

Users browsing this forum: No registered users and 11 guests