Skip to content

Commit 6da238b

Browse files
committed
2 parents a1a01c8 + 949c915 commit 6da238b

76 files changed

Lines changed: 1785 additions & 274 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: 111 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,115 @@ 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 BI Dev Extensions 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 + "\\SQL2017\\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+
//VS2017 seems to use the registry after the first run to denote which DLL to launch
280+
//the 15.0* hive is special in that it is actually "C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\15.0_31028247\privateregistry.bin"
281+
//if you want to view this in regedit then close all VS2017 and go to HKEY_LOCAL_MACHINE... File... Load Hive... choose that privateregistry.bin
282+
//remember to click on the new hive folder and do File... Unload Hive before trying to open VS2017
283+
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\15.0_Config\Packages\{" + PackageGuidString + "}", true);
284+
if (regKey != null)
285+
{
286+
regKey.SetValue("CodeBase", sDll2017Path, Microsoft.Win32.RegistryValueKind.String);
287+
regKey.Close();
288+
}
289+
290+
System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BI Developer Extensions can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper");
291+
return true;
292+
}
293+
else
294+
{
295+
throw new Exception("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed but we couldn't find BIDS Helper 2017 files!");
296+
}
297+
}
298+
#elif SQL2017 && VS2017
299+
string sVersion = VersionInfo.SqlServerVersion.ToString();
300+
if (sVersion.StartsWith("15.")) //this BI Dev Extensions DLL is for SQL 2017 but you have SSDT for SQL2019 installed
301+
{
302+
string sFolder = System.IO.Directory.GetParent(System.IO.Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName).FullName;
303+
string sManifestPath = sFolder + "\\extension.vsixmanifest";
304+
string sBackupManifestPath = sFolder + "\\extension2017.vsixmanifest";
305+
string sOtherManifestPath = sFolder + "\\extension2019.vsixmanifest";
306+
307+
string sPkgdef2019Path = sFolder + "\\BidsHelper2019.pkgdef";
308+
string sPkgdef2019BackupPath = sFolder + "\\BidsHelper2019.pkgdef.bak";
309+
string sPkgdef2017Path = sFolder + "\\BidsHelper2017.pkgdef";
310+
string sPkgdef2017BackupPath = sFolder + "\\BidsHelper2017.pkgdef.bak";
311+
312+
string sDll2019Path = sFolder + "\\BidsHelper2019.dll";
313+
314+
if (System.IO.File.Exists(sOtherManifestPath) && System.IO.File.Exists(sPkgdef2019BackupPath) && System.IO.File.Exists(sPkgdef2017Path))
315+
{
316+
//backup the current SQL2017 manifest
317+
System.IO.File.Copy(sManifestPath, sBackupManifestPath, true);
318+
319+
//copy SQL2019 manifest over the current manifest
320+
System.IO.File.Copy(sOtherManifestPath, sManifestPath, true);
321+
322+
if (System.IO.File.Exists(sPkgdef2019Path))
323+
System.IO.File.Delete(sPkgdef2019BackupPath);
324+
else
325+
System.IO.File.Move(sPkgdef2019BackupPath, sPkgdef2019Path);
326+
327+
if (System.IO.File.Exists(sPkgdef2017BackupPath))
328+
System.IO.File.Delete(sPkgdef2017Path);
329+
else
330+
System.IO.File.Move(sPkgdef2017Path, sPkgdef2017BackupPath);
331+
332+
//VS2017 seems to use the registry after the first run to denote which DLL to launch
333+
//the 15.0* hive is special in that it is actually "C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\15.0_31028247\privateregistry.bin"
334+
//if you want to view this in regedit then close all VS2017 and go to HKEY_LOCAL_MACHINE... File... Load Hive... choose that privateregistry.bin
335+
//remember to click on the new hive folder and do File... Unload Hive before trying to open VS2017
336+
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\15.0_Config\Packages\{" + PackageGuidString + "}", true);
337+
if (regKey != null)
338+
{
339+
regKey.SetValue("CodeBase", sDll2019Path, Microsoft.Win32.RegistryValueKind.String);
340+
regKey.Close();
341+
}
342+
343+
System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BI Developer Extensions can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper");
344+
return true;
345+
}
346+
else
347+
{
348+
throw new Exception("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed but we couldn't find BIDS Helper 2019 files!");
349+
}
350+
}
351+
#elif SQL2017 && !VS2017
244352
string sVersion = VersionInfo.SqlServerVersion.ToString();
245353
if (sVersion.StartsWith("13.")) //this DLL is for SQL 2017 but you have SSDT for SQL2016 installed
246354
{
@@ -282,7 +390,7 @@ private bool SwitchVsixManifest()
282390
regKey.Close();
283391
}
284392

285-
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");
393+
System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BI Developer Extensions can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper");
286394
return true;
287395
}
288396
else
@@ -332,7 +440,7 @@ private bool SwitchVsixManifest()
332440
regKey.Close();
333441
}
334442

335-
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");
443+
System.Windows.Forms.MessageBox.Show("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed. Please restart Visual Studio so BI Developer Extensions can reconfigure itself to work properly with that version of SSDT.", "BIDS Helper");
336444
return true;
337445
}
338446
else

Core/Options/BIDSHelperOptionsVersionCheckPage.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class VersionInfo
99
{
1010
// BIDS Helper Assembly & VSIX Version
1111
// N.B. Manually update the manifest file, if you change this - See source.extension.vsixmanifest
12-
public const string Version = "2.1.1";
12+
public const string Version = "2.2.1";
1313

1414
private static readonly object lockResource = new object();
1515
private static Version visualStudioVersion;
@@ -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
}

DLLs/SQL2019/ExpressionEditor.dll

146 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)