This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Not quite there...
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Nov 02, 2011
05:33 PM
How to access custom control value
I have added a custom Checkbox Control to the SQLServerSelect dialog and would like to access its value in my installscript. Can someone please help me to know what function, etc. I can use to access its value?
I've tried the following, but I'm not getting it right (or its the wrong function)
NUMBER nState;
STRING szIfEncrypt;
//Control Identifier
#define ENCRYPTCHECKBOX 17818
Dlg_SQLServerSelect:
szMsg = "";
szServer = MW_SERVERNAME;
SQLRTInitialize2();
nResult = SQLServerSelect( szMsg, szServer );
if (nResult = BACK) goto Dlg_SdRegisterUser;
if (nResult = IDCANCEL) then
// The user clicked the window's close button.
Do (EXIT);
endif;
if (nResult = CANCEL) then
Do (EXIT);
endif;
nState = CtrlGetState("DialogId_10110", ENCRYPTCHECKBOX);
if (nState = BUTTON_CHECKED) then
MessageBox( "button checked", SEVERE );
szIfEncrypt = "true";
endif;
I've tried the following, but I'm not getting it right (or its the wrong function)
NUMBER nState;
STRING szIfEncrypt;
//Control Identifier
#define ENCRYPTCHECKBOX 17818
Dlg_SQLServerSelect:
szMsg = "";
szServer = MW_SERVERNAME;
SQLRTInitialize2();
nResult = SQLServerSelect( szMsg, szServer );
if (nResult = BACK) goto Dlg_SdRegisterUser;
if (nResult = IDCANCEL) then
// The user clicked the window's close button.
Do (EXIT);
endif;
if (nResult = CANCEL) then
Do (EXIT);
endif;
nState = CtrlGetState("DialogId_10110", ENCRYPTCHECKBOX);
if (nState = BUTTON_CHECKED) then
MessageBox( "button checked", SEVERE );
szIfEncrypt = "true";
endif;
(7) Replies
‎Nov 03, 2011
10:04 AM
The question I asked and its solution should be a simple one. Can you please share it with us?
‎Nov 03, 2011
11:06 AM
Not sure if this will work but you might want to give it a try, add this after your call to SQLServerSelect.
szDialogName = "SQLServerSelect";
nResult = CtrlGetState ( szDialogName, ID_OPTION1 );
if(nResult = BUTTON_CHECKED) then
MessageBox("Custom checkbox checked", 0);
endif;
‎Nov 03, 2011
12:44 PM
That doesn't seem to be the correct way to refer to that dialog. :confused:
Does anyone know if we are on the right path, but just not referring to the SQLServerSelect Dialog correctly? Or is there another way to get the value of the checkbox I've added to that dialog?
The (name) of the checkbox is CheckBox1, its Control Identifier is 17818.
The Dialog name seems to be DialogId_10110 and it's Resourse Identifier is 10110.
Thanks in advance for any ideas...
bob
Does anyone know if we are on the right path, but just not referring to the SQLServerSelect Dialog correctly? Or is there another way to get the value of the checkbox I've added to that dialog?
The (name) of the checkbox is CheckBox1, its Control Identifier is 17818.
The Dialog name seems to be DialogId_10110 and it's Resourse Identifier is 10110.
Thanks in advance for any ideas...
bob
‎Nov 03, 2011
03:16 PM
1. Is there a SQL connection added under SQL Scripts? If not, please add one even though you won't use it as SQL Functions are used in conjunction with SQL Connection.
2. My code below is probably incorrect because when you click Next dialog has already been dismissed so it returns nothing. What I mean by that is CtrlGetState needs to be called before your dialog is dismissed; for SQLServerSelect, make a copy of SQLServerSelect source code, refer to script\isrt\src directory of your InstallShield dir, add this code in your project and add the CtrlGetState call to that copy perhaps under SD_PBUT_CONTINUE.
Also, I think before calling SQLServerSelect, there needs to be SQLRTInitialize2(); similar to OnSQLLogin(). Let's worry about it if the first two steps above don't work.
2. My code below is probably incorrect because when you click Next dialog has already been dismissed so it returns nothing. What I mean by that is CtrlGetState needs to be called before your dialog is dismissed; for SQLServerSelect, make a copy of SQLServerSelect source code, refer to script\isrt\src directory of your InstallShield dir, add this code in your project and add the CtrlGetState call to that copy perhaps under SD_PBUT_CONTINUE.
Also, I think before calling SQLServerSelect, there needs to be SQLRTInitialize2(); similar to OnSQLLogin(). Let's worry about it if the first two steps above don't work.
‎Nov 04, 2011
09:17 AM
Bob,
Don't know if this helps, but every time I customize the SQL dialog (ex: adding checkboxes and other controls), I have needed to add this sort of code
inside the dialog's script file. I generally use SQLServerSelectLoginEx2 but the process should be the same for SLQServerSelect:
1. Copy this file to your project directory and rename it (ex: customSQLServerSelect.rul)
C:\Program Files\InstallShield\2010\Script\Isrt\src\SQLServerSelect.rul
2. Change the function name of "SQLServerSelect" to something else (ex: ShowDialog_SQLServerSelect)
3. Use this code inside the new file to access the checkbox value (assuming you have defined ENCRYPTCHECKBOX and nState in this file):
4. In your Setup.rul file, change the SQL function call (which is currently "nResult = SQLServerSelect( szMsg, szServer );" to whatever you changed the function name to (in step 2. above).
5. In your Setup.rul file, add an #include filename.rul line for the file you copied to your project directory (in step 1. above).
Hopefully that gets you most of the way there.
HTH
Don't know if this helps, but every time I customize the SQL dialog (ex: adding checkboxes and other controls), I have needed to add this sort of code
nState = CtrlGetState("DialogId_10110", ENCRYPTCHECKBOX);
inside the dialog's script file. I generally use SQLServerSelectLoginEx2 but the process should be the same for SLQServerSelect:
1. Copy this file to your project directory and rename it (ex: customSQLServerSelect.rul)
C:\Program Files\InstallShield\2010\Script\Isrt\src\SQLServerSelect.rul
2. Change the function name of "SQLServerSelect" to something else (ex: ShowDialog_SQLServerSelect)
3. Use this code inside the new file to access the checkbox value (assuming you have defined ENCRYPTCHECKBOX and nState in this file):
nState = CtrlGetState(DLG_SQLSELECT, ENCRYPTCHECKBOX);
4. In your Setup.rul file, change the SQL function call (which is currently "nResult = SQLServerSelect( szMsg, szServer );" to whatever you changed the function name to (in step 2. above).
5. In your Setup.rul file, add an #include filename.rul line for the file you copied to your project directory (in step 1. above).
Hopefully that gets you most of the way there.
HTH