Does anybody have a SQL 2005 Native Client dependency?
Or how would I check if it is already installed? That would be enough for the first shot.
How would I most rapidly create one if I never coded a setup before?
Chris
Professional Software Development Tools
Does anybody have a SQL 2005 Native Client dependency?
Or how would I check if it is already installed? That would be enough for the first shot.
How would I most rapidly create one if I never coded a setup before?
Chris
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
ah, sounds good.
Can you point me to the path where I can find these entries. I'll then apply this to my driver.
Chris
(Click here to contact me)
Providing Independent Professional Consulting Services for
IndigoRose products, World Wide.
Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)
As it was asked for via PM following the code we came up with at that time.
We test against the registry "On Startup":
Code:-- check for SQL Native Client (2005) Result = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\ODBC\\ODBCINST.INI\\SQL Native Client", "Driver", true); if (Application.GetLastError() ~= 0) then Debug.Print "SQL Native Client 2005 not installed."; Result = ""; end SQLNCLIFile = Result; -- check for SQL Native Client (2008) Result = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\ODBC\\ODBCINST.INI\\SQL Server Native Client 10.0", "Driver", true); if (Application.GetLastError() ~= 0) then Debug.Print "SQL Native Client 2008 not installed."; Result = ""; end SQLNCLI10File = Result; SessionVar.Set("%InstallNativeClient%", "true"); SessionVar.Set("%NativeClient%", ""); --find Native Client File if (File.DoesExist(SQLNCLIFile)) then SessionVar.Set("%InstallNativeClient%", "false"); SessionVar.Set("%NativeClient%", "SQL Native Client 2005"); end if (File.DoesExist(SQLNCLI10File)) then SessionVar.Set("%InstallNativeClient%", "false"); SessionVar.Set("%NativeClient%", "SQL Server Native Client 2008"); end
And "On PreInstall" we install the Native Client if necessary (for the right processor architecture) - in this case, always the 2005 version is used:
HTH,Code:-- Start Native Client 2005 Setup if necessary if (SessionVar.Expand("%InstallNativeClient%") == "true") then local sqlncli_file = "sqlncli.msi" if System.Is64BitOS() then sqlncli_file = "sqlncli_x64.msi" end Param = "/I " .. String.Char(34) .. _TempLaunchFolder .. "\\" .. sqlncli_file .. String.Char(34) .. "/passive /LWAMOE c:\\install.log ALLUSERS=1"; Debug.Print("Temp. Setup of SQL Native Client 2005:"); Debug.Print(Param); result = Shell.Execute(_SystemFolder .. "\\MSIEXEC.EXE", "open", Param, "", SW_SHOWNORMAL, true); Debug.Print("MSI Setup Result:"); Debug.Print(result); -- check registry again to verify Native Client installation; Exit Setup if negative Result = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\ODBC\\ODBCINST.INI\\SQL Native Client", "Driver", true); if (Application.GetLastError() ~= 0) then Dialog.Message("Setup Error", "SQL Native Client 2005 could not be installed...", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1); Application.Exit(0); end SQLNCLIFile = Result; --find sqlncli exe if (File.DoesExist(SQLNCLIFile)) then SessionVar.Set("%NativeClient%", "SQL Native Client 2005"); else Dialog.Message("Setup Warning", "SQL Native Client not found. Please install manually after Setup", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); --Application.Exit(0); end end
Chris