From ca6e908978b9f05c22b5067a421373687895f835 Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:38:26 -0500 Subject: [PATCH] Don't install DevHomeGitHubExtension on first run (#3975) --- src/ViewModels/InitializationViewModel.cs | 45 +---------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/src/ViewModels/InitializationViewModel.cs b/src/ViewModels/InitializationViewModel.cs index 7acac1b84b..a8a176591d 100644 --- a/src/ViewModels/InitializationViewModel.cs +++ b/src/ViewModels/InitializationViewModel.cs @@ -21,30 +21,13 @@ public class InitializationViewModel : ObservableObject private readonly IThemeSelectorService _themeSelector; private readonly IWidgetServiceService _widgetServiceService; - private readonly IMicrosoftStoreService _msStoreService; - private readonly IPackageDeploymentService _packageDeploymentService; - -#if CANARY_BUILD - private const string GitHubExtensionStorePackageId = "9N806ZKPW85R"; - private const string GitHubExtensionPackageFamilyName = "Microsoft.Windows.DevHomeGitHubExtension.Canary_8wekyb3d8bbwe"; -#elif STABLE_BUILD - private const string GitHubExtensionStorePackageId = "9NZCC27PR6N6"; - private const string GitHubExtensionPackageFamilyName = "Microsoft.Windows.DevHomeGitHubExtension_8wekyb3d8bbwe"; -#else - private const string GitHubExtensionStorePackageId = ""; - private const string GitHubExtensionPackageFamilyName = ""; -#endif public InitializationViewModel( IThemeSelectorService themeSelector, - IWidgetServiceService widgetServiceService, - IMicrosoftStoreService msStoreService, - IPackageDeploymentService packageDeploymentService) + IWidgetServiceService widgetServiceService) { _themeSelector = themeSelector; _widgetServiceService = widgetServiceService; - _msStoreService = msStoreService; - _packageDeploymentService = packageDeploymentService; } public async void OnPageLoaded() @@ -74,24 +57,6 @@ public async void OnPageLoaded() _log.Information(ex, "Installing WidgetService failed: "); } - // Install the DevHomeGitHubExtension, unless it's already installed or a dev build is running. - if (string.IsNullOrEmpty(GitHubExtensionStorePackageId) || HasDevHomeGitHubExtensionInstalled()) - { - _log.Information("Skipping installing DevHomeGitHubExtension."); - } - else - { - try - { - _log.Information("Installing DevHomeGitHubExtension..."); - await _msStoreService.TryInstallPackageAsync(GitHubExtensionStorePackageId); - } - catch (Exception ex) - { - _log.Information(ex, "Installing DevHomeGitHubExtension failed: "); - } - } - App.MainWindow.Content = Application.Current.GetService(); _themeSelector.SetRequestedTheme(); @@ -99,12 +64,4 @@ public async void OnPageLoaded() TelemetryFactory.Get().Log("DevHome_Initialization_Ended_Event", LogLevel.Critical, new DevHomeInitializationEndedEvent()); _log.Information("Dev Home Initialization ended."); } - - private bool HasDevHomeGitHubExtensionInstalled() - { - var packages = _packageDeploymentService.FindPackagesForCurrentUser(GitHubExtensionPackageFamilyName); - - // Don't check here if the package is ok, we'll do that later on the Dashboard. - return packages.Any(); - } }