diff --git a/NOTICE.md b/NOTICE.md index f15c440cc9..f5b54b4268 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -181,7 +181,7 @@ SOFTWARE. ``` -## {fmt} +## {fmt} **Source**: https://github.com/fmtlib/fmt diff --git a/build/scripts/Generate-ThirdPartyNotices.ps1 b/build/scripts/Generate-ThirdPartyNotices.ps1 new file mode 100644 index 0000000000..16c456525a --- /dev/null +++ b/build/scripts/Generate-ThirdPartyNotices.ps1 @@ -0,0 +1,14 @@ +[CmdletBinding()] +Param( + [Parameter(Position=0, Mandatory=$true)][string]$MarkdownNoticePath, + [Parameter(Position=1, Mandatory=$true)][string]$OutputPath +) + +@" + + Third-Party Notices + + $(ConvertFrom-Markdown $MarkdownNoticePath | Select -Expand Html) + + +"@ | Out-File -Encoding UTF-8 $OutputPath -Force diff --git a/src/cascadia/CascadiaPackage/NOTICE.html b/src/cascadia/CascadiaPackage/NOTICE.html new file mode 100644 index 0000000000..f272cda840 --- /dev/null +++ b/src/cascadia/CascadiaPackage/NOTICE.html @@ -0,0 +1,16 @@ + + Placeholder 3rd-party Notices + +

Windows Terminal (Dev)

+

+ This is a development build of Windows Terminal. The third-party notices + for this project can be found on + the + project's GitHub page. +

+

+ During a branded release build, this file is replaced with the content of + NOTICES.md from the root of the repository. +

+ + diff --git a/src/cascadia/CascadiaResources.build.items b/src/cascadia/CascadiaResources.build.items index 49996fc9c6..6e54d09f8c 100644 --- a/src/cascadia/CascadiaResources.build.items +++ b/src/cascadia/CascadiaResources.build.items @@ -1,6 +1,11 @@ + + + true + %(FileName)%(Extension) + true diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index d7a15836f6..d9e58dda2c 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -18,8 +18,6 @@ #include "TabRowControl.h" #include "DebugTapConnection.h" -#include "CurrentCommitHash.h" // For the about dialog's ThirdPartyNotices link - using namespace winrt; using namespace winrt::Windows::Foundation::Collections; using namespace winrt::Windows::UI::Xaml; @@ -256,10 +254,11 @@ namespace winrt::TerminalApp::implementation return RS_(L"ApplicationVersionUnknown"); } - winrt::hstring TerminalPage::ThirdPartyNoticesLink() + void TerminalPage::_ThirdPartyNoticesOnClick(const IInspectable& /*sender*/, const Windows::UI::Xaml::RoutedEventArgs& /*eventArgs*/) { - winrt::hstring link{ fmt::format(L"https://github.com/microsoft/terminal/blob/{}/NOTICE.md", CurrentCommitHash) }; - return link; + std::filesystem::path currentPath{ wil::GetModuleFileNameW(nullptr) }; + currentPath.replace_filename(L"NOTICE.html"); + ShellExecute(nullptr, nullptr, currentPath.c_str(), nullptr, nullptr, SW_SHOW); } // Method Description: diff --git a/src/cascadia/TerminalApp/TerminalPage.h b/src/cascadia/TerminalApp/TerminalPage.h index ff561f1642..daf81e7ee0 100644 --- a/src/cascadia/TerminalApp/TerminalPage.h +++ b/src/cascadia/TerminalApp/TerminalPage.h @@ -108,6 +108,7 @@ namespace winrt::TerminalApp::implementation void _FeedbackButtonOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs); void _AboutButtonOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs); void _CloseWarningPrimaryButtonOnClick(Windows::UI::Xaml::Controls::ContentDialog sender, Windows::UI::Xaml::Controls::ContentDialogButtonClickEventArgs eventArgs); + void _ThirdPartyNoticesOnClick(const IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& eventArgs); void _HookupKeyBindings(TerminalApp::AppKeyBindings bindings) noexcept; void _RegisterActionCallbacks(); diff --git a/src/cascadia/TerminalApp/TerminalPage.idl b/src/cascadia/TerminalApp/TerminalPage.idl index ec7e261ba8..dc4b7820d6 100644 --- a/src/cascadia/TerminalApp/TerminalPage.idl +++ b/src/cascadia/TerminalApp/TerminalPage.idl @@ -17,8 +17,6 @@ namespace TerminalApp String ApplicationDisplayName { get; }; String ApplicationVersion { get; }; - String ThirdPartyNoticesLink { get; }; - event Windows.Foundation.TypedEventHandler TitleChanged; event Windows.Foundation.TypedEventHandler LastTabClosed; event Windows.Foundation.TypedEventHandler SetTitleBarContent; diff --git a/src/cascadia/TerminalApp/TerminalPage.xaml b/src/cascadia/TerminalApp/TerminalPage.xaml index 3847216158..7e81388436 100644 --- a/src/cascadia/TerminalApp/TerminalPage.xaml +++ b/src/cascadia/TerminalApp/TerminalPage.xaml @@ -42,7 +42,7 @@ the MIT License. See LICENSE in the project root for license information. --> NavigateUri="https://go.microsoft.com/fwlink/?linkid=2125418" /> + Click="_ThirdPartyNoticesOnClick" /> diff --git a/src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj b/src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj index 056786e142..a552e6cecb 100644 --- a/src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj +++ b/src/cascadia/TerminalApp/lib/TerminalAppLib.vcxproj @@ -330,8 +330,4 @@ - - - - diff --git a/tools/GenerateCommitHashHeader.ps1 b/tools/GenerateCommitHashHeader.ps1 deleted file mode 100644 index 4606017ce2..0000000000 --- a/tools/GenerateCommitHashHeader.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -# This script gets the current git commit hash and places it in a header file stamped to a wstring_view -# If we're unable to retrieve the hash, we'll return the hard coded string "master" instead. - -$filePath = "Generated Files\CurrentCommitHash.h" - -Write-Output "constexpr std::wstring_view CurrentCommitHash{ L`"" | Out-File -FilePath $filePath -Encoding ASCII -NoNewline - -# Let's see if we're on a build agent that can give us the commit hash through this predefined variable. -$hash = $env:Build_SourceVersion -if (-not $hash) -{ - # Otherwise attempt to invoke git to get the commit. - $hash = git rev-parse HEAD - if ($LASTEXITCODE -or -not $hash) - { - $hash = "master" - } -} - -$hash | Out-File -FilePath $filePath -Encoding ASCII -Append -NoNewline -Write-Output "`" };" | Out-File -FilePath $filePath -Encoding ASCII -Append -NoNewline