Best way to check if SQL CE is installed, and if so, which version?

I wrote a VB.NET application that uses SQL CE 3.5. I am wondering if anyone has any best practice or code to check if A) SQL CE is installed, and B) If so, which version.

I was looking for msdn and google for anything, but I did not find anything useful. I tore through the registry and found this key: HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SQL Server Compact Edition \ v3.5 with the string value "Version" and the data was 3.5.5692.0.

So with a bat, my guess is to check for the presence of this key, but it bothers me because the "3.5" key is sure it looks like it is bound to a 3.5 DLL. What I'm trying to say, I would not want to force someone to install SQL 3.5 if they have SQL CE (insert some future version of CE here).

Additional Information: Target Structure: .NET 2.0 Minimum Target OS: Windows XP SP2

+3
source share
5 answers

- (GUID), MSI. , MSI Orca ( Windows SDK) GUID. , , , pre-req, VS2005/2008 .

, , , .

+1

BlackWasp, SqlServerCe- . , (SDF ), .

, .

+1

. 5 , . , .

defacto:

  • Assuming that the program is installed properly is the responsibility of the installer of this function.
  • You ALWAYS want the end result to be that SQL Server CE is installed (even if the user is angry with the original installation)
  • It's only 5 megabytes (but you can still use downloads)

        DownloadUrl="http://download.microsoft.com/download/0/5/D/05DCCDB5-57E0-4314-A016-874F228A8FAD/SSCERuntime_x86-ENU.exe"
        SourceFile="SSCERuntime_x86-ENU.exe"
        Compressed="no"
    

This is my decision:

<PackageGroup Id="SQLExpressCE">
  <ExePackage
        Vital="yes"
        SourceFile="SSCERuntime_x86-ENU.exe"
        InstallCondition="NOT VersionNT64"

        //Include the exes(only about 2.5 megs each)
        //Setting this to no causes your bootstrapper to download on installation but since this will always be trying to install, it is probably best to include it
        Compressed="yes"

        //install quietly without an interface
        InstallCommand="/i /quiet /n"
        />
  <ExePackage
        Vital="yes"
        InstallCondition="VersionNT64" 
        SourceFile="SSCERuntime_x64-ENU.exe"
        Compressed="yes"
        InstallCommand="/i /quiet /n"
        />
</PackageGroup>
+1
source

OK, this answers only the first part of your question, but I hope it is so useful ... This is what I am using now:

<Fragment>
    <util:RegistrySearch
          Id='SearchForSQLCE'
          Variable="SQLCEInstalled"
          Result="exists"
          Root="HKLM"
          Key="SOFTWARE\Classes\Microsoft SQL Server Compact Edition Database File"
          Win64="yes"
               />
  </Fragment>
0
source

Source: https://habr.com/ru/post/1699011/


All Articles