From e33ef922baf3ab7f20ec3c3c13c0a7ea2c1e25e7 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 8 Jan 2018 15:22:40 +0100 Subject: 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 Reviewed-by: Frederik Gladhorn --- coin/provisioning/common/windows/win10-enable-devmode.ps1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'coin/provisioning/common') 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 +} -- cgit v1.2.3