Skip to content

Commit

Permalink
Merge branch 'bidshelper-vsix'
Browse files Browse the repository at this point in the history
  • Loading branch information
furmangg committed Nov 20, 2018
2 parents e50982d + 3c6994a commit 3d4d9af
Show file tree
Hide file tree
Showing 62 changed files with 1,721 additions and 249 deletions.
Binary file added BidsHelper2017.pkgdef.bak
Binary file not shown.
114 changes: 111 additions & 3 deletions BidsHelperPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,115 @@ protected override void Initialize()

private bool SwitchVsixManifest()
{
#if SQL2017 && !VS2017
#if SQL2019
string sVersion = VersionInfo.SqlServerVersion.ToString();
if (sVersion.StartsWith("14.")) //this BI Dev Extensions DLL is for SQL 2019 but you have SSDT for SQL2017 installed
{
string sFolder = System.IO.Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
string sManifestPath = sFolder + "\\extension.vsixmanifest";
string sBackupManifestPath = sFolder + "\\extension2019.vsixmanifest";
string sOtherManifestPath = sFolder + "\\extension2017.vsixmanifest";

string sPkgdef2019Path = sFolder + "\\BidsHelper2019.pkgdef";
string sPkgdef2019BackupPath = sFolder + "\\BidsHelper2019.pkgdef.bak";
string sPkgdef2017Path = sFolder + "\\BidsHelper2017.pkgdef";
string sPkgdef2017BackupPath = sFolder + "\\BidsHelper2017.pkgdef.bak";

string sDll2017Path = sFolder + "\\SQL2017\\BidsHelper2017.dll";

if (System.IO.File.Exists(sOtherManifestPath) && System.IO.File.Exists(sPkgdef2017BackupPath) && System.IO.File.Exists(sPkgdef2019Path))
{
//backup the current SQL2019 manifest
System.IO.File.Copy(sManifestPath, sBackupManifestPath, true);

//copy SQL2017 manifest over the current manifest
System.IO.File.Copy(sOtherManifestPath, sManifestPath, true);

if (System.IO.File.Exists(sPkgdef2017Path))
System.IO.File.Delete(sPkgdef2017BackupPath);
else
System.IO.File.Move(sPkgdef2017BackupPath, sPkgdef2017Path);

if (System.IO.File.Exists(sPkgdef2019BackupPath))
System.IO.File.Delete(sPkgdef2019Path);
else
System.IO.File.Move(sPkgdef2019Path, sPkgdef2019BackupPath);



//VS2017 seems to use the registry after the first run to denote which DLL to launch
//the 15.0* hive is special in that it is actually "C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\15.0_31028247\privateregistry.bin"
//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
//remember to click on the new hive folder and do File... Unload Hive before trying to open VS2017
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\15.0_Config\Packages\{" + PackageGuidString + "}", true);
if (regKey != null)
{
regKey.SetValue("CodeBase", sDll2017Path, Microsoft.Win32.RegistryValueKind.String);
regKey.Close();
}

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");
return true;
}
else
{
throw new Exception("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed but we couldn't find BIDS Helper 2017 files!");
}
}
#elif SQL2017 && VS2017
string sVersion = VersionInfo.SqlServerVersion.ToString();
if (sVersion.StartsWith("15.")) //this BI Dev Extensions DLL is for SQL 2017 but you have SSDT for SQL2019 installed
{
string sFolder = System.IO.Directory.GetParent(System.IO.Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName).FullName;
string sManifestPath = sFolder + "\\extension.vsixmanifest";
string sBackupManifestPath = sFolder + "\\extension2017.vsixmanifest";
string sOtherManifestPath = sFolder + "\\extension2019.vsixmanifest";

string sPkgdef2019Path = sFolder + "\\BidsHelper2019.pkgdef";
string sPkgdef2019BackupPath = sFolder + "\\BidsHelper2019.pkgdef.bak";
string sPkgdef2017Path = sFolder + "\\BidsHelper2017.pkgdef";
string sPkgdef2017BackupPath = sFolder + "\\BidsHelper2017.pkgdef.bak";

string sDll2019Path = sFolder + "\\BidsHelper2019.dll";

if (System.IO.File.Exists(sOtherManifestPath) && System.IO.File.Exists(sPkgdef2019BackupPath) && System.IO.File.Exists(sPkgdef2017Path))
{
//backup the current SQL2017 manifest
System.IO.File.Copy(sManifestPath, sBackupManifestPath, true);

//copy SQL2019 manifest over the current manifest
System.IO.File.Copy(sOtherManifestPath, sManifestPath, true);

if (System.IO.File.Exists(sPkgdef2019Path))
System.IO.File.Delete(sPkgdef2019BackupPath);
else
System.IO.File.Move(sPkgdef2019BackupPath, sPkgdef2019Path);

if (System.IO.File.Exists(sPkgdef2017BackupPath))
System.IO.File.Delete(sPkgdef2017Path);
else
System.IO.File.Move(sPkgdef2017Path, sPkgdef2017BackupPath);

//VS2017 seems to use the registry after the first run to denote which DLL to launch
//the 15.0* hive is special in that it is actually "C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\15.0_31028247\privateregistry.bin"
//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
//remember to click on the new hive folder and do File... Unload Hive before trying to open VS2017
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\15.0_Config\Packages\{" + PackageGuidString + "}", true);
if (regKey != null)
{
regKey.SetValue("CodeBase", sDll2019Path, Microsoft.Win32.RegistryValueKind.String);
regKey.Close();
}

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");
return true;
}
else
{
throw new Exception("You have SSDT for SQL Server " + VersionInfo.SqlServerFriendlyVersion + " installed but we couldn't find BIDS Helper 2019 files!");
}
}
#elif SQL2017 && !VS2017
string sVersion = VersionInfo.SqlServerVersion.ToString();
if (sVersion.StartsWith("13.")) //this DLL is for SQL 2017 but you have SSDT for SQL2016 installed
{
Expand Down Expand Up @@ -282,7 +390,7 @@ private bool SwitchVsixManifest()
regKey.Close();
}

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");
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");
return true;
}
else
Expand Down Expand Up @@ -332,7 +440,7 @@ private bool SwitchVsixManifest()
regKey.Close();
}

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");
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");
return true;
}
else
Expand Down
2 changes: 1 addition & 1 deletion Core/Options/BIDSHelperOptionsVersionCheckPage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 24 additions & 22 deletions Core/Options/BIDSHelperOptionsVersionCheckPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,27 +173,29 @@ private void BIDSHelperOptionsVersionCheckPage_Load(object sender, EventArgs e)
}


try
{
VersionCheckPlugin.Instance.LastVersionCheck = DateTime.Today;
if (!VersionCheckPlugin.VersionIsLatest(VersionCheckPlugin.LocalVersion, VersionCheckPlugin.Instance.ServerVersion))
{
lblServerVersion.Text = "Version " + VersionCheckPlugin.Instance.ServerVersion + " is available...";
lblServerVersion.Visible = true;
linkNewVersion.Visible = true;
}
else
{
lblServerVersion.Text = "BIDS Helper is up to date.";
lblServerVersion.Visible = true;
linkNewVersion.Visible = false;
}
}
catch (Exception ex)
{
lblServerVersion.Text = "Unable to retrieve current available BIDS Helper version from Codeplex: " + ex.Message + "\r\n" + ex.StackTrace;
linkNewVersion.Visible = false;
}
lblServerVersion.Visible = false;
linkNewVersion.Visible = false;
//try
//{
// //VersionCheckPlugin.Instance.LastVersionCheck = DateTime.Today;
// //if (!VersionCheckPlugin.VersionIsLatest(VersionCheckPlugin.LocalVersion, VersionCheckPlugin.Instance.ServerVersion))
// //{
// // lblServerVersion.Text = "Version " + VersionCheckPlugin.Instance.ServerVersion + " is available...";
// // lblServerVersion.Visible = true;
// // linkNewVersion.Visible = true;
// //}
// //else
// //{
// // lblServerVersion.Text = "BIDS Helper is up to date.";
// // lblServerVersion.Visible = true;
// // linkNewVersion.Visible = false;
// //}
//}
//catch (Exception ex)
//{
// lblServerVersion.Text = "Unable to retrieve current available BIDS Helper version from Codeplex: " + ex.Message + "\r\n" + ex.StackTrace;
// linkNewVersion.Visible = false;
//}
}
catch (Exception ex)
{
Expand All @@ -218,7 +220,7 @@ private void linkLabelCodePlexUrl_LinkClicked(object sender, LinkLabelLinkClicke
/// <param name="e">The <see cref="System.Windows.Forms.LinkLabelLinkClickedEventArgs"/> instance containing the event data.</param>
private void linkNewVersion_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
OpenUrl(VersionCheckPlugin.BIDS_HELPER_RELEASE_URL);
//OpenUrl(VersionCheckPlugin.BIDS_HELPER_RELEASE_URL);
}

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion Core/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class VersionInfo
{
// BIDS Helper Assembly & VSIX Version
// N.B. Manually update the manifest file, if you change this - See source.extension.vsixmanifest
public const string Version = "2.1.1";
public const string Version = "2.2.0";

private static readonly object lockResource = new object();
private static Version visualStudioVersion;
Expand Down Expand Up @@ -129,6 +129,8 @@ public static string SqlServerFriendlyVersion
return "2016";
else if (sVersion.StartsWith("14."))
return "2017";
else if (sVersion.StartsWith("15."))
return "2019";
else
return string.Format("(SQL Unknown {0})", sVersion);
}
Expand Down
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.
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.
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.
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.
2 changes: 1 addition & 1 deletion Manifest/SQL2017/VSPackageVS2017.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>BI Developer Extensions 2017 Extension</value>
</data>
<data name="112" xml:space="preserve">
<value>BI Developer Extensions 2017 Visual Studio Extension v2.1.1 - An add-in to extend SQL Server Data Tools</value>
<value>BI Developer Extensions 2017 Visual Studio Extension v2.2.0 - An add-in to extend SQL Server Data Tools</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
Expand Down
2 changes: 1 addition & 1 deletion Manifest/SQL2017/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.1.1" Language="en-US" Publisher="bideveloperextensions.github.io" />
<Identity Id="BIDSHelper_VSIX.b6deed2d-6c6f-46d4-94be-28027bf7d873" Version="2.2.0" Language="en-US" Publisher="bideveloperextensions.github.io" />
<DisplayName>BI Developer Extensions for Visual Studio 2017</DisplayName>
<Description xml:space="preserve">BI Developer Extensions (formerly BIDS Helper) is an extension for BIDS / SSDT that includes numerous enhancements for SQL Server BI projects</Description>
<MoreInfo>https://bideveloperextensions.github.io</MoreInfo>
Expand Down
6 changes: 4 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[assembly: AssemblyProduct("BI Developer Extensions")]
[assembly: AssemblyDescription("BI Developer Extensions (formerly BIDS Helper) provides additional useful features to SQL Server Data Tools")]
[assembly: AssemblyCompany("https://bideveloperextensions.github.io")]
[assembly: AssemblyCopyright("Copyright © 2017 BI Developer Extensions")]
[assembly: AssemblyCopyright("Copyright © 2018 BI Developer Extensions")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -18,7 +18,9 @@
[assembly: CLSCompliant(false)]
[assembly: NeutralResourcesLanguage("en-US")]

#if SQL2017
#if SQL2019
[assembly: AssemblyTitle("BI Developer Extensions for SQL Server 2019")]
#elif SQL2017
[assembly: AssemblyTitle("BI Developer Extensions for SQL Server 2017")]
#elif SQL2016
[assembly: AssemblyTitle("BI Developer Extensions for SQL Server 2016")]
Expand Down
35 changes: 35 additions & 0 deletions SQL2017_BidsHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,41 @@
<Content Include="DLLs\SQL2017\Reference\Microsoft.ReportViewer.ProcessingObjectModel.AppLocal.dll" />
<Content Include="DLLs\SQL2017\Reference\Microsoft.ReportViewer.Winforms.AppLocal.dll" />
<Content Include="DLLs\SQL2017\Reference\Microsoft.SqlServer.GridControl.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AdomdClient.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AppLocal.AdomdClient.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AppLocal.Core.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AppLocal.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.AppLocal.Tabular.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.BackEnd.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Common.FrontEnd.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Controls.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Design.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.MPFProjectBase.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Project.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Server.Tabular.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.Server.Tabular.Json.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.AnalysisServices.VSHost.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.DataTransformationServices.Controls.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.DataTransformationServices.Design.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.DataTransformationServices.VsIntegration.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.DataWarehouse.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.DataWarehouse.Interfaces.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.DataWarehouse.VsIntegration.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.ReportViewer.Common.AppLocal.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.ReportViewer.DataVisualization.AppLocal.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.ReportViewer.Design.AppLocal.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.ReportViewer.ProcessingObjectModel.AppLocal.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.ReportViewer.Winforms.AppLocal.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.DlgGrid.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.Dts.Design.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SQLServer.DTSPipelineWrap.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.DTSRuntimeWrap.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.ExecPackageTaskWrap.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.Graph.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.GridControl.dll" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.IntegrationServices.Design.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.IntegrationServices.Graph.DLL" />
<Content Include="DLLs\SQL2019\Reference\Microsoft.SqlServer.ManagedDTS.dll" />
<Content Include="License.rtf">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
Expand Down
3 changes: 3 additions & 0 deletions SQL2017_BidsHelper.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<StartProgram>C:\Program Files %28x86%29\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
Loading

0 comments on commit 3d4d9af

Please sign in to comment.