diff --git a/support/hololens/ServoApp/BrowserPage.cpp b/support/hololens/ServoApp/BrowserPage.cpp index daf29c27340..6147c9d3f82 100644 --- a/support/hololens/ServoApp/BrowserPage.cpp +++ b/support/hololens/ServoApp/BrowserPage.cpp @@ -19,23 +19,6 @@ namespace winrt::ServoApp::implementation { BrowserPage::BrowserPage() { InitializeComponent(); BindServoEvents(); - if (!xrPkgChecker.IsInstalled()) { - XRPkgWarning().Visibility(Visibility::Visible); - xrPkgChecker.OnInstalled( - [=] { XRPkgWarning().Visibility(Visibility::Collapsed); }, - std::chrono::seconds{5}); - } -} - -void BrowserPage::OnXRPkgWarningDismissClick(IInspectable const &, - RoutedEventArgs const &) { - xrPkgChecker.StopTracking(); - XRPkgWarning().Visibility(Visibility::Collapsed); -} - -void BrowserPage::OnXRPkgWarningInstallClick(IInspectable const &, - RoutedEventArgs const &) { - xrPkgChecker.OpenStore(); } void BrowserPage::BindServoEvents() { diff --git a/support/hololens/ServoApp/BrowserPage.h b/support/hololens/ServoApp/BrowserPage.h index f0f1d49c482..92af23b7d05 100644 --- a/support/hololens/ServoApp/BrowserPage.h +++ b/support/hololens/ServoApp/BrowserPage.h @@ -5,7 +5,6 @@ #pragma once #include "BrowserPage.g.h" -#include "XRPkgChecker.h" #include "ServoControl\ServoControl.h" namespace winrt::ServoApp::implementation { @@ -37,10 +36,6 @@ public: void LoadServoURI(Windows::Foundation::Uri uri); void SetTransientMode(bool); void SetArgs(hstring); - void OnXRPkgWarningInstallClick(Windows::Foundation::IInspectable const &, - Windows::UI::Xaml::RoutedEventArgs const &); - void OnXRPkgWarningDismissClick(Windows::Foundation::IInspectable const &, - Windows::UI::Xaml::RoutedEventArgs const &); void OnMediaControlsPlayClicked(Windows::Foundation::IInspectable const &, Windows::UI::Xaml::RoutedEventArgs const &); void OnMediaControlsPauseClicked(Windows::Foundation::IInspectable const &, @@ -48,7 +43,6 @@ public: private: void BindServoEvents(); - XRPkgChecker xrPkgChecker; }; } // namespace winrt::ServoApp::implementation diff --git a/support/hololens/ServoApp/BrowserPage.xaml b/support/hololens/ServoApp/BrowserPage.xaml index f735e0ab993..e71208ea76c 100644 --- a/support/hololens/ServoApp/BrowserPage.xaml +++ b/support/hololens/ServoApp/BrowserPage.xaml @@ -84,7 +84,6 @@ - @@ -130,14 +129,7 @@ - - The package "Windows OpenXR Developer Preview" is not installed. WebXR pages won't work. - - - - - - + diff --git a/support/hololens/ServoApp/Package.appxmanifest b/support/hololens/ServoApp/Package.appxmanifest index 26c876f4734..4fb88b38f67 100644 --- a/support/hololens/ServoApp/Package.appxmanifest +++ b/support/hololens/ServoApp/Package.appxmanifest @@ -1,11 +1,5 @@  - + @@ -51,7 +45,6 @@ - diff --git a/support/hololens/ServoApp/ServoApp.vcxproj b/support/hololens/ServoApp/ServoApp.vcxproj index f752011dff0..60b7b540786 100644 --- a/support/hololens/ServoApp/ServoApp.vcxproj +++ b/support/hololens/ServoApp/ServoApp.vcxproj @@ -133,7 +133,6 @@ - @@ -930,7 +929,6 @@ - diff --git a/support/hololens/ServoApp/ServoApp.vcxproj.filters b/support/hololens/ServoApp/ServoApp.vcxproj.filters index 3cf5c9555d5..5f1a2c73ab3 100644 --- a/support/hololens/ServoApp/ServoApp.vcxproj.filters +++ b/support/hololens/ServoApp/ServoApp.vcxproj.filters @@ -22,7 +22,6 @@ ServoControl - @@ -39,7 +38,6 @@ ServoControl - diff --git a/support/hololens/ServoApp/XRPkgChecker.cpp b/support/hololens/ServoApp/XRPkgChecker.cpp deleted file mode 100644 index 4bdb2b5a71d..00000000000 --- a/support/hololens/ServoApp/XRPkgChecker.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -#include "pch.h" -#include "XRPkgChecker.h" -#include "logs.h" -#include "winrt/Windows.Management.Deployment.h" - -using namespace winrt::Windows::Management::Deployment; - -namespace winrt { - -void XRPkgChecker::OnInstalled(std::function callback, - winrt::Windows::Foundation::TimeSpan interval) { - timer.Stop(); - timer.Interval(interval); - installed_callback = std::make_unique>(callback); - timer.Tick({this, &XRPkgChecker::CheckXRPkgTick}); - timer.Start(); -} - -void XRPkgChecker::StopTracking() { - installed_callback.reset(); - timer.Stop(); -} - -void XRPkgChecker::CheckXRPkgTick(Windows::Foundation::IInspectable const &, - Windows::Foundation::IInspectable const &) { - if (IsInstalled()) { - (*installed_callback)(); - StopTracking(); - } -} - -void XRPkgChecker::OpenStore() { - std::wstring url = L"ms-windows-store://pdp/?PFN="; - Windows::Foundation::Uri uri{url + OPENXR_PACKAGE_NAME}; - Windows::System::Launcher::LaunchUriAsync(uri); -} - -bool XRPkgChecker::IsInstalled() { - auto current_user = L""; - for (auto package : PackageManager().FindPackagesForUser(current_user)) { - if (package.Id().Name() == OPENXR_PACKAGE_SHORT_NAME) { - return true; - } - } - return false; -} - -} // namespace winrt diff --git a/support/hololens/ServoApp/XRPkgChecker.h b/support/hololens/ServoApp/XRPkgChecker.h deleted file mode 100644 index 84a7c6ff843..00000000000 --- a/support/hololens/ServoApp/XRPkgChecker.h +++ /dev/null @@ -1,30 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -#pragma once - -#include "pch.h" - -namespace winrt { -class XRPkgChecker { - -public: - void OnInstalled(std::function callback, - winrt::Windows::Foundation::TimeSpan interval); - bool IsInstalled(); - void StopTracking(); - void OpenStore(); - -private: - std::unique_ptr> installed_callback; - void CheckXRPkgTick(Windows::Foundation::IInspectable const &, - Windows::Foundation::IInspectable const &); - Windows::UI::Xaml::DispatcherTimer timer; - inline static const hstring OPENXR_PACKAGE_NAME = - L"Microsoft.MixedRealityRuntimeDeveloperPreview_8wekyb3d8bbwe"; - inline static const hstring OPENXR_PACKAGE_SHORT_NAME = - L"Microsoft.MixedRealityRuntimeDeveloperPreview"; -}; - -} // namespace winrt