stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Need to collect/store info during setup.

What is the method for collecting information during setup, and storing it in the registry?

Specifically, I need to collect a new password and an activation code during first-time install:

Password
- collect password twice (second to confirm no typo)
- compare them, pop a msgbox if they don't match
- otherwise hang on to it
- upon execution, encrypt it (I have the VBS algorithm) and save it in one of the registry keys I am creating with AI

Activation Code
- similarly, collect code, validate, store in registry upon install execution

It seems like the capability is there, but I'm unsure about the programming model and objects used to accomplish this. Is there a case study or examples of this kind of work?
Cristi
Posts: 34
Joined: Wed Oct 08, 2008 8:44 am
Contact: Website

Re: Need to collect/store info during setup.

Hi,

Yes, there is. I will try to describe the method in several steps:

1. in the Install Parameters page you can add 2 hidden public properties with empty values (just make sure that the "Value" field is blank). Let's name the properties PAR and PARCONF.

2. in the Dialogs page you can create a new dialog by clicking the [New Dialog] button from the toolbar (let's name NewDialog the dialog created). Now, on the new dialog you can create 2 Edit Boxes and rename their Property Names to PAR and PARCONF, respectively (the first box will contain the password and the second one the retyped password).

3. in the Custom Action page you can create a Script Inline UI Custom Action and a File attached to installation UI Custom Action. The first one (let's call it "Message") can have the "Script Text" set to something like this:

Code: Select all

MsgBox("Password not confirmed!")
In the second one (let's call it "Encrypt") you can use your VBS algorithm . Please make sure that your algorithm retains the result in a public property (let's call ENCPROP the property resulted from encryption).

4. in the dialog created at step 2. you can add 3 Published Events on the "Next" button. They can look like this:

Code: Select all

Event     | Argument | Condition
--------------------------------------------------------------------
DoAction  |Message   | (PAR <> PARCONF) OR (PAR="") OR (PARCONF="")
DoAction  |Encrypt   | (PAR=PARCONF) AND (PAR<>"") AND (PARCONF<>"")
NewDialog |FolderDlg | (PAR=PARCONF) AND (PAR<>"") AND (PARCONF<>"")
5. in the Registry page you can create a new value. In the data field you can put the ENCPROP property from step 3.:

Code: Select all

[ENCPROP]
A similar approach can be used for the Activation Code.

Best regards,
Cristi
______________________________
Cristi Costache
Advanced Installer Team
http://www.advancedinstaller.com/
stevefal
Posts: 119
Joined: Wed Sep 03, 2008 9:02 pm
Location: Washington USA
Contact: Website

Re: Need to collect/store info during setup.

Thanks Cristi, I think I got it.

Return to “Common Problems”