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
- :
- Get the value from dialog??
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2009
12:59 AM
Get the value from dialog??
Hi,
Could anyone at least show me how to pass value from a textbox in a dialog to installscripts ?
say like, i have my own dialog which creates a new sql database. How can it pass the value input from the dialog to my custom install script
function CreateDatabase(HWND)
begin
// how to get the value database name from the textbox here ??
end;
Many thanks.
Could anyone at least show me how to pass value from a textbox in a dialog to installscripts ?
say like, i have my own dialog which creates a new sql database. How can it pass the value input from the dialog to my custom install script
function CreateDatabase(HWND)
begin
// how to get the value database name from the textbox here ??
end;
Many thanks.
(11) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2009
02:25 AM
Hi,
Set the textbox value to a property say "DBNAME". Then use the code given below to get the value of the property "DBNAME" using MsiGetProperty function in installscript. The "DbName" identifier in installscript will hold the value of database name from the dialog.:D
function CreateDatabase(HWND)
STRING DbName;
NUMBER nLength;
begin
// how to get the value database name from the textbox here ??
MsiGetProperty(hMSI, "DBNAME", DbName, nLength);
end;
Hope this will help!!!!!
Set the textbox value to a property say "DBNAME". Then use the code given below to get the value of the property "DBNAME" using MsiGetProperty function in installscript. The "DbName" identifier in installscript will hold the value of database name from the dialog.:D
function CreateDatabase(HWND)
STRING DbName;
NUMBER nLength;
begin
// how to get the value database name from the textbox here ??
MsiGetProperty(hMSI, "DBNAME", DbName, nLength);
end;
Hope this will help!!!!!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 12, 2009
02:27 AM
create a dialog with a text box in it. Check the control identifier of the text box.
Go to the install script.
define a macro for your text box.
e.g.
#define TXT_DB_NAME 1302
//here 1302 is your control identifier
again during dialog init use the following code :
case DLG_INIT:
CtrlSetText("AskSQLDBName",TXT_db_NAME, gszSQLDBName);
after that you can use the gszSQLDBName variable anywhere in the code to pass the value. This variable will store the value entered in the text box.
Hope this will help. please let me know if you need any help.
Go to the install script.
define a macro for your text box.
e.g.
#define TXT_DB_NAME 1302
//here 1302 is your control identifier
again during dialog init use the following code :
case DLG_INIT:
CtrlSetText("AskSQLDBName",TXT_db_NAME, gszSQLDBName);
after that you can use the gszSQLDBName variable anywhere in the code to pass the value. This variable will store the value entered in the text box.
Hope this will help. please let me know if you need any help.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
12:47 AM
Thanks for your reply, it helps me alot. But as i've learnt, Basic MSI doesn't have resource ID, so simply no way to achieve that, doesn't it. I'll learn to use Installscript project anyway.
Btw, is there any auto method to create new sql user instead of writing in sql script? Also, samething for creating a windows user and NTFS permission.
Just show me the function name or a solution, i can do the rest.
Thanks again.
Btw, is there any auto method to create new sql user instead of writing in sql script? Also, samething for creating a windows user and NTFS permission.
Just show me the function name or a solution, i can do the rest.
Thanks again.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
02:02 AM
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
02:16 AM
I think you are using the InstallShield for visual studio 2005.
its showing for me here.
Can you tell what project type you are using?
is it installscript msi or basic msi?
its showing for me here.
Can you tell what project type you are using?
is it installscript msi or basic msi?
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
02:26 AM
installscript has control ID but basic MSI doesn't. Now I switch to Installscript project.
Btw, do you know how to create a windows user and set a NTFS permission for it on a folder ? Somehow, IS lacks of a decent documentation on many important features, it's hard for us, newbies, to comprehend the system.
Btw, do you know how to create a windows user and set a NTFS permission for it on a folder ? Somehow, IS lacks of a decent documentation on many important features, it's hard for us, newbies, to comprehend the system.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
02:57 AM
you can create the windows user using the following command using command prompt:
NET USER /add
you can either directly execute this command using installscript or you can create a batch file and then execute it through IS using following options:
LaunchAppAndWait( " NET USER ", " /add" , LAAW_OPTION_WAIT);
or
LaunchAppAndWait( " createuser.bat ", " " , LAAW_OPTION_WAIT);
Hope this will help. also i also need to check how to add NTFS perm.
Thanks
NET USER
you can either directly execute this command using installscript or you can create a batch file and then execute it through IS using following options:
LaunchAppAndWait( " NET USER ", "
or
LaunchAppAndWait( " createuser.bat ", " " , LAAW_OPTION_WAIT);
Hope this will help. also i also need to check how to add NTFS perm.
Thanks
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 13, 2009
04:05 AM
wow, it's great. So LaunchAppAndWait basically can call out other application while running? I can code to add NTFS or win user via my c# app. I'm gonna give it a try.
Thanks alot for your help again.
Thanks alot for your help again.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2009
02:03 AM
matviet,
Your screenshot of the dialog looks just like mine (IS 2009 Pro, basic MSI).
I have checked chandanOmkar's screen shot of property list, but i don't seem to have the 'control identifier' field for text box.
Anyway, in your text box screen shot, i see a field called 'property' which has a value of 'ip'. I have used this field in all my installers to retrieve values.
Make sure the property is capital.. IP or DBNAME or whatever it stands for, and use MsiGetProperty, just like rajeevgc suggested.
MsiGetProperty(hMSI, "DBNAME", DbName, nLength);
where DbName variable now holds the value you read from the property 'DBNAME', which you can now use in rest of your installscript.
cheers!
Your screenshot of the dialog looks just like mine (IS 2009 Pro, basic MSI).
I have checked chandanOmkar's screen shot of property list, but i don't seem to have the 'control identifier' field for text box.
Anyway, in your text box screen shot, i see a field called 'property' which has a value of 'ip'. I have used this field in all my installers to retrieve values.
Make sure the property is capital.. IP or DBNAME or whatever it stands for, and use MsiGetProperty, just like rajeevgc suggested.
MsiGetProperty(hMSI, "DBNAME", DbName, nLength);
where DbName variable now holds the value you read from the property 'DBNAME', which you can now use in rest of your installscript.
cheers!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2009
02:33 AM
hey bornali,
the control identifier will not come in basic msi project, so if possible then move ti installscript project.
Thanks
the control identifier will not come in basic msi project, so if possible then move ti installscript project.
Thanks
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)