+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Read Edit control value in custom dialog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Manish Jhalani Guest

    Default Read Edit control value in custom dialog

    Hi,

    I am using custom dialog where I am providing an edit control to show installation path and browse button to select/change the installation folder path. Edit control is suggesting default path. User can change path of his choice by browse button, and we show the changed path in edit control. This path is being used in another custom dialog Ready to install. Browse button changes on option dialog are carried forward to Ready to install.

    But if user changes installation path directly in edit control by keyboard, they are not carried forward to Ready to install.

    Do I need to handle any event ?

    Set Variable %_SB_INSTALLDIR% to "[INSTALLDIR]"
    Set Variable %DEST_DIR% to "%_SB_INSTALLDIR%"

    Set Text "%_SB_INSTALLDIR%" to ControlID "DESTDIR"
    ***** If %_SB_CONTROLID% Equals "BROWSEDIR" Then
    ******** Set Variable %_SB_INSTALLDIR% to FUNCTION:Browse for Folder()
    ******** Set Variable %DEST_DIR% to "%_SB_INSTALLDIR%"
    ******** Set Text "%_SB_INSTALLDIR%" to ControlID "DESTDIR"
    ***** End
    ***** If %_SB_CONTROLID% Equals "DESTDIR" Then
    ******** Set Variable %_SB_INSTALLDIR% to "%DEST_DIR%"
    ******** Set Text "%_SB_INSTALLDIR%" to ControlID "DESTDIR"
    ***** End

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Read Edit control value in custom dialog

    Manish,

    Please send a small demo project to support [at] lindersoft [dot] com so we can see what you are doing. We can then tell you how to "fix" it. The code snippet you posted does not include the required information.

    Friedrich

  3. #3
    Unregistered Guest

    Default Re: Read Edit control value in custom dialog

    Quote Originally Posted by linder View Post
    Manish,

    Please send a small demo project to support [at] lindersoft [dot] com so we can see what you are doing. We can then tell you how to "fix" it. The code snippet you posted does not include the required information.

    Friedrich

    ! //////////////////////////////////////////////////////////////////////////////////////////////////
    ! //
    ! //** SSSS S* BBBBBB
    ! //* S*** SS** B*** B
    ! //* S**** S** B*** B
    ! //* S******** B*** B
    ! //** SSS***** BBBBB******** SetupBuilder 7 Install Project Script
    ! //***** SS*** B*** B
    ! //******* S** B*** B******* Created with build: 7.1.2860
    ! //* S**** S** B*** B
    ! //* SS*** S** B*** B
    ! //* S SSSS** BBBBBB
    ! //
    ! //////////////////////////////////////////////////////////////////////////////////////////////////
    [ Support Files ]
    ! --- Required temporary installation files ---

    [ Billboards ]
    ! --- Billboard files ---
    [ Initialize Setup ]
    ! --- Define commonly used constants ---
    #include script "Common Definitions.sbi"

    ! Important: Initialize default install folder and program group variables
    Set Variable %_SB_INSTALLDIR% to "[INSTALLDIR]"

    [ Features ]
    ! If features are enabled, %_SB_FEATURESID% holds all selections separated by a vertical bar "|"
    ! Warning: It is not recommended to manually modify the %_SB_FEATURESID% variable!

    [ Setup Types ]
    ! If setup types are enabled, %_SB_SETUPTYPEID% holds the selected type
    ! Warning: It is not recommended to manually modify the %_SB_SETUPTYPEID% variable!
    :efine Setup Type "Typical"
    :efine Setup Type "Minimal"
    :efine Setup Type "Custom" [Custom Type]

    [ User Interface ]
    ! Wizard dialog definition(s)

    Set Variable %DEST_DIR% to "%_SB_INSTALLDIR%"

    ! Wizard dialog definition(s)
    Define Wizard Dialog "WELCOME" (Custom Wizard Dialog)
    Define Wizard Dialog "LICENSE" (Custom Wizard Dialog)
    Define Wizard Dialog "OPTIONS" (Custom Wizard Dialog)
    Define Wizard Dialog "READYTOINSTALL" (Custom Wizard Dialog)
    ! The Wizard Loop displays the dialog screens that the user sees in the installation
    Loop Wizard (Abort Dialog Active)
    ** If %_SB_DIALOGID% Equals "$LICENSE$" Then
    ***** If %_SB_EVENTID% Equals "$EVENT:ONINIT$" Then
    ******** Disable ControlID "$NEXT_BUTTON$"
    ***** End
    *****
    ***** If %_SB_EVENTID% Equals "$EVENT:ONREOPEN$" Then
    ******** If %LICENSE_ACCEPTED% Equals "0" Then
    *********** Disable ControlID "$NEXT_BUTTON$"
    ******** End
    ***** End
    *****
    ***** If %LICENSE_ACCEPTED% Equals "1" Then
    ******** Enable ControlID "$NEXT_BUTTON$"
    ***** End
    ***** If %LICENSE_ACCEPTED% Equals "0" Then
    ******** Disable ControlID "$NEXT_BUTTON$"
    ***** End
    ** End
    **
    **
    **
    ** If %_SB_DIALOGID% Equals "$OPTIONS$" Then
    *****
    ***** Set Text "%_SB_INSTALLDIR%" to ControlID "DESTDIR"
    ***** If %_SB_CONTROLID% Equals "BROWSEDIR" Then
    ******** Set Variable %_SB_INSTALLDIR% to FUNCTION:Browse for Folder()
    ******** Set Variable %DEST_DIR% to "%_SB_INSTALLDIR%"
    ******** Set Text "%_SB_INSTALLDIR%" to ControlID "DESTDIR"
    ***** End
    ***** If %_SB_CONTROLID% Equals "DESTDIR" Then
    ******** Set Variable %_SB_INSTALLDIR% to "%DEST_DIR%"
    ******** Set Text "%_SB_INSTALLDIR%" to ControlID "DESTDIR"
    ***** End
    *****
    ***** If %_SB_INSTALLDIR% File or Folder doesn't exist Then
    ******** Create Folder "%_SB_INSTALLDIR%"
    ***** End
    ***** Set Variable %DRIVELETTER% to FUNCTION:Extract Drive Letter(%_SB_INSTALLDIR%)
    ***** Set Variable %DISKSPACE% to FUNCTION:Get System Info(Free Disk Space) for "%DRIVELETTER%"
    ** End
    **
    ** If %_SB_DIALOGID% Equals "$READYTOINSTALL$" Then
    ***** Set Text "%_SB_INSTALLDIR%" to ControlID "DESTFOLDER"
    ***** Set Text "%DRIVELETTER%" to ControlID "CURRDRIVE"
    ** End
    End

    [ Final User Interface ]
    ! Final wizard dialog definition(s)
    Define Wizard Dialog "FINISH" (Custom Wizard Dialog)
    ! The Wizard Loop displays the dialog screens that the user sees in the installation
    Loop Wizard (Abort Dialog Active)
    ** Set Text "Finish" to ControlID "$NEXT_BUTTON$"
    ** Disable ControlID "$CANCEL_BUTTON$"
    End

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Read Edit control value in custom dialog

    Sorry, but this is just a script text. All the internal parameters are missing and the text can't be used to compile an executable.

    Please send the project file (.sb8) to support [at] lindersoft [dot] com.

    Friedrich

  5. #5
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Read Edit control value in custom dialog

    BTW, just noticed the "Created with build: 7.1.2860".

    This is a very old version and it reached End-of-Life on July 26, 2010 (more than 4 years ago).

    But you can send the .sb7 project and we'll compile and test it with the latest SB8.

    Friedrich

  6. #6
    Unregistered Guest

    Default Re: Read Edit control value in custom dialog

    Quote Originally Posted by linder View Post
    BTW, just noticed the "Created with build: 7.1.2860".

    This is a very old version and it reached End-of-Life on July 26, 2010 (more than 4 years ago).

    But you can send the .sb7 project and we'll compile and test it with the latest SB8.

    Friedrich
    Sent.

  7. #7
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Read Edit control value in custom dialog

    Hello,

    There are some problems in your script logic. You do not handle the events correctly or not at all ($EVENT:ONINIT$, $EVENT:ONREOPEN$, $EVENT:ONUPDATE$). Sometimes, you execute the functions twice and this results in an unexpected behavior.

    To fix the problem from the question asked, add the %DEST_DIR% runtime variable to the Static Text field. Then remove the Set Text "%_SB_INSTALLDIR%" to ControlID "DESTFOLDER" line from the script. But again, there are some more problems in your script logic. This will only fix one of them.

    Does this help?

    Friedrich

    P.S. NEVER create a folder from within the wizard that collects information from the user. All this should be executed after the wizard.
    Attached Images Attached Images   

  8. #8
    Unregistered Guest

    Default Re: Read Edit control value in custom dialog

    Quote Originally Posted by linder View Post
    Hello,

    There are some problems in your script logic. You do not handle the events correctly or not at all ($EVENT:ONINIT$, $EVENT:ONREOPEN$, $EVENT:ONUPDATE$). Sometimes, you execute the functions twice and this results in an unexpected behavior.

    To fix the problem from the question asked, add the %DEST_DIR% runtime variable to the Static Text field. Then remove the Set Text "%_SB_INSTALLDIR%" to ControlID "DESTFOLDER" line from the script. But again, there are some more problems in your script logic. This will only fix one of them.

    Does this help?

    Friedrich

    P.S. NEVER create a folder from within the wizard that collects information from the user. All this should be executed after the wizard.

    Thanks.

    I am still facing some issues after I did both suggested changes - 1. Add the %DEST_DIR% runtime variable to the Static Text field, 2. remove the Set Text "%_SB_INSTALLDIR%" to ControlID "DESTFOLDER" line from the script.

    Issues:
    1. Change of installation folder done by keyboard on options dialog only get reflected once on ready to install dialog. If we do back and change installation folder it is not reflected on ready to install.
    2. Now change of installation folder using Change button also not get reflected on ready to install.
    3. When we do back the edit control shows the default install dir not the changed one.

  9. #9
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Read Edit control value in custom dialog

    Yes, exactly. That what I meant in my previous comment. There are some more issues in your script logic Sometimes, you execute the same code twice and overwrite values.

    Did you already download the Example Package and Learning SetupBuilder Part I? There are some very interesting custom dialog demo projects available (including "event handling").

    Friedrich

  10. #10
    Unregistered Guest

    Default Re: Read Edit control value in custom dialog

    Quote Originally Posted by linder View Post
    Yes, exactly. That what I meant in my previous comment. There are some more issues in your script logic Sometimes, you execute the same code twice and overwrite values.

    Did you already download the Example Package and Learning SetupBuilder Part I? There are some very interesting custom dialog demo projects available (including "event handling").

    Friedrich
    I dont have download rights at my system and could not access Example Package and Learning Setup Builder Part I. Could you please help with solution ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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