Provisioning on windows: Fix deletion of utils
authorFrederik Gladhorn <frederik.gladhorn@qt.io>
Tue, 23 Jan 2018 11:37:01 +0000 (12:37 +0100)
committerTony Sarajärvi <tony.sarajarvi@qt.io>
Mon, 5 Feb 2018 14:13:08 +0000 (14:13 +0000)
We want to be able to re-provision machiens without errors.
The directory doesn't exist on the machine any more.

Change-Id: I2b5b92037492e51aeb4d041d62f371b8546cb0a3
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
coin/provisioning/common/windows/windows_removethemall.ps1

index 0e58490..96c448e 100644 (file)
@@ -56,6 +56,8 @@ Function Remove-Path {
 }
 
 # Remove Android sdk and ndk
-dir c:\utils\android* | ForEach { Rename-Item $_ $_"-deleted" }
-[Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME",$null,"User")
-[Environment]::SetEnvironmentVariable("ANDROID_SDK_HOME",$null,"User")
+If (Test-Path "c:\utils") {
+    dir c:\utils\android* | ForEach { Rename-Item $_ $_"-deleted" }
+    [Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME",$null,"User")
+    [Environment]::SetEnvironmentVariable("ANDROID_SDK_HOME",$null,"User")
+}