Skip to content

Commit f323d59

Browse files
committed
progress on fixing VS2017 with latest SQL2019 SSDT version
1 parent 3d88aec commit f323d59

48 files changed

Lines changed: 1650 additions & 219 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BidsHelper2017.pkgdef.bak

4.51 KB
Binary file not shown.

BidsHelperPackage.cs

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,109 @@ protected override void Initialize()
240240

241241
private bool SwitchVsixManifest()
242242
{
243-
#if SQL2017 && !VS2017
243+
#if SQL2019
244+
string sVersion = VersionInfo.SqlServerVersion.ToString();
245+
if (sVersion.StartsWith("14.")) //this DLL is for SQL 2019 but you have SSDT for SQL2017 installed
246+
{
247+
string sFolder = System.IO.Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
248+
string sManifestPath = sFolder + "\\extension.vsixmanifest";
249+
string sBackupManifestPath = sFolder + "\\extension2019.vsixmanifest";
250+
string sOtherManifestPath = sFolder + "\\extension2017.vsixmanifest";
251+
252+
string sPkgdef2019Path = sFolder + "\\BidsHelper2019.pkgdef";
253+
string sPkgdef2019BackupPath = sFolder + "\\BidsHelper2019.pkgdef.bak";
254+
string sPkgdef2017Path = sFolder + "\\BidsHelper2017.pkgdef";
255+
string sPkgdef2017BackupPath = sFolder + "\\BidsHelper2017.pkgdef.bak";
256+
257+
////string sDll2017Path = sFolder + "\\SQL2016\\BidsHelper2017.dll";
258+
259+
if (System.IO.File.Exists(sOtherManifestPath) && System.IO.File.Exists(sPkgdef2017BackupPath) && System.IO.File.Exists(sPkgdef2019Path))
260+
{
261+
//backup the current SQL2019 manifest
262+
System.IO.File.Copy(sManifestPath, sBackupManifestPath, true);
263+
264+
//copy SQL2017 manifest over the current manifest
265+
System.IO.File.Copy(sOtherManifestPath, sManifestPath, true);
266+
267+
if (System.IO.File.Exists(sPkgdef2017Path))
268+
System.IO.File.Delete(sPkgdef2017BackupPath);
269+
else
270+
System.IO.File.Move(sPkgdef2017BackupPath, sPkgdef2017Path);
271+
272+
if (System.IO.File.Exists(sPkgdef2019BackupPath))
273+
System.IO.File.Delete(sPkgdef2019Path);
274+
else
275+
System.IO.File.Move(sPkgdef2019Path, sPkgdef2019BackupPath);
276+
277+
278+
279+
////////it looks like some earlier versions of VS2015 use the registry while newer versions of VS2015 (like Update 3) just use the vsixmanifest and pkgdef files?
280+
//////Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\14.0_Config\Packages\{" + PackageGuidString +"}", true);
281+
//////if (regKey != null)
282+
//////{
283+
////// regKey.SetValue("CodeBase", sDll2017Path, Microsoft.Win32.RegistryValueKind.String);
284+
////// regKey.Close();
285+
//////}
286+
287+
System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BIDS Helper can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper");
288+
return true;
289+
}
290+
else
291+
{
292+
throw new Exception("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed but we couldn't find BIDS Helper 2017 files!");
293+
}
294+
}
295+
#elif SQL2017 && VS2017
296+
string sVersion = VersionInfo.SqlServerVersion.ToString();
297+
if (sVersion.StartsWith("15.")) //this BI Dev Extensions DLL is for SQL 2017 but you have SSDT for SQL2019 installed
298+
{
299+
string sFolder = System.IO.Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
300+
string sManifestPath = sFolder + "\\extension.vsixmanifest";
301+
string sBackupManifestPath = sFolder + "\\extension2017.vsixmanifest";
302+
string sOtherManifestPath = sFolder + "\\extension2019.vsixmanifest";
303+
304+
string sPkgdef2019Path = sFolder + "\\BidsHelper2019.pkgdef";
305+
string sPkgdef2019BackupPath = sFolder + "\\BidsHelper2019.pkgdef.bak";
306+
string sPkgdef2017Path = sFolder + "\\BidsHelper2017.pkgdef";
307+
string sPkgdef2017BackupPath = sFolder + "\\BidsHelper2017.pkgdef.bak";
308+
309+
////string sDll2017Path = sFolder + "\\SQL2017\\BidsHelper2017.dll";
310+
311+
if (System.IO.File.Exists(sOtherManifestPath) && System.IO.File.Exists(sPkgdef2019BackupPath) && System.IO.File.Exists(sPkgdef2017Path))
312+
{
313+
//backup the current SQL2017 manifest
314+
System.IO.File.Copy(sManifestPath, sBackupManifestPath, true);
315+
316+
//copy SQL2019 manifest over the current manifest
317+
System.IO.File.Copy(sOtherManifestPath, sManifestPath, true);
318+
319+
if (System.IO.File.Exists(sPkgdef2019Path))
320+
System.IO.File.Delete(sPkgdef2019BackupPath);
321+
else
322+
System.IO.File.Move(sPkgdef2019BackupPath, sPkgdef2019Path);
323+
324+
if (System.IO.File.Exists(sPkgdef2017BackupPath))
325+
System.IO.File.Delete(sPkgdef2017Path);
326+
else
327+
System.IO.File.Move(sPkgdef2017Path, sPkgdef2017BackupPath);
328+
329+
////////it looks like some earlier versions of VS2015 use the registry while newer versions of VS2015 (like Update 3) just use the vsixmanifest and pkgdef files?
330+
//////Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\14.0_Config\Packages\{" + PackageGuidString +"}", true);
331+
//////if (regKey != null)
332+
//////{
333+
////// regKey.SetValue("CodeBase", sDll2017Path, Microsoft.Win32.RegistryValueKind.String);
334+
////// regKey.Close();
335+
//////}
336+
337+
System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BIDS Helper can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper");
338+
return true;
339+
}
340+
else
341+
{
342+
throw new Exception("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed but we couldn't find BIDS Helper 2019 files!");
343+
}
344+
}
345+
#elif SQL2017 && !VS2017
244346
string sVersion = VersionInfo.SqlServerVersion.ToString();
245347
if (sVersion.StartsWith("13.")) //this DLL is for SQL 2017 but you have SSDT for SQL2016 installed
246348
{

Core/Options/BIDSHelperOptionsVersionCheckPage.cs

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -173,27 +173,29 @@ private void BIDSHelperOptionsVersionCheckPage_Load(object sender, EventArgs e)
173173
}
174174

175175

176-
try
177-
{
178-
VersionCheckPlugin.Instance.LastVersionCheck = DateTime.Today;
179-
if (!VersionCheckPlugin.VersionIsLatest(VersionCheckPlugin.LocalVersion, VersionCheckPlugin.Instance.ServerVersion))
180-
{
181-
lblServerVersion.Text = "Version " + VersionCheckPlugin.Instance.ServerVersion + " is available...";
182-
lblServerVersion.Visible = true;
183-
linkNewVersion.Visible = true;
184-
}
185-
else
186-
{
187-
lblServerVersion.Text = "BIDS Helper is up to date.";
188-
lblServerVersion.Visible = true;
189-
linkNewVersion.Visible = false;
190-
}
191-
}
192-
catch (Exception ex)
193-
{
194-
lblServerVersion.Text = "Unable to retrieve current available BIDS Helper version from Codeplex: " + ex.Message + "\r\n" + ex.StackTrace;
195-
linkNewVersion.Visible = false;
196-
}
176+
lblServerVersion.Visible = false;
177+
linkNewVersion.Visible = false;
178+
//try
179+
//{
180+
// //VersionCheckPlugin.Instance.LastVersionCheck = DateTime.Today;
181+
// //if (!VersionCheckPlugin.VersionIsLatest(VersionCheckPlugin.LocalVersion, VersionCheckPlugin.Instance.ServerVersion))
182+
// //{
183+
// // lblServerVersion.Text = "Version " + VersionCheckPlugin.Instance.ServerVersion + " is available...";
184+
// // lblServerVersion.Visible = true;
185+
// // linkNewVersion.Visible = true;
186+
// //}
187+
// //else
188+
// //{
189+
// // lblServerVersion.Text = "BIDS Helper is up to date.";
190+
// // lblServerVersion.Visible = true;
191+
// // linkNewVersion.Visible = false;
192+
// //}
193+
//}
194+
//catch (Exception ex)
195+
//{
196+
// lblServerVersion.Text = "Unable to retrieve current available BIDS Helper version from Codeplex: " + ex.Message + "\r\n" + ex.StackTrace;
197+
// linkNewVersion.Visible = false;
198+
//}
197199
}
198200
catch (Exception ex)
199201
{
@@ -218,7 +220,7 @@ private void linkLabelCodePlexUrl_LinkClicked(object sender, LinkLabelLinkClicke
218220
/// <param name="e">The <see cref="System.Windows.Forms.LinkLabelLinkClickedEventArgs"/> instance containing the event data.</param>
219221
private void linkNewVersion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
220222
{
221-
OpenUrl(VersionCheckPlugin.BIDS_HELPER_RELEASE_URL);
223+
//OpenUrl(VersionCheckPlugin.BIDS_HELPER_RELEASE_URL);
222224
}
223225

224226
/// <summary>

Core/VersionInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ public static string SqlServerFriendlyVersion
129129
return "2016";
130130
else if (sVersion.StartsWith("14."))
131131
return "2017";
132+
else if (sVersion.StartsWith("15."))
133+
return "2019";
132134
else
133135
return string.Format("(SQL Unknown {0})", sVersion);
134136
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
694 KB
Binary file not shown.
1.48 MB
Binary file not shown.

0 commit comments

Comments
 (0)