From 1bb8540461eb78293e4c99c0010e9b7b3e5d4497 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Wed, 29 Apr 2020 03:38:29 -0700 Subject: [PATCH 1/2] Try uninstalling without elevation in case since it is not needed for layout installs (debug) --- vnext/local-cli/runWindows/utils/WindowsStoreAppUtils.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vnext/local-cli/runWindows/utils/WindowsStoreAppUtils.ps1 b/vnext/local-cli/runWindows/utils/WindowsStoreAppUtils.ps1 index 21b83fe5137..8e2da36859f 100644 --- a/vnext/local-cli/runWindows/utils/WindowsStoreAppUtils.ps1 +++ b/vnext/local-cli/runWindows/utils/WindowsStoreAppUtils.ps1 @@ -63,7 +63,12 @@ function Uninstall-App { if($package) { $pfn = $package.PackageFullName - Invoke-Expression-MayElevate "Remove-AppxPackage $pfn -ErrorAction Stop" -ErrorAction Stop + $command = "Remove-AppxPackage $pfn -ErrorAction Stop" + try { + Invoke-Expression $command + } catch { + Invoke-Expression-MayElevate $command -ErrorAction Stop + } } } From c035a1158482a229a5dc6fbea65439a48d1e06a2 Mon Sep 17 00:00:00 2001 From: Alexander Sklar Date: Wed, 29 Apr 2020 10:09:34 -0700 Subject: [PATCH 2/2] Change files --- ...-native-windows-2020-04-29-10-09-33-tryUninstall2.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 change/react-native-windows-2020-04-29-10-09-33-tryUninstall2.json diff --git a/change/react-native-windows-2020-04-29-10-09-33-tryUninstall2.json b/change/react-native-windows-2020-04-29-10-09-33-tryUninstall2.json new file mode 100644 index 00000000000..75bcac12ce6 --- /dev/null +++ b/change/react-native-windows-2020-04-29-10-09-33-tryUninstall2.json @@ -0,0 +1,8 @@ +{ + "type": "prerelease", + "comment": "Try uninstalling without elevation in case since it is not needed for layout installs (debug)", + "packageName": "react-native-windows", + "email": "asklar@microsoft.com", + "dependentChangeType": "patch", + "date": "2020-04-29T17:09:33.939Z" +}