From 69b80157370edeebb7b217b0b74a4844b2ac45d7 Mon Sep 17 00:00:00 2001
From: yao-msft <50888816+yao-msft@users.noreply.github.com>
Date: Tue, 3 Dec 2024 15:25:01 -0800
Subject: [PATCH] Add missing ReturnResponseUrl to WinGetUtilInterop manifest
---
.../ManifestUnitTest/V1ManifestReadTest.cs | 4 ++++
.../TestCollateral/V1_1ManifestMerged.yaml | 1 -
.../TestCollateral/V1_6ManifestMerged.yaml | 11 ++++++-----
.../TestCollateral/V1_7ManifestMerged.yaml | 11 ++++++-----
.../TestCollateral/V1_9ManifestMerged.yaml | 9 +++++----
.../Manifest/V1/InstallerExpectedReturnCode.cs | 11 ++++++++---
6 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs b/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs
index ecff759994..72f24a5272 100644
--- a/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs
+++ b/src/WinGetUtilInterop.UnitTests/ManifestUnitTest/V1ManifestReadTest.cs
@@ -264,6 +264,8 @@ private void ValidateManifestFields(Manifest manifest, TestManifestVersion manif
Assert.True(manifest.DisplayInstallWarnings);
Assert.True(manifest.DownloadCommandProhibited);
+
+ Assert.Equal("https://defaultReturnResponseUrl.com", manifest.ExpectedReturnCodes[0].ReturnResponseUrl);
}
if (manifestVersion >= TestManifestVersion.V170)
@@ -373,6 +375,8 @@ private void ValidateManifestFields(Manifest manifest, TestManifestVersion manif
Assert.True(installer1.DisplayInstallWarnings);
Assert.True(installer1.DownloadCommandProhibited);
+
+ Assert.Equal("https://returnResponseUrl.com", installer1.ExpectedReturnCodes[0].ReturnResponseUrl);
}
if (manifestVersion >= TestManifestVersion.V170)
diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_1ManifestMerged.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_1ManifestMerged.yaml
index de6888aa7b..eaf2be893d 100644
--- a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_1ManifestMerged.yaml
+++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_1ManifestMerged.yaml
@@ -34,7 +34,6 @@ ExpectedReturnCodes:
ReturnResponse: contactSupport
- InstallerReturnCode: 3
ReturnResponse: custom
- ReturnResponseUrl: https://defaultReturnResponseUrl.com
FileExtensions:
- appx
- msix
diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml
index 60769f3d8d..1eb70ac0ab 100644
--- a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml
+++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_6ManifestMerged.yaml
@@ -105,10 +105,10 @@ Markets:
- US
ExpectedReturnCodes:
- InstallerReturnCode: 2
- ReturnResponse: contactSupport
+ ReturnResponse: contactSupport
+ ReturnResponseUrl: https://defaultReturnResponseUrl.com
- InstallerReturnCode: 3
ReturnResponse: custom
- ReturnResponseUrl: https://defaultReturnResponseUrl.com
UnsupportedArguments:
- log
NestedInstallerType: msi
@@ -225,8 +225,9 @@ Installers:
ExcludedMarkets:
- "US"
ExpectedReturnCodes:
- - InstallerReturnCode: 2
- ReturnResponse: contactSupport
+ - InstallerReturnCode: 2
+ ReturnResponse: contactSupport
+ ReturnResponseUrl: https://returnResponseUrl.com
DownloadCommandProhibited: true
InstallationMetadata:
DefaultInstallLocation: "%ProgramFiles%\\TestApp"
@@ -242,4 +243,4 @@ Installers:
InstallerType: exe
ProductCode: '{Bar}'
ManifestType: merged
-ManifestVersion: 1.6.0
\ No newline at end of file
+ManifestVersion: 1.6.0
diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_7ManifestMerged.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_7ManifestMerged.yaml
index f6632a15ed..42640d1993 100644
--- a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_7ManifestMerged.yaml
+++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_7ManifestMerged.yaml
@@ -106,10 +106,10 @@ Markets:
- US
ExpectedReturnCodes:
- InstallerReturnCode: 2
- ReturnResponse: contactSupport
+ ReturnResponse: contactSupport
+ ReturnResponseUrl: https://defaultReturnResponseUrl.com
- InstallerReturnCode: 3
ReturnResponse: custom
- ReturnResponseUrl: https://defaultReturnResponseUrl.com
UnsupportedArguments:
- log
NestedInstallerType: msi
@@ -228,8 +228,9 @@ Installers:
ExcludedMarkets:
- "US"
ExpectedReturnCodes:
- - InstallerReturnCode: 2
- ReturnResponse: contactSupport
+ - InstallerReturnCode: 2
+ ReturnResponse: contactSupport
+ ReturnResponseUrl: https://returnResponseUrl.com
DownloadCommandProhibited: true
RepairBehavior: modify
InstallationMetadata:
@@ -246,4 +247,4 @@ Installers:
InstallerType: exe
ProductCode: '{Bar}'
ManifestType: merged
-ManifestVersion: 1.7.0
\ No newline at end of file
+ManifestVersion: 1.7.0
diff --git a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_9ManifestMerged.yaml b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_9ManifestMerged.yaml
index 3bf371df37..b6efa0343b 100644
--- a/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_9ManifestMerged.yaml
+++ b/src/WinGetUtilInterop.UnitTests/TestCollateral/V1_9ManifestMerged.yaml
@@ -106,10 +106,10 @@ Markets:
- US
ExpectedReturnCodes:
- InstallerReturnCode: 2
- ReturnResponse: contactSupport
+ ReturnResponse: contactSupport
+ ReturnResponseUrl: https://defaultReturnResponseUrl.com
- InstallerReturnCode: 3
ReturnResponse: custom
- ReturnResponseUrl: https://defaultReturnResponseUrl.com
UnsupportedArguments:
- log
NestedInstallerType: msi
@@ -229,8 +229,9 @@ Installers:
ExcludedMarkets:
- "US"
ExpectedReturnCodes:
- - InstallerReturnCode: 2
- ReturnResponse: contactSupport
+ - InstallerReturnCode: 2
+ ReturnResponse: contactSupport
+ ReturnResponseUrl: https://returnResponseUrl.com
DownloadCommandProhibited: true
ArchiveBinariesDependOnPath: false
RepairBehavior: modify
diff --git a/src/WinGetUtilInterop/Manifest/V1/InstallerExpectedReturnCode.cs b/src/WinGetUtilInterop/Manifest/V1/InstallerExpectedReturnCode.cs
index 288d8b0b24..56d543521f 100644
--- a/src/WinGetUtilInterop/Manifest/V1/InstallerExpectedReturnCode.cs
+++ b/src/WinGetUtilInterop/Manifest/V1/InstallerExpectedReturnCode.cs
@@ -1,4 +1,4 @@
-// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. Licensed under the MIT License.
//
@@ -19,6 +19,11 @@ public class InstallerExpectedReturnCode
///
/// Gets or sets the corresponding response category.
///
- public string ReturnResponse { get; set; }
+ public string ReturnResponse { get; set; }
+
+ ///
+ /// Gets or sets the corresponding response url.
+ ///
+ public string ReturnResponseUrl { get; set; }
}
-}
\ No newline at end of file
+}