System.Data.SQLite

Check-in [463c0eb0ca]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bugfixes and 64-bit support
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 463c0eb0ca36218bcd49fd4d1dd18923ba25bf88
User & Date: rmsimpson 2006-02-13 04:54:38.000
Context
2006-02-13
04:54
no message check-in: 3269002736 user: rmsimpson tags: sourceforge
04:54
Bugfixes and 64-bit support check-in: 463c0eb0ca user: rmsimpson tags: sourceforge
04:54
Schema fixes check-in: 14a95defbf user: rmsimpson tags: sourceforge
Changes
Unified Diff Ignore Whitespace Patch
Changes to tools/install/InstallDesigner.cs.
23
24
25
26
27
28
29


30

31












32











































33
34
35
36
37
38
39
    private static Guid standardDataProviderGuid = new Guid("{0EBAAB6E-CA80-4b4a-8DDF-CBE6BF058C70}");
    private static Guid standardDataSourcesGuid = new Guid("{0EBAAB6E-CA80-4b4a-8DDF-CBE6BF058C71}");
    private static Guid standardCFDataSourcesGuid = new Guid("{0EBAAB6E-CA80-4b4a-8DDF-CBE6BF058C72}");
    private static Guid oledbDataProviderGuid = new Guid("{7F041D59-D76A-44ed-9AA2-FBF6B0548B80}");
    private static Guid oledbAltDataProviderGuid = new Guid("{7F041D59-D76A-44ed-9AA2-FBF6B0548B81}");
    private static Guid jetDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC3}");
    private static Guid jetAltDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC4}");


    private static System.Reflection.Assembly assm = System.Reflection.Assembly.LoadFrom("..\\System.Data.SQLite.DLL");














    private bool _ignoreChecks = true;












































    public InstallDesigner()
    {
      InitializeComponent();
    }

    private void InstallDesigner_Load(object sender, EventArgs e)







>
>
|
>

>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
    private static Guid standardDataProviderGuid = new Guid("{0EBAAB6E-CA80-4b4a-8DDF-CBE6BF058C70}");
    private static Guid standardDataSourcesGuid = new Guid("{0EBAAB6E-CA80-4b4a-8DDF-CBE6BF058C71}");
    private static Guid standardCFDataSourcesGuid = new Guid("{0EBAAB6E-CA80-4b4a-8DDF-CBE6BF058C72}");
    private static Guid oledbDataProviderGuid = new Guid("{7F041D59-D76A-44ed-9AA2-FBF6B0548B80}");
    private static Guid oledbAltDataProviderGuid = new Guid("{7F041D59-D76A-44ed-9AA2-FBF6B0548B81}");
    private static Guid jetDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC3}");
    private static Guid jetAltDataSourcesGuid = new Guid("{466CE797-67A4-4495-B75C-A3FD282E7FC4}");
    private static string[] compactFrameworks = new string[] { "PocketPC", "SmartPhone", "WindowsCE" };

    private static System.Reflection.Assembly assm = null;
    private bool _ignoreChecks = true;

    static InstallDesigner()
    {
      if (assm == null)
      {
        try
        {
          assm = System.Reflection.Assembly.LoadFrom("..\\System.Data.SQLite.DLL");
        }
        catch
        {
        }
      }

      if (assm == null)
      {
        try
        {
          assm = System.Reflection.Assembly.LoadFrom("..\\x64\\System.Data.SQLite.DLL");
        }
        catch
        {
        }
      }

      if (assm == null)
      {
        try
        {
          assm = System.Reflection.Assembly.LoadFrom("..\\itanium\\System.Data.SQLite.DLL");
        }
        catch
        {
        }
      }

      OpenFileDialog dlg = new OpenFileDialog();
      while (assm == null)
      {
        dlg.Multiselect = false;
        dlg.InitialDirectory = Environment.CurrentDirectory;
        dlg.FileName = "System.Data.SQLite.DLL";
        dlg.Filter = "System.Data.SQLite.DLL|System.Data.SQLite.DLL";
        if (dlg.ShowDialog() == DialogResult.OK)
        {
          try
          {
            assm = System.Reflection.Assembly.LoadFrom(dlg.FileName);
          }
          catch
          {
          }
        }
        else
          throw new ArgumentException("Unable to find or load System.Data.SQLite.DLL");
      }
    }

    public InstallDesigner()
    {
      InitializeComponent();
    }

    private void InstallDesigner_Load(object sender, EventArgs e)
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
          install = true;
          break;
        }
      }

      if (install && !installed)
      {
        AssemblyCache.InstallAssembly("..\\System.Data.SQLite.DLL", null, AssemblyCommitFlags.Default);
      }
      else if (!install && installed)
      {
        System.Reflection.AssemblyName name = assm.GetName();
        AssemblyCacheUninstallDisposition disp;
        AssemblyCache.UninstallAssembly(name.FullName + ", ProcessorArchitecture=" + name.ProcessorArchitecture, null, out disp);
      }







|







205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
          install = true;
          break;
        }
      }

      if (install && !installed)
      {
        AssemblyCache.InstallAssembly(assm.Location, null, AssemblyCommitFlags.Default);
      }
      else if (!install && installed)
      {
        System.Reflection.AssemblyName name = assm.GetName();
        AssemblyCacheUninstallDisposition disp;
        AssemblyCache.UninstallAssembly(name.FullName + ", ProcessorArchitecture=" + name.ProcessorArchitecture, null, out disp);
      }
