Skip to content

Commit 4619641

Browse files
furmangg_cpfurmangg_cp
authored andcommitted
finalizing report fix code
improving SQL2016 and SQL2017 switching code to include registry
1 parent 1984159 commit 4619641

13 files changed

Lines changed: 20 additions & 75 deletions

BidsHelperPackage.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ private bool SwitchVsixManifest()
187187
string sPkgdef2016Path = sFolder + "\\BidsHelper2016.pkgdef";
188188
string sPkgdef2016BackupPath = sFolder + "\\BidsHelper2016.pkgdef.bak";
189189

190+
string sDll2016Path = sFolder + "\\SQL2016\\BidsHelper2016.dll";
191+
190192
if (System.IO.File.Exists(sOtherManifestPath) && System.IO.File.Exists(sPkgdef2016BackupPath) && System.IO.File.Exists(sPkgdef2017Path))
191193
{
192194
//backup the current SQL2017 manifest
@@ -205,6 +207,11 @@ private bool SwitchVsixManifest()
205207
else
206208
System.IO.File.Move(sPkgdef2017Path, sPkgdef2017BackupPath);
207209

210+
//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?
211+
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\14.0_Config\Packages\{" + PackageGuidString +"}", true);
212+
regKey.SetValue("CodeBase", sDll2016Path, Microsoft.Win32.RegistryValueKind.String);
213+
regKey.Close();
214+
208215
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");
209216
return true;
210217
}
@@ -227,6 +234,8 @@ private bool SwitchVsixManifest()
227234
string sPkgdef2016Path = sFolder + "\\BidsHelper2016.pkgdef";
228235
string sPkgdef2016BackupPath = sFolder + "\\BidsHelper2016.pkgdef.bak";
229236

237+
string sDll2017Path = sFolder + "\\BidsHelper2017.dll";
238+
230239
if (System.IO.File.Exists(sOtherManifestPath) && System.IO.File.Exists(sPkgdef2017BackupPath) && System.IO.File.Exists(sPkgdef2016Path))
231240
{
232241
//backup the current SQL2016 manifest
@@ -245,6 +254,11 @@ private bool SwitchVsixManifest()
245254
else
246255
System.IO.File.Move(sPkgdef2016Path, sPkgdef2016BackupPath);
247256

257+
//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?
258+
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\14.0_Config\Packages\{" + PackageGuidString +"}", true);
259+
regKey.SetValue("CodeBase", sDll2017Path, Microsoft.Win32.RegistryValueKind.String);
260+
regKey.Close();
261+
248262
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");
249263
return true;
250264
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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)