aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/windows
diff options
context:
space:
mode:
authorJuha Karjalainen <juha.karjalainen@qt.io>2019-01-18 12:17:12 +0200
committerLiang Qi <liang.qi@qt.io>2019-01-29 15:24:38 +0000
commitafbd9305e395f762802dc6cdd2016c57a95c2de4 (patch)
treef7e30229007d155be1b65806b3b29f02698af5aa /coin/provisioning/common/windows
parent044f079158640a92ba05b353d7d88adfba573e6e (diff)
Fix provisioning failure when unsetting proxy with no proxy
When unset-proxy.ps1 script is run when there is no proxy set unset script fails leading provisioning to fail. Now will check if proxy is set before removing registery keys for it. Task-number: QTQAINFRA-2311 Change-Id: Ic50bcebc634bb90385ca817dac9bed24e9e897ec Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Diffstat (limited to 'coin/provisioning/common/windows')
-rw-r--r--coin/provisioning/common/windows/unset-proxy.ps19
1 files changed, 7 insertions, 2 deletions
diff --git a/coin/provisioning/common/windows/unset-proxy.ps1 b/coin/provisioning/common/windows/unset-proxy.ps1
index 9c3dddb3..0b7d761f 100644
--- a/coin/provisioning/common/windows/unset-proxy.ps1
+++ b/coin/provisioning/common/windows/unset-proxy.ps1
@@ -38,6 +38,11 @@ $dcs = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\
$dcs[8] = $_ -band 0xF7
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" -Name DefaultConnectionSettings -Value $dcs
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyEnable -Value 0
-Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer
-Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride
+if(Get-ItemProperty -ErrorAction SilentlyContinue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer){
+ Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyServer
+
+}
+if(Get-ItemProperty -ErrorAction SilentlyContinue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride){
+ Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" -Name ProxyOverride
+}