271
272
273
274
275
276
277
















































278
279
280
281
282
283
284
          subkey.SetValue(null, "SQLite Database File");
          using (RegistryKey subsubkey = subkey.CreateSubKey("SupportingProviders", RegistryKeyPermissionCheck.ReadWriteSubTree))
          {
            subsubkey.CreateSubKey(provider.ToString("B")).Close();
          }
        }
      }

















































#if USEPACKAGE
      using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\Packages", keyname), true))
      {
        using (RegistryKey subkey = key.CreateSubKey("{DCBE6C8D-0E57-4099-A183-98FF74C64D9C}", RegistryKeyPermissionCheck.ReadWriteSubTree))
        {
          subkey.SetValue(null, "SQLite Designer Package");







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
          subkey.SetValue(null, "SQLite Database File");
          using (RegistryKey subsubkey = subkey.CreateSubKey("SupportingProviders", RegistryKeyPermissionCheck.ReadWriteSubTree))
          {
            subsubkey.CreateSubKey(provider.ToString("B")).Close();
          }
        }
      }

      for (int n = 0; n < compactFrameworks.Length; n++)
      {
        using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\.NETCompactFramework\\v2.0.0.0\\{0}\\DataProviders", compactFrameworks[n]), true))
        {
          if (key != null)
          {
            using (RegistryKey subkey = key.CreateSubKey(standardDataProviderGuid.ToString("B"), RegistryKeyPermissionCheck.ReadWriteSubTree))
            {
              subkey.SetValue(null, ".NET Framework Data Provider for SQLite");
              subkey.SetValue("InvariantName", "System.Data.SQLite");
              subkey.SetValue("RuntimeAssembly", "System.Data.SQLite.DLL");
            }
          }
        }
      }

      string path = Path.GetDirectoryName(assm.Location);

      while (path.Length > 0)
      {
        if (File.Exists(path + "\\CompactFramework\\System.Data.SQLite.DLL") == false)
        {
          path = Path.GetDirectoryName(path);
        }
        else break;
      }

      if (path.Length > 0)
      {
        path += "\\CompactFramework\\";

        for (int n = 0; n < compactFrameworks.Length; n++)
        {
          using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\.NETCompactFramework\\v2.0.0.0\\{0}\\AssemblyFoldersEx", compactFrameworks[n]), true))
          {

            if (key != null)
            {
              using (RegistryKey subkey = key.CreateSubKey("SQLite", RegistryKeyPermissionCheck.ReadWriteSubTree))
              {
                subkey.SetValue(null, path);
              }
            }

          }
        }
      }

#if USEPACKAGE
      using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\Packages", keyname), true))
      {
        using (RegistryKey subkey = key.CreateSubKey("{DCBE6C8D-0E57-4099-A183-98FF74C64D9C}", RegistryKeyPermissionCheck.ReadWriteSubTree))
        {
          subkey.SetValue(null, "SQLite Designer Package");
386
387
388
389
390
391
392




























393
394
395
396
397
398
399
        {
          if (key != null) key.DeleteSubKeyTree(provider.ToString("B"));
        }
        using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\DataSources", keyname), true))
        {
          if (key != null) key.DeleteSubKeyTree(source.ToString("B"));
        }




























      }
      catch
      {
      }

      // Remove factory support from the development environment config file
      string xmlFileName;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
        {
          if (key != null) key.DeleteSubKeyTree(provider.ToString("B"));
        }
        using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\{0}\\8.0\\DataSources", keyname), true))
        {
          if (key != null) key.DeleteSubKeyTree(source.ToString("B"));
        }

        for (int n = 0; n < compactFrameworks.Length; n++)
        {
          using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\.NETCompactFramework\\v2.0.0.0\\{0}\\DataProviders", compactFrameworks[n]), true))
          {
            try
            {
              if (key != null) key.DeleteSubKey(standardDataProviderGuid.ToString("B"));
            }
            catch
            {
            }
          }
        }

        for (int n = 0; n < compactFrameworks.Length; n++)
        {
          using (RegistryKey key = Registry.LocalMachine.OpenSubKey(String.Format("Software\\Microsoft\\.NETCompactFramework\\v2.0.0.0\\{0}\\AssemblyFoldersEx", compactFrameworks[n]), true))
          {
            try
            {
              if (key != null) key.DeleteSubKey("SQLite");
            }
            catch
            {
            }
          }
        }
      }
      catch
      {
      }

      // Remove factory support from the development environment config file
      string xmlFileName;
Changes to tools/install/install.csproj.
14
15
16
17
18
19
20

21
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\..\bin\designer\</OutputPath>
    <DefineConstants>TRACE;DEBUG;NUSEPACKAGE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>

  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\..\bin\designer\</OutputPath>
    <DefineConstants>TRACE;NUSEPACKAGE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <FileAlignment>512</FileAlignment>

  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />







>









>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\..\bin\designer\</OutputPath>
    <DefineConstants>TRACE;DEBUG;NUSEPACKAGE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>..\..\bin\designer\</OutputPath>
    <DefineConstants>TRACE;NUSEPACKAGE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <FileAlignment>512</FileAlignment>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />