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
- :
- Re: How do I get the SQL Server Name
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 05, 2011
12:14 PM
How do I get the SQL Server Name
I'm using an Installscript MSI installation. I need to retrieve the SQL Server name. It seems to be stored in the MSI property IS_SQLSERVER_SERVER, but when I perform the following MSIGetProperty command the szSQLServer variable is empty.
MsiGetProperty(ISMSI_HANDLE, "IS_SQLSERVER_SERVER", szSQLServer, nvBuffer);
MsiGetProperty(ISMSI_HANDLE, "[IS_SQLSERVER_SERVER]", szSQLServer, nvBuffer);
I have used the property at other parts of the installation, but I need to get access to it via script.
Thanks,
Robert McMahan
MsiGetProperty(ISMSI_HANDLE, "IS_SQLSERVER_SERVER", szSQLServer, nvBuffer);
MsiGetProperty(ISMSI_HANDLE, "[IS_SQLSERVER_SERVER]", szSQLServer, nvBuffer);
I have used the property at other parts of the installation, but I need to get access to it via script.
Thanks,
Robert McMahan
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 05, 2011
03:29 PM
When are you calling the MsiGetProperty function? (OnFirstUIBefore/OnFirstUIAfter/etc) As far as I know, there are some places where calling it doesn't work: ex: OnFirstUIAfter, OnResumeUIAfter, OnAbort.
Also, is your nvBuffer set before calling MsiGetProperty? If that is the only variable you are using for getting property values, it has to be reset between each call.
Ex:
nvBuffer = 256;
MsiGetProperty(ISMSI_HANDLE, "IS_SQLSERVER_SERVER", szSQLServer, nvBuffer);
nvBuffer = 256;
MsiGetProperty(ISMSI_HANDLE, "[IS_SQLSERVER_SERVER]", szSQLServer, nvBuffer);
Also, is your nvBuffer set before calling MsiGetProperty? If that is the only variable you are using for getting property values, it has to be reset between each call.
Ex:
nvBuffer = 256;
MsiGetProperty(ISMSI_HANDLE, "IS_SQLSERVER_SERVER", szSQLServer, nvBuffer);
nvBuffer = 256;
MsiGetProperty(ISMSI_HANDLE, "[IS_SQLSERVER_SERVER]", szSQLServer, nvBuffer);
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 05, 2011
03:56 PM
In the Dialogs view of the IS IDE, click on the combobox control that the server\instance appears in during the UI sequence. Determine the Property name assigned to that combobox...it's possible that it's not IS_SQLSERVER_SERVER.
When you have that, make sure that you're adding that Property name to CustomActionData so that your Deferred Action will be able to read it.
When you have that, make sure that you're adding that Property name to CustomActionData so that your Deferred Action will be able to read it.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 06, 2011
11:57 AM
I'm currently calling it in OnFirstUIBefore, but I would prefer to call it in MyFeature_Installed. The problem that I had in callling it in OnFirstUIBefore was that I didn't init nvBuffer. Unfortunatly, performing the same code in MyFeature_Installed does not work. I get a ERROR_SUCCESS value in my return so I believe that the MSIGetProperty function believes that it has worked properly, but the value for server is blank. I guess that the property has been cleared at some point. It looks as though I'm going to have to modify the OnSQLLogin function to store the information in a global variable for use in the MyFeature_Installed. Not the best solution, but I need the information after the files have been copied, and I don't want to prompt the user for the it twice.
Thanks for the help,
Robert McMahan
Thanks for the help,
Robert McMahan
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)