commit 1ad382023bfcbe980a696b213fd0f60cd68d0086
parent f1ae1267c330f7ec463a58fc6c7b0e2ea6f44a16
Author: Ruben Guerrero <rubengu@microsoft.com>
Date: Thu, 30 May 2024 19:21:23 -0700
WinGetDownload E_ACCESSDENIED (#4518)
Fix issue when calling WinGetDownload from Az Functions.
It is most likely caused by an attempt to create the directory while
reading the admin settings. Instead of failing, catch the exception and
use the default settings.
If we ever read more settings from WinGetUtil a more robust solution is
required.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/4518)
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/AppInstallerCommonCore/NetworkSettings.cpp b/src/AppInstallerCommonCore/NetworkSettings.cpp
@@ -42,8 +42,12 @@ namespace AppInstaller::Settings
NetworkSettings::NetworkSettings()
{
- // Get the default proxy
- m_proxyUri = GetAdminSetting(StringAdminSetting::DefaultProxy);
+ // Get the default proxy
+ try
+ {
+ m_proxyUri = GetAdminSetting(StringAdminSetting::DefaultProxy);
+ }
+ CATCH_LOG()
AICLI_LOG(Core, Info, << "Default proxy is " << (m_proxyUri ? m_proxyUri.value() : "not set"));
}
@@ -57,4 +61,4 @@ namespace AppInstaller::Settings
{
return NetworkSettings::Instance();
}
-}-
\ No newline at end of file
+}