Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2008
    Posts
    4

    Serial Key and Next Button!

    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?!!

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    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, 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

  3. #3
    Join Date
    Jul 2008
    Posts
    4
    Quote Originally Posted by upeters View Post
    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, 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?

  4. #4
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    Quote Originally Posted by EthanB View Post
    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:
    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

  5. #5
    Join Date
    Jul 2008
    Posts
    4
    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?

  6. #6
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    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 and try again.

    Ulrich
    Last edited by Ulrich; 07-31-2008 at 04:16 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts