cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Gyllencreutz
Level 3

SQLRTGetServers2() returns empty list

Hi,

Im writing a Custom Action[CA] that executes method SQLServerSelectLogin2(). I have done everything according to the manual and KB. SQLRT.obl and SQLCONV.obl is set in Build/Settings. I load the dlls (ISSQLSRV.DLL, SQLRT.DLL) from Binary table and executes SQLRTInitialize2() before SQLServerSelectLogin2().

Everything compiles with no errors and when debugging the dialog fires up but when I press the Browse database server button the list is empty.

When I add the SQLLogin dialog the same dialog is presented and when I press the button this time the Database server list is populated with our networks DB servers.

I did a processmon last night to see what happens in these 2 scenarios and the result is this:

******* Processmon on MsiExec.exe with my own CA ***********
16:43:30,4955332 MsiExec.exe 7852 QueryOpen C:\Windows\System32\odbc32.dll FAST IO DISALLOWED
16:43:30,4957302 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbc32.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
16:43:30,4959417 MsiExec.exe 7852 QueryBasicInformationFile C:\Windows\System32\odbc32.dll SUCCESS CreationTime: 2009-07-14 01:12:09, LastAccessTime: 2009-07-14 01:12:09, LastWriteTime: 2009-07-14 02:16:11, ChangeTime: 2009-09-10 09:30:54, FileAttributes: A
16:43:30,4959672 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbc32.dll SUCCESS
16:43:30,4962051 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbc32.dll SUCCESS Desired Access: Read Data/List Directory, Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened
16:43:30,4963968 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbc32.dll FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE
16:43:30,4964790 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbc32.dll SUCCESS SyncType: SyncTypeOther
16:43:30,4973835 MsiExec.exe 7852 Load Image C:\Windows\System32\odbc32.dll SUCCESS Image Base: 0x66560000, Image Size: 0x8a000
16:43:30,4974393 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbc32.dll SUCCESS
16:43:30,4978738 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\Microsoft\BidInterface\Loader NAME NOT FOUND Desired Access: Read
16:43:30,4995231 MsiExec.exe 7852 QueryOpen C:\Windows\System32\odbcint.dll FAST IO DISALLOWED
16:43:30,4996941 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbcint.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
16:43:30,4998814 MsiExec.exe 7852 QueryBasicInformationFile C:\Windows\System32\odbcint.dll SUCCESS CreationTime: 2009-07-14 01:11:56, LastAccessTime: 2009-07-14 01:11:56, LastWriteTime: 2009-07-14 02:09:14, ChangeTime: 2009-09-10 09:30:54, FileAttributes: A
16:43:30,4998938 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbcint.dll SUCCESS
16:43:30,5001132 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbcint.dll SUCCESS Desired Access: Read Data/List Directory, Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened
16:43:30,5003488 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbcint.dll FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE
16:43:30,5003963 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbcint.dll SUCCESS SyncType: SyncTypeOther
16:43:30,5012674 MsiExec.exe 7852 Load Image C:\Windows\System32\odbcint.dll SUCCESS Image Base: 0x669a0000, Image Size: 0x38000
16:43:30,5013571 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbcint.dll SUCCESS
16:43:30,5026036 MsiExec.exe 7852 RegOpenKey HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:43:30,5026502 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:43:30,5026766 MsiExec.exe 7852 RegOpenKey HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:43:30,5026885 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:43:32,7212433 msiexec.exe 1072 Thread Create SUCCESS Thread ID: 2316
******************* Full process list *********************

******* Processmon on MsiExec.exe with SQLLogin ***********
16:44:46,9362877 MsiExec.exe 7852 QueryOpen C:\Windows\System32\odbc32.dll FAST IO DISALLOWED
16:44:46,9362952 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbc32.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
16:44:46,9362974 MsiExec.exe 7852 QueryBasicInformationFile C:\Windows\System32\odbc32.dll SUCCESS CreationTime: 2009-07-14 01:12:09, LastAccessTime: 2009-07-14 01:12:09, LastWriteTime: 2009-07-14 02:16:11, ChangeTime: 2009-09-10 09:30:54, FileAttributes: A
16:44:46,9362992 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbc32.dll SUCCESS
16:44:46,9370075 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbc32.dll SUCCESS Desired Access: Read Data/List Directory, Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened
16:44:46,9370673 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbc32.dll FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE
16:44:46,9377146 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbc32.dll SUCCESS SyncType: SyncTypeOther
16:44:46,9395270 MsiExec.exe 7852 Load Image C:\Windows\System32\odbc32.dll SUCCESS Image Base: 0x66560000, Image Size: 0x8a000
16:44:46,9400335 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbc32.dll SUCCESS
16:44:46,9404970 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\Microsoft\BidInterface\Loader NAME NOT FOUND Desired Access: Read
16:44:46,9430147 MsiExec.exe 7852 QueryOpen C:\Windows\System32\odbcint.dll FAST IO DISALLOWED
16:44:46,9430323 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbcint.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
16:44:46,9430565 MsiExec.exe 7852 QueryBasicInformationFile C:\Windows\System32\odbcint.dll SUCCESS CreationTime: 2009-07-14 01:11:56, LastAccessTime: 2009-07-14 01:11:56, LastWriteTime: 2009-07-14 02:09:14, ChangeTime: 2009-09-10 09:30:54, FileAttributes: A
16:44:46,9430754 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbcint.dll SUCCESS
16:44:46,9436413 MsiExec.exe 7852 CreateFile C:\Windows\System32\odbcint.dll SUCCESS Desired Access: Read Data/List Directory, Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened
16:44:46,9438370 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbcint.dll FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: PAGE_EXECUTE
16:44:46,9438950 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\odbcint.dll SUCCESS SyncType: SyncTypeOther
16:44:46,9449468 MsiExec.exe 7852 Load Image C:\Windows\System32\odbcint.dll SUCCESS Image Base: 0x669a0000, Image Size: 0x38000
16:44:46,9450127 MsiExec.exe 7852 CloseFile C:\Windows\System32\odbcint.dll SUCCESS
16:44:46,9460517 MsiExec.exe 7852 RegOpenKey HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:44:46,9460935 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:44:46,9461177 MsiExec.exe 7852 RegOpenKey HKCU\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:44:46,9461296 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read
16:44:46,9522450 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\Microsoft\Microsoft SQL Server SUCCESS Desired Access: Read
16:44:46,9522841 MsiExec.exe 7852 RegQueryValue HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances SUCCESS Type: REG_MULTI_SZ, Length: 24, Data: SQLEXPRESS
16:44:46,9523092 MsiExec.exe 7852 RegQueryValue HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances SUCCESS Type: REG_MULTI_SZ, Length: 24, Data: SQLEXPRESS
16:44:46,9523650 MsiExec.exe 7852 RegCloseKey HKLM\SOFTWARE\Microsoft\Microsoft SQL Server SUCCESS
16:44:46,9534766 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo NAME NOT FOUND Desired Access: Read
16:44:46,9538512 MsiExec.exe 7852 CreateFile C:\Windows\System32\sv-SE\KernelBase.dll.mui SUCCESS Desired Access: Generic Read, Disposition: Open, Options: , Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened
16:44:46,9538565 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\sv-SE\KernelBase.dll.mui FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: PAGE_WRITECOPY
16:44:46,9538600 MsiExec.exe 7852 QueryStandardInformationFile C:\Windows\System32\sv-SE\KernelBase.dll.mui SUCCESS AllocationSize: 811*008, EndOfFile: 808*448, NumberOfLinks: 2, DeletePending: False, Directory: False
16:44:46,9538653 MsiExec.exe 7852 CreateFileMapping C:\Windows\System32\sv-SE\KernelBase.dll.mui SUCCESS SyncType: SyncTypeOther
16:44:46,9550876 MsiExec.exe 7852 RegOpenKey HKLM\software\odbc\odbc.ini\ODBC Data Sources SUCCESS Desired Access: Read
16:44:46,9551263 MsiExec.exe 7852 RegEnumValue HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources SUCCESS Index: 0, Name: Xtreme Sample Database 11.5, Type: REG_SZ, Length: 64, Data: Microsoft Access Driver (*.mdb)
16:44:46,9551474 MsiExec.exe 7852 RegEnumValue HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources SUCCESS Index: 0, Name: Xtreme Sample Database 11.5, Type: REG_SZ, Length: 64, Data: Microsoft Access Driver (*.mdb)
16:44:46,9551628 MsiExec.exe 7852 RegEnumValue HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources SUCCESS Index: 1, Name: Xtreme Sample Database 2008, Type: REG_SZ, Length: 64, Data: Microsoft Access Driver (*.mdb)
16:44:46,9551839 MsiExec.exe 7852 RegEnumValue HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources SUCCESS Index: 1, Name: Xtreme Sample Database 2008, Type: REG_SZ, Length: 64, Data: Microsoft Access Driver (*.mdb)
16:44:46,9551967 MsiExec.exe 7852 RegEnumValue HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources SUCCESS Index: 2, Name: Xtreme-exempeldatabas 11.5, Type: REG_SZ, Length: 64, Data: Microsoft Access Driver (*.mdb)
16:44:46,9552059 MsiExec.exe 7852 RegEnumValue HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources SUCCESS Index: 2, Name: Xtreme-exempeldatabas 11.5, Type: REG_SZ, Length: 64, Data: Microsoft Access Driver (*.mdb)
16:44:46,9552178 MsiExec.exe 7852 RegEnumValue HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources NO MORE ENTRIES Index: 3, Length: 782
16:44:46,9552314 MsiExec.exe 7852 RegCloseKey HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources SUCCESS
16:44:46,9563676 MsiExec.exe 7852 RegOpenKey HKCU\software\odbc\odbc.ini\ODBC Data Sources NAME NOT FOUND Desired Access: Read
16:44:46,9632401 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\ODBC\ODBCINST.INI\SQL Server SUCCESS Desired Access: Read
16:44:46,9632916 MsiExec.exe 7852 RegQueryValue HKLM\SOFTWARE\ODBC\ODBCINST.INI\SQL Server\Driver SUCCESS Type: REG_EXPAND_SZ, Length: 62, Data: %WINDIR%\system32\SQLSRV32.dll
16:44:46,9633184 MsiExec.exe 7852 RegCloseKey HKLM\SOFTWARE\ODBC\ODBCINST.INI\SQL Server SUCCESS
16:44:46,9636271 MsiExec.exe 7852 QueryOpen C:\Windows\System32\sqlsrv32.dll FAST IO DISALLOWED
16:44:46,9638403 MsiExec.exe 7852 CreateFile C:\Windows\System32\sqlsrv32.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened
********** The list is longer *************************

As you can see the first 23 lines are exactly the same but the 24th and last line on my CA is:
16:43:32,7212433 msiexec.exe 1072 Thread Create SUCCESS Thread ID: 2316

and on SQLLogin the 24th line is:
16:44:46,9522450 MsiExec.exe 7852 RegOpenKey HKLM\SOFTWARE\Microsoft\Microsoft SQL Server SUCCESS Desired Access: Read

Im out of ideas and I can't find any post on the web that I haven't read already. :confused:

//Gyllencreutz
Labels (1)
0 Kudos
(4) Replies
hidenori
Level 17

You simply need to add a connection to the SQL Scripts view in order to have the SQLLogin Windows Installer dialog (Basic MSI project) or the SQLServerSelectLogin InstallScript dialog (InstallScript MSI project) working in your setup. InstallShield automatically adds the built-in SQL Scripts support to your project. You do not need to author your own custom action to create the dialog.

Hope that helps.
0 Kudos
Gyllencreutz
Level 3

Ok thanks.

I had one problem with that though and its the possibility to move the dialog where I want it to appear or rather When to appear. I don't want my users to be obligated to fill in the SQL information instead I want it to be shown when the user choose custom setup. I tried to change the order of SQLLogin to appear after custom setup but I get a message that some SQL information is missing before the dialog appears.
I rearranged the order in ControlEvent Table to show SQLLogin after 'Next' click on CustomSetup and the order looks fine in MSI debugger Window but something is wrong I guess.

Is there some other way to rearrange the dialog order other than ControlEvent Table? I cant do it from Custom Actions and Sequences window. Its only possible to move top lvl dialogs and actions up and down but sub dialogs aren't. Why is that?

//G
0 Kudos
hidenori
Level 17

That is how Windows Installer manages the user interface. If you do not like that method, you may want to consider using an InstallScript or InstallScript MSI project which uses InstallScript dialogs.
0 Kudos
Gyllencreutz
Level 3

That might be true but it did work with the LogonInformation dialog. I had no problem moving it by changing the "next" dialog in ControlEvent Table to get the dialog where I wanted it. I only have problem moving SQLLogin that only works where it is placed initially. Its not that big of a problem, me and our users can probably live with that.

And maybe I'm doing something wrong :rolleyes:.

Anyway.

Thanks for the help and pointers Hidenori! 🙂
0 Kudos