Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

35sp1 crash fix #64

Merged
merged 2 commits into from
May 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/GUI/SqlCe35Toolbox/Dialogs/AboutDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,22 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
}

txtStatus.Text += "\n\nSQL Server Compact 3.5 in GAC - ";
var sqlce35Ver = new Version(0,0,0);
try
{
Assembly asm35 = System.Reflection.Assembly.Load("System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(asm35.Location);
string version = fvi.FileVersion;
txtStatus.Text += string.Format("Yes - {0}\n", version.ToString());
var asm35 = Assembly.Load("System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
var fvi = FileVersionInfo.GetVersionInfo(asm35.Location);
sqlce35Ver = new Version(fvi.FileVersion);
txtStatus.Text += string.Format("Yes - {0}\n", sqlce35Ver);
}
catch (System.IO.FileNotFoundException)
catch (FileNotFoundException)
{
txtStatus.Text += "No\n";
}
if (sqlce35Ver > new Version(0,0,0) && sqlce35Ver < new Version(3, 5, 8080))
{
txtStatus.Text += "(Too old version installed, update to 3.5 SP2)\n";
}

txtStatus.Text += "SQL Server Compact 3.5 DbProvider - ";
try
Expand Down
13 changes: 12 additions & 1 deletion src/GUI/SqlCe35Toolbox/Helpers/DataConnectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using ErikEJ.SQLiteScripting;
using System.Data.SqlClient;
using System.Data.SQLite;
using System.Diagnostics;
using Microsoft.VisualStudio.Shell;

namespace ErikEJ.SqlCeToolbox.Helpers
Expand Down Expand Up @@ -782,7 +783,17 @@ internal static bool IsV40Installed()

internal static bool IsV35Installed()
{
return new SqlCeHelper4().IsV35Installed();
try
{
var asm35 = Assembly.Load("System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
var fvi = FileVersionInfo.GetVersionInfo(asm35.Location);
var version = new Version(fvi.FileVersion);
return version >= new Version(3, 5, 8080);
}
catch (System.IO.FileNotFoundException)
{
return false;
}
}

internal static bool IsV40DbProviderInstalled()
Expand Down