PDA

View Full Version : Serial Key and Next Button!


EthanB
07-30-2008, 06:09 PM
Im making an installer and i dont want the next button to actualy be Enabled (But i do want it visable) untill the user entered the correct/ or just entered the Serial Key!;)

Is there a way to do this, and can someone give me the script to do so?!!:huh:huh

Ulrich
07-30-2008, 09:52 PM
Yu will have to disable the button by default, and enable it when the serial key is entered through scripting.

You'll find a similar thread here (http://www.indigorose.com/forums/showthread.php?t=24103), but will have to make your own script (as in that thread the test is performed on a combobox), deciding if the serial entered is valid or not, and enable the Next button accordingly...

Ulrich

EthanB
07-30-2008, 11:28 PM
Yu will have to disable the button by default, and enable it when the serial key is entered through scripting.

You'll find a similar thread here (http://www.indigorose.com/forums/showthread.php?t=24103), but will have to make your own script (as in that thread the test is performed on a combobox), deciding if the serial entered is valid or not, and enable the Next button accordingly...

Ulrich
Im fairly new and have no idea how to script my own any chance you could wright up one?

Ulrich
07-31-2008, 10:06 AM
Im fairly new and have no idea how to script my own any chance you could wright up one?

I certainly can write a script, but it isn't of much use if you don't invest more time to learn the tool, because on the first need to modify the behavior you will be stuck again. The scripting is very easy to understand for anybody who is a programmer and needs an installer to deploy his/her product, and the product documentation is excellent. I come to this forum to help other users, but I don't work for free.

I assume that you already included the "Verify Serial Number" screen in your project, and moved the screen to the most logical position in the screen order (normally after the License Agreement or User Information).

Double-click the screen name to open the Screen Properties dialog. On the Attributes tab you will find checkboxes to disable and hide buttons on the screen individually. So uncheck the Enabled checkbox of the Next: button. By doing so, the button will be disabled the moment the screen is loaded.

Now click the Actions tab of the same dialog. Here you will control how to react to events like when the text of the entry field for the serial number changes. Place here the following code:

-- These actions are triggered by the controls on the screen.
if (e_MsgID == MSGID_ONCHANGED and e_CtrlID == CTRL_EDIT_01) then
-- enable the "Next" button only if the text is at least 5 characters long
if (String.Length(SessionVar.Expand("%SerialNumber%")) > 4) then
tProperties = {Enabled=true};
DlgButton.SetProperties(CTRL_BUTTON_NEXT, tProperties);
else
-- anything else keeps the button disabled for now
tProperties = {Enabled=false};
DlgButton.SetProperties(CTRL_BUTTON_NEXT, tProperties);
end
end


Now what will this code do? On each keystroke, the contents of the textfield where the serial number is informed is checked, and if the length is at least 5 characters long, the Next button will be enabled. On clicking Next, the script placed on the On Next tab will be executed, which will compare the serial number entered against those you registered inside the installer. If you have no clue how to do this, open the help file and search for "serial numbers", and see in the menu > Project > Serial Numbers.

Ulrich

EthanB
07-31-2008, 04:48 PM
do you put that on the "On Ctrl Message" becuase i put it on that and when i compile the installer and run it it just stopes working on the screen before the enter key screen..

is the code right?

Ulrich
07-31-2008, 05:05 PM
Yes, the code is indeed correct. I tested it on Setup Factory 8.0 and it works flawlessly, but I see that there seems to be a problem with version 7.0. I am filing a bug report right now. Meanwhile, please fetch the new version from the website (http://www.indigorose.com/setup-factory/) and try again.

Ulrich