PDA

View Full Version : Pulling Data from Standard Dialogs



scbutler1
07-18-2005, 02:09 PM
All,

I am working with InstallShield 11, MSI Project and I am writing some custom InstallScript code to pull the SQLSERVER name and the User Name and Password from the SQLServerSelectLoginDlg. I have customized the standard dialog by giving the Text fields better names DBServerName,DNUserName, DBPassword.

I am using the following functions to pull the information

CtrlGetCurSel(szDialogName,RES_EDITDATABASENAME,szDatabaseName);
CtrlGetText(szDialogName,RES_EDITUSERNAME,szUserName);
CtrlGetText(szDialogName,RES_EDITPASSWORD,szPassword);

Since I cannot return a string value from these functions, I am assuming that I should use the string variables szDatabaseName,szUserName and szPassword to get the values from these fields. Am I correct in this assumption? Is there a better way of accomplishing this?

I am extremly frustrated with this stupid scripting language.

Any and all help is appreciated.

Thanks!

DMorisseau
07-18-2005, 03:22 PM
You can use MSIGetProperty to retrieve the server name and other properties once they have been set on the form. The syntax would be

MSIGetProperty(hMSI, "IS_SQLSERVER_SERVER",szServerName,nBuffSize).
MSIGetProperty(hMSI,"IS_SQLSERVER_DATABASE",szDatabaseName,nBuffSize)
and so on for the Authentication Method, User Id, and Password

The scripting language is a little hairy, but keep in mind that a lot of what IS is presenting in the dialogs are being stored in MSI properties, and you just need to pull the values out of those properties.

scbutler1
07-18-2005, 03:59 PM
Ive got the code setup in a seperate rul file that my setup.rul is calling. WHen I complie the file with the function, everything compiles fine. However, when I include the file in my setup.rul, i get errors that say:

"MSIGetProperty : undefined identifier"

I know that I am missing something, but im not sure what. Any thoughts?

DMorisseau
07-18-2005, 06:05 PM
My bad, the correct syntax is nResult = MsiGetProperty(hMSI,szPropertyName,szPropertyStr,nBuffSize)

if Nresult < 0 then there was an error retrieving the property

You also need to make sure you have #include "iswi.h" in your rul file.

The Windows Installer help gives more information on how to use MsiGetProperty and MsiSetProperty