Skip to content

Commit

Permalink
Allow PackageFamilyName to be declared with non msix installers (#1944)
Browse files Browse the repository at this point in the history
  • Loading branch information
yao-msft authored Feb 26, 2022
1 parent 647b285 commit 9a6dbc2
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/AppInstallerCLITests/AppInstallerCLITests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@
<CopyFileToFolders Include="TestData\Manifest-Good-DefaultExpectedReturnCodeInInstallerSuccessCodes.yaml">
<DeploymentContent>true</DeploymentContent>
</CopyFileToFolders>
<CopyFileToFolders Include="TestData\Manifest-Good-PackageFamilyNameOnExe-Ver1_2.yaml">
<DeploymentContent>true</DeploymentContent>
</CopyFileToFolders>
<CopyFileToFolders Include="TestData\Manifest-Encoding-ANSI.yaml">
<DeploymentContent>true</DeploymentContent>
</CopyFileToFolders>
Expand Down
3 changes: 3 additions & 0 deletions src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@
<CopyFileToFolders Include="TestData\Manifest-Good-MultiLocale.yaml">
<Filter>TestData</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="TestData\Manifest-Good-PackageFamilyNameOnExe-Ver1_2.yaml">
<Filter>TestData</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="TestData\Manifest-Good-Spaces.yaml">
<Filter>TestData</Filter>
</CopyFileToFolders>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
PackageIdentifier: Microsoft.WinAppSdk
Publisher: Microsoft
PackageName: WinAppSdk
PackageVersion: 1.0
License: Microsoft Software License
MinimumOSVersion: 10.0.17763.0
Tags:
- WinAppSdk
ShortDescription: WinAppSdk
PackageUrl: https://github.com/microsoft/WindowsAppSDK
Installers:
- Architecture: x86
InstallerType: exe
InstallerUrl: https://ThisIsTest.com/TestIndex/installer/WindowsAppRuntimeInstall.exe
InstallerSha256: b565f45da868b637686d4c098e9e4c3e16424cff1ed2f19d5665602fdd8dfba6
PackageFamilyName: MicrosoftCorporationII.WindowsAppRuntime.Main.1.0_8wekyb3d8bbwe
AppsAndFeaturesEntries:
- InstallerType: msix
InstallerSwitches:
Silent: /s
SilentWithProgress: /s
PackageLocale: en-US
ManifestType: singleton
ManifestVersion: 1.2.0
1 change: 1 addition & 0 deletions src/AppInstallerCLITests/YamlManifest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ TEST_CASE("ReadGoodManifests", "[ManifestValidation]")
{ "Manifest-Good-Minimum-InstallerType.yaml" },
{ "Manifest-Good-Switches.yaml" },
{ "Manifest-Good-DefaultExpectedReturnCodeInInstallerSuccessCodes.yaml" },
{ "Manifest-Good-PackageFamilyNameOnExe-Ver1_2.yaml" },
};

for (auto const& testCase : TestCases)
Expand Down
3 changes: 2 additions & 1 deletion src/AppInstallerCommonCore/Manifest/ManifestValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ namespace AppInstaller::Manifest
}

// Validate system reference strings if they are set at the installer level
if (!installer.PackageFamilyName.empty() && !DoesInstallerTypeUsePackageFamilyName(installer.InstallerType))
// Allow PackageFamilyName to be declared with non msix installers to support nested installer scenarios after manifest version 1.1
if (manifest.ManifestVersion <= ManifestVer{ s_ManifestVersionV1_1 } && !installer.PackageFamilyName.empty() && !DoesInstallerTypeUsePackageFamilyName(installer.InstallerType))
{
resultErrors.emplace_back(ManifestError::InstallerTypeDoesNotSupportPackageFamilyName, "InstallerType", InstallerTypeToString(installer.InstallerType));
}
Expand Down

0 comments on commit 9a6dbc2

Please sign in to comment.