From 36e2417390d5d141ca2fec01f626e80e759a263e Mon Sep 17 00:00:00 2001 From: Jaime Bernardo Date: Fri, 22 Dec 2023 22:45:24 +0000 Subject: [PATCH] Consistent install module scripts location on debug and installed --- installer/PowerToysSetup/Settings.wxs | 6 +++--- installer/PowerToysSetupCustomActions/CustomAction.cpp | 4 ++-- .../Settings.UI/ViewModels/CmdNotFoundViewModel.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/installer/PowerToysSetup/Settings.wxs b/installer/PowerToysSetup/Settings.wxs index 3aa732dde2..b9c27b00c4 100644 --- a/installer/PowerToysSetup/Settings.wxs +++ b/installer/PowerToysSetup/Settings.wxs @@ -19,7 +19,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -67,7 +67,7 @@ - + diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp index 9bc24dea97..224369592b 100644 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp @@ -446,9 +446,9 @@ UINT __stdcall UninstallCommandNotFoundModuleCA(MSIHANDLE hInstall) hr = getInstallFolder(hInstall, installationFolder); ExitOnFailure(hr, "Failed to get installFolder."); - command = "start pwsh.exe"; + command = "pwsh.exe"; command += " "; - command += "-NoProfile -ExecutionPolicy Unrestricted -File \"" + winrt::to_string(installationFolder) + "\\WinUI3Apps\\Assets\\Settings\\Utilities\\DisableModule.ps1" + "\""; + command += "-NoProfile -NonInteractive -NoLogo -WindowStyle Hidden -ExecutionPolicy Unrestricted -File \"" + winrt::to_string(installationFolder) + "\\WinUI3Apps\\Assets\\Settings\\Utilities\\DisableModule.ps1" + "\""; system(command.c_str()); diff --git a/src/settings-ui/Settings.UI/ViewModels/CmdNotFoundViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/CmdNotFoundViewModel.cs index e1173c21d9..29243f4d51 100644 --- a/src/settings-ui/Settings.UI/ViewModels/CmdNotFoundViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/CmdNotFoundViewModel.cs @@ -180,7 +180,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels public void InstallModule() { var ps1File = AssemblyDirectory + "\\Assets\\Settings\\Scripts\\EnableModule.ps1"; - var arguments = $"-NoProfile -ExecutionPolicy Unrestricted -File \"{ps1File}\" -scriptPath {AssemblyDirectory}\\.."; + var arguments = $"-NoProfile -ExecutionPolicy Unrestricted -File \"{ps1File}\" -scriptPath \"{AssemblyDirectory}\\..\""; RunPowerShellScript(arguments); }