aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2018-01-08 15:22:40 +0100
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2018-01-17 16:47:54 +0000
commite33ef922baf3ab7f20ec3c3c13c0a7ea2c1e25e7 (patch)
treebad4e47fb23c49f8e978974c92c2662a9ec4ac50 /coin/provisioning/common/windows
parent1c7ba877cc57924d8a4b30007d29dc06cd8af62e (diff)
Use "correct" registry when enabling Windows 10 Developer Mode
As coin is running a 32 bit application the registry key ended up in the Wow6432Node compatibility area of the registry when run on a 64 bit Windows. Windows does not use this place to check for the developer mode setting, so we use the "proper" registry instead. If adding the registry key fails the script now reflects that and exits with a proper exit code. Change-Id: Ifd6bc7e7b0ed6595a2a967597ab45053cb51e7aa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'coin/provisioning/common/windows')
-rw-r--r--coin/provisioning/common/windows/win10-enable-devmode.ps113
1 files changed, 12 insertions, 1 deletions
diff --git a/coin/provisioning/common/windows/win10-enable-devmode.ps1 b/coin/provisioning/common/windows/win10-enable-devmode.ps1
index 022adc52..2d7733c0 100644
--- a/coin/provisioning/common/windows/win10-enable-devmode.ps1
+++ b/coin/provisioning/common/windows/win10-enable-devmode.ps1
@@ -2,4 +2,15 @@
#
# In order to run auto tests for UWP, we have to enable developer mode on Windows 10 machines.
# https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development
-REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /V AllowDevelopmentWithoutDevLicense /T REG_DWORD /D 1 /F
+
+if ([environment]::Is64BitOperatingSystem) {
+ $bitness = "/reg:64"
+} else {
+ $bitness = "/reg:32"
+}
+
+REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /V AllowDevelopmentWithoutDevLicense /T REG_DWORD /D 1 /F $bitness
+if ($LastExitCode -ne 0) {
+ Write-Host "Could not enable Developer Mode."
+ exit 1
+}