[Shortcut Guide] Move into separate process (#11359)

This commit is contained in:
Mykhailo Pylyp
2021-05-20 15:07:34 +03:00
committed by GitHub
parent c948c1fca8
commit 601da71f15
114 changed files with 2346 additions and 1771 deletions

View File

@@ -2,6 +2,9 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Threading;
using Microsoft.PowerToys.Settings.UI.OOBE.Enums;
using Microsoft.PowerToys.Settings.UI.OOBE.ViewModel;
@@ -27,12 +30,12 @@ namespace Microsoft.PowerToys.Settings.UI.OOBE.Views
private void Start_ShortcutGuide_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
if (OobeShellPage.ShortcutGuideSharedEventCallback != null)
var executablePath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, @"..\modules\ShortcutGuide\ShortcutGuide\PowerToys.ShortcutGuide.exe");
var id = Process.GetCurrentProcess().Id.ToString(CultureInfo.InvariantCulture);
var p = Process.Start(executablePath, id);
if (p != null)
{
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, OobeShellPage.ShortcutGuideSharedEventCallback()))
{
eventHandle.Set();
}
p.Close();
}
ViewModel.LogRunningModuleEvent();