Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2008
    Posts
    3

    SQLNCLI Dependency

    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

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Quote Originally Posted by chriswies View Post
    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
    What I always look for 1st is to see if there's an Uninstall entry in the registry.
    If that's not enough; you'll need to find either a windows system32 file or a reg-entry that points to a file/directory so you can evaluate the dll/exe version# 's.


    (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)

  3. #3
    Join Date
    Jan 2008
    Posts
    3

    Uninstall-entry

    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

  4. #4
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Quote Originally Posted by chriswies View Post
    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
    Uninstall is stored in the registry.
    some where, here:
    HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uni nstall\\"


    (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)

  5. #5
    Join Date
    Jan 2008
    Posts
    3
    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:

    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
    HTH,

    Chris

Similar Threads

  1. Dependency Module: Microsoft .NET Framework 2.0
    By Adam in forum Setup Factory 8.0 Examples
    Replies: 30
    Last Post: 11-20-2009, 08:27 PM
  2. Dependency Module: Microsoft .NET Framework 1.1
    By Darryl in forum Setup Factory 8.0 Examples
    Replies: 12
    Last Post: 06-10-2008, 02:26 AM
  3. Dependency Module: MyODBC 3.51
    By TerryRogers in forum Setup Factory 8.0 Examples
    Replies: 1
    Last Post: 04-05-2006, 10:27 AM
  4. .NET 1.1 Dependency Script Questions
    By drpepper in forum Setup Factory 7.0
    Replies: 1
    Last Post: 01-03-2006, 02:04 PM
  5. Dependency Module: MDAC 2.8
    By Darryl in forum Setup Factory 8.0 Examples
    Replies: 0
    Last Post: 08-30-2004, 02:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts