diff --git a/WindowsAppRuntime.sln b/WindowsAppRuntime.sln
index bad107c58e..faad56fb95 100644
--- a/WindowsAppRuntime.sln
+++ b/WindowsAppRuntime.sln
@@ -261,6 +261,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RestartAgent", "dev\Restart
{F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746}
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Licensing", "Licensing", "{34671779-4A4D-4D0E-B259-CD0F14D4F6D4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Licensing", "dev\Licensing\Licensing.vcxitems", "{885A43FA-052D-4B0D-A2DC-13EE15796435}"
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
test\inc\inc.vcxitems*{0a5fee93-48b7-40ec-bb9a-b27d11060da9}*SharedItemsImports = 4
@@ -271,10 +275,12 @@ Global
test\inc\inc.vcxitems*{56a1d696-feda-4333-bf37-772ebececb10}*SharedItemsImports = 4
test\inc\inc.vcxitems*{5b2d17fe-c371-417f-860c-3d32397c2404}*SharedItemsImports = 4
test\inc\inc.vcxitems*{7c502995-59c3-483b-86ba-815985353633}*SharedItemsImports = 4
+ dev\Licensing\Licensing.vcxitems*{885a43fa-052d-4b0d-a2dc-13ee15796435}*SharedItemsImports = 9
test\inc\inc.vcxitems*{8e52d7ea-a200-4a6b-ba74-8efb49468caf}*SharedItemsImports = 4
test\inc\inc.vcxitems*{b567fe2e-3a03-48d0-b2b5-760cdec35891}*SharedItemsImports = 9
dev\Common\Common.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\DynamicDependency\API\DynamicDependency.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
+ dev\Licensing\Licensing.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\PowerNotifications\PowerNotifications.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
dev\PowerNotifications\PowerNotifications.vcxitems*{b75c1b22-553c-40e4-b38e-6ab4d01fdb9d}*SharedItemsImports = 9
@@ -1049,6 +1055,8 @@ Global
{09DDAE21-397F-4263-8561-7F2FF28127CF} = {0C534F12-B076-47E5-A05B-2A711233AC6F}
{6539E9E1-BF36-40E5-86BC-070E99DB7B7B} = {6CD01EF6-D4A4-4801-ADCF-344CF87FF942}
{BC5E5A3E-E733-4388-8B00-F8495DA7C778} = {3DE93B2F-F887-437D-B512-6B1024ABA290}
+ {34671779-4A4D-4D0E-B259-CD0F14D4F6D4} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
+ {885A43FA-052D-4B0D-A2DC-13EE15796435} = {34671779-4A4D-4D0E-B259-CD0F14D4F6D4}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77}
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildDevProject-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildDevProject-Steps.yml
index 3ccbe0c814..d3a1e2e4f9 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildDevProject-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildDevProject-Steps.yml
@@ -1,5 +1,6 @@
parameters:
channel: 'experimental'
+ enableLicenseInstall: false
steps:
- template: WindowsAppSDK-BuildProject-Steps.yml
@@ -9,3 +10,4 @@ steps:
buildOutputDir: $(buildOutputDir)
publishDir: $(publishDir)
channel: ${{ parameters.channel }}
+ enableLicenseInstall: ${{ parameters.enableLicenseInstall }}
diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildProject-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildProject-Steps.yml
index fb1f106302..cf18b2287a 100644
--- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildProject-Steps.yml
+++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildProject-Steps.yml
@@ -4,8 +4,34 @@ parameters:
buildOutputDir: '$(Build.SourcesDirectory)\BuildOutput'
artifactName: 'drop'
channel: 'experimental'
+ enableLicenseInstall: false
+ # license installation assets are only accessible in internal builds, but are only
+ # needed in release-signed stable builds. Only enble this functionality in the private
+ # pipeline builds. Otherwise, default to an inert placeholder implementation.
+
steps:
+ - ${{ if eq(parameters.enableLicenseInstall, true) }}:
+ - task: NuGetAuthenticate@0
+ inputs:
+ nuGetServiceConnections: 'ProjectReunionInternal'
+
+ # Restore transport package dependencies. This is only enbaled in release-signed builds.
+ - task: PowerShell@2
+ name: ConvertVersionDetailsToPackageConfig
+ displayName: "Convert VersionDetails To PackageConfig"
+ inputs:
+ filePath: '$(Build.SourcesDirectory)\build\Scripts\ConvertVersionDetailsToPackageConfig.ps1'
+ arguments: -versionDetailsPath '$(Build.SourcesDirectory)\eng\Version.Details.xml' -packageConfigPath '$(Build.SourcesDirectory)\build\packages.config'
+
+ - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
+ displayName: RestoreNuGetPackages
+ inputs:
+ restoreSolution: build/packages.config
+ feedsToUse: config
+ nugetConfigPath: build/licensing.nuget.config
+ restoreDirectory: packages
+
- template: WindowsAppSDK-PopulateBuildDateAndRevision-Steps.yml
- script: |
@@ -119,6 +145,18 @@ steps:
}
}
+ # Copy MSIX license installation header into the correct source location.
+ - ${{ if eq(parameters.enableLicenseInstall, true) }}:
+ - task: CopyFiles@2
+ displayName: 'Extract license header to source location'
+ inputs:
+ SourceFolder: '$(Build.SourcesDirectory)\build\packages\$(AppLicensingInternalPackageName).$(AppLicensingInternalPackageVersion)\src'
+ Contents: |
+ *.h
+ TargetFolder: '$(Build.SourcesDirectory)\dev\Licensing'
+ flattenFolders: false
+ overWrite: true
+
- task: VSBuild@1
displayName: 'Build solution ${{ parameters.solutionPath }}'
inputs:
diff --git a/build/ProjectReunion-BuildFoundation.yml b/build/ProjectReunion-BuildFoundation.yml
index dadd44e661..4dca77fad2 100644
--- a/build/ProjectReunion-BuildFoundation.yml
+++ b/build/ProjectReunion-BuildFoundation.yml
@@ -102,6 +102,7 @@ jobs:
- template: AzurePipelinesTemplates\WindowsAppSDK-BuildDevProject-Steps.yml
parameters:
channel: ${{ variables.channel }}
+ enableLicenseInstall: true
# component detection must happen *within* the build task
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
@@ -166,6 +167,7 @@ jobs:
buildOutputDir: $(buildOutputDir)
publishDir: $(publishDir)
channel: ${{ variables.channel }}
+ enableLicenseInstall: true
- task: CopyFiles@2
displayName: 'Copy AnyCpu-built binaries to Nuget for staging'
diff --git a/build/licensing.nuget.config b/build/licensing.nuget.config
new file mode 100644
index 0000000000..c4af810727
--- /dev/null
+++ b/build/licensing.nuget.config
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/scripts/ConvertVersionDetailsToPackageConfig.ps1 b/build/scripts/ConvertVersionDetailsToPackageConfig.ps1
new file mode 100644
index 0000000000..ea8e36f2e9
--- /dev/null
+++ b/build/scripts/ConvertVersionDetailsToPackageConfig.ps1
@@ -0,0 +1,40 @@
+Param(
+ [Parameter(Position=0)]
+ [string]$versionDetailsPath = "",
+ [Parameter(Position=1)]
+ [string]$packageConfigPath = ""
+)
+
+[xml]$buildConfig = Get-Content -Path $versionDetailsPath
+
+$packagesText =
+@"
+
+
+
+
+"@
+foreach ($dependency in $buildConfig.Dependencies.ProductDependencies.Dependency)
+{
+ $name = $dependency.name
+ $ver = $dependency.version
+ Write-Host "id: " $name
+ Write-Host "ver: " $ver
+
+ if ($name -eq "Microsoft.WindowsAppSDK.AppLicensingInternal.TransportPackage")
+ {
+ Write-Host "##vso[task.setvariable variable=AppLicensingInternalPackageName;]$name"
+ Write-Host "##vso[task.setvariable variable=AppLicensingInternalPackageVersion;]$ver"
+ }
+
+ $packagesText += '
+'
+ }
+$packagesText +=
+@"
+
+"@
+
+Write-Host $packagesText
+
+Set-Content -Value $packagesText $packageConfigPath
diff --git a/dev/Deployment/DeploymentManager.cpp b/dev/Deployment/DeploymentManager.cpp
index 3402cf4629..af6dd58b69 100644
--- a/dev/Deployment/DeploymentManager.cpp
+++ b/dev/Deployment/DeploymentManager.cpp
@@ -8,6 +8,8 @@
#include
#include
+#include "WindowsAppRuntime-License.h"
+
namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation
{
@@ -107,7 +109,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem
}
std::wstring frameworkPackageFullName{ packageFullName };
- auto deployPackagesResult{ DeployPackages(frameworkPackageFullName) };
+ auto deployPackagesResult{ Deploy(frameworkPackageFullName) };
DeploymentStatus status{};
if (SUCCEEDED(deployPackagesResult))
{
@@ -215,23 +217,68 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem
CATCH_RETURN()
// Deploys all of the packages carried by the specified framework.
- HRESULT DeploymentManager::DeployPackages(const std::wstring& frameworkPackageFullName) try
+ HRESULT DeploymentManager::Deploy(const std::wstring& frameworkPackageFullName) try
+ {
+ RETURN_IF_FAILED(InstallLicenses(frameworkPackageFullName));
+ RETURN_IF_FAILED(DeployPackages(frameworkPackageFullName));
+ return S_OK;
+ }
+ CATCH_RETURN()
+
+ HRESULT DeploymentManager::InstallLicenses(const std::wstring& frameworkPackageFullName)
+ {
+ // Build path for licenses
+ auto licensePath{ std::filesystem::path(GetPackagePath(frameworkPackageFullName)) };
+ licensePath /= WINDOWSAPPRUNTIME_FRAMEWORK_PACKAGE_FOLDER;
+ auto licenseFilespec{ licensePath };
+ licenseFilespec /= L"*_license.xml";
+
+ // Deploy the licenses (if any)
+ ::Microsoft::Windows::ApplicationModel::Licensing::Installer licenseInstaller;
+ WIN32_FIND_DATA findFileData{};
+ wil::unique_hfind hfind{ FindFirstFileW(licenseFilespec.c_str(), &findFileData) };
+ if (!hfind)
+ {
+ const auto lastError{ GetLastError() };
+ RETURN_HR_IF_MSG(HRESULT_FROM_WIN32(lastError), (lastError != ERROR_FILE_NOT_FOUND) && (lastError != ERROR_PATH_NOT_FOUND),
+ "FindFirstFile:%ls", licenseFilespec.c_str());
+ return S_OK;
+ }
+ for (;;)
+ {
+ // Install the license file
+ auto licenseFilename{ licensePath };
+ licenseFilename /= findFileData.cFileName;
+ RETURN_IF_FAILED_MSG(licenseInstaller.InstallLicenseFile(licenseFilename.c_str()),
+ "LicenseFile:%ls", licenseFilename.c_str());
+
+ // Next! (if any)
+ if (!FindNextFileW(hfind.get(), &findFileData))
+ {
+ const auto lastError{ GetLastError() };
+ RETURN_HR_IF(HRESULT_FROM_WIN32(lastError), lastError != ERROR_NO_MORE_FILES);
+ break;
+ }
+ }
+ return S_OK;
+ }
+
+ HRESULT DeploymentManager::DeployPackages(const std::wstring& frameworkPackageFullName)
{
- auto frameworkPath = std::filesystem::path(GetPackagePath(frameworkPackageFullName));
+ const auto frameworkPath{ std::filesystem::path(GetPackagePath(frameworkPackageFullName)) };
for (const auto& package : c_targetPackages)
{
// Build path for the packages.
auto packagePath{ frameworkPath };
packagePath /= WINDOWSAPPRUNTIME_FRAMEWORK_PACKAGE_FOLDER;
packagePath /= package.identifier + WINDOWSAPPRUNTIME_FRAMEWORK_PACKAGE_FILE_EXTENSION;
-
+
// Deploy package.
RETURN_IF_FAILED(AddPackage(packagePath));
}
return S_OK;
}
- CATCH_RETURN()
hstring DeploymentManager::GetCurrentFrameworkPackageFullName()
{
@@ -276,7 +323,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem
continue;
}
}
-
+
return hstring(currentPackageInfo.Package(i).packageFullName);
}
diff --git a/dev/Deployment/DeploymentManager.h b/dev/Deployment/DeploymentManager.h
index 98eb3c8c60..61de859c42 100644
--- a/dev/Deployment/DeploymentManager.h
+++ b/dev/Deployment/DeploymentManager.h
@@ -20,7 +20,9 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem
static HRESULT VerifyPackage(const std::wstring& packageFamilyName, const PACKAGE_VERSION targetVersion);
static std::wstring GetPackagePath(std::wstring const& packageFullName);
static HRESULT AddPackage(const std::filesystem::path& packagePath);
+ static HRESULT Deploy(const std::wstring& frameworkPackageFullName);
static HRESULT DeployPackages(const std::wstring& frameworkPackageFullName);
+ static HRESULT InstallLicenses(const std::wstring& frameworkPackageFullName);
static hstring GetCurrentFrameworkPackageFullName();
};
}
diff --git a/dev/Deployment/PackageDefinitions.h b/dev/Deployment/PackageDefinitions.h
index 16dd48e7af..cf8aaf39af 100644
--- a/dev/Deployment/PackageDefinitions.h
+++ b/dev/Deployment/PackageDefinitions.h
@@ -34,7 +34,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem
};
// All supported SubTypeNames.
- static PackageIdentifier c_subTypeNames[] =
+ static const PackageIdentifier c_subTypeNames[] =
{
{ WINDOWSAPPRUNTIME_PACKAGE_NAME_MAINPREFIX, WINDOWSAPPRUNTIME_PACKAGE_SUBTYPENAME_MAIN, PackageVersionType::Versioned },
{ WINDOWSAPPRUNTIME_PACKAGE_NAME_PREFIX, WINDOWSAPPRUNTIME_PACKAGE_SUBTYPENAME_SINGLETON, PackageVersionType::Unversioned },
@@ -42,7 +42,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem
};
// All packages that the DeploymentAPI will attempt check and deploy from the framework.
- static PackageIdentifier c_targetPackages[] =
+ static const PackageIdentifier c_targetPackages[] =
{
{ WINDOWSAPPRUNTIME_PACKAGE_NAME_MAINPREFIX, WINDOWSAPPRUNTIME_PACKAGE_SUBTYPENAME_MAIN, PackageVersionType::Versioned },
{ WINDOWSAPPRUNTIME_PACKAGE_NAME_PREFIX, WINDOWSAPPRUNTIME_PACKAGE_SUBTYPENAME_SINGLETON, PackageVersionType::Unversioned },
diff --git a/dev/Licensing/Licensing.vcxitems b/dev/Licensing/Licensing.vcxitems
new file mode 100644
index 0000000000..5a3b5dab03
--- /dev/null
+++ b/dev/Licensing/Licensing.vcxitems
@@ -0,0 +1,27 @@
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+ true
+ {885A43FA-052D-4b0d-A2DC-13EE15796435}
+ Licensing
+
+
+
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/Licensing/MsixLicensing.cpp b/dev/Licensing/MsixLicensing.cpp
new file mode 100644
index 0000000000..848759a5b3
--- /dev/null
+++ b/dev/Licensing/MsixLicensing.cpp
@@ -0,0 +1,16 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+#include "pch.h"
+
+#include "msixlicensing.h"
+
+#include
+
+STDAPI MsixInstallLicenses() noexcept try
+{
+ //TODO
+ // FOREACH file IN pkgdir\MSIX\*_license.xml
+ // InstallLicenseFile(file)
+ return S_OK;
+}
+CATCH_RETURN();
diff --git a/dev/Licensing/MsixLicensing.h b/dev/Licensing/MsixLicensing.h
new file mode 100644
index 0000000000..5bf030b591
--- /dev/null
+++ b/dev/Licensing/MsixLicensing.h
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+#ifndef __MSIXLICENSING_H
+#define __MSIXLICENSING_H
+
+STDAPI MsixInstallLicenses() noexcept;
+
+#endif // __MSIXLICENSING_H
diff --git a/dev/Licensing/WindowsAppRuntime-License.h b/dev/Licensing/WindowsAppRuntime-License.h
new file mode 100644
index 0000000000..40b003e86c
--- /dev/null
+++ b/dev/Licensing/WindowsAppRuntime-License.h
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+#ifndef __WINDOWSAPPRUNTIME_LICENSE_H
+#define __WINDOWSAPPRUNTIME_LICENSE_H
+
+namespace Microsoft::Windows::ApplicationModel::Licensing
+{
+class Installer
+{
+public:
+ Installer() = default;
+
+ ~Installer() = default;
+
+ HRESULT Open()
+ {
+ return S_OK;
+ }
+
+ void Close()
+ {
+ }
+
+ HRESULT InstallLicense(HMODULE /*module*/, const std::wstring& /*licenseName*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicense(HMODULE /*module*/, PCWSTR /*licenseName*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenses(HMODULE /*module*/, size_t /*licenseCount*/, PCWSTR* /*licenseNames*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenseFile(const std::wstring& /*licenseFilename*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenseFile(PCWSTR /*licenseFilename*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenseFiles(size_t /*licenseCount*/, PCWSTR* /*licenseFilenames*/)
+ {
+ return S_OK;
+ }
+};
+}
+
+#endif // __WINDOWSAPPRUNTIME_LICENSE_H
diff --git a/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime-Licensing.cpp b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime-Licensing.cpp
new file mode 100644
index 0000000000..6e606be82f
--- /dev/null
+++ b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime-Licensing.cpp
@@ -0,0 +1,14 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+#include "pch.h"
+
+#include "WindowsAppRuntime-Licensing.h"
+
+#include
+
+STDAPI WindowsAppRuntime_InstallLicenses() noexcept try
+{
+ RETURN_IF_FAILED(MsixInstallLicenses());
+ return S_OK;
+}
+CATCH_RETURN();
diff --git a/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime-Licensing.h b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime-Licensing.h
new file mode 100644
index 0000000000..eb1f9ce977
--- /dev/null
+++ b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime-Licensing.h
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+#ifndef __WINDOWSAPPRUNTIME_LICENSING_H
+#define __WINDOWSAPPRUNTIME_LICENSING_H
+
+STDAPI WindowsAppRuntime_InstallLicenses() noexcept;
+
+#endif // __WINDOWSAPPRUNTIME_LICENSING_H
diff --git a/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj
index beaa41380f..12bbf86e33 100644
--- a/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj
+++ b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj
@@ -411,11 +411,13 @@
+
+
Create
Create
diff --git a/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj.filters b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj.filters
index 07a9483783..c632eeac95 100644
--- a/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj.filters
+++ b/dev/WindowsAppRuntime_BootstrapDLL/WindowsAppRuntime_BootstrapDLL.vcxproj.filters
@@ -27,6 +27,9 @@
Header Files
+
+ Header Files
+
@@ -38,6 +41,9 @@
Source Files
+
+ Source Files
+
diff --git a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def
index fd3613eb3c..ca1af0dd16 100644
--- a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def
+++ b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def
@@ -15,3 +15,5 @@ EXPORTS
MddLifetimeManagementGC
MddLifetimeManagementTestInitialize
MddGetGenerationId
+
+ MsixInstallLicenses
diff --git a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj
index c891c45958..eaa7bbcac6 100644
--- a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj
+++ b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime_DLL.vcxproj
@@ -115,6 +115,7 @@
+
@@ -177,7 +178,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(SolutionDir)appmodel\identity;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
@@ -199,7 +200,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
@@ -221,7 +222,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
@@ -243,7 +244,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
@@ -265,7 +266,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
@@ -291,7 +292,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
@@ -317,7 +318,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
@@ -343,7 +344,7 @@
- %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common
+ %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)dev\licensing;$(RepoRoot)\dev\common
Use
Level4
true
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 9034099d2f..23157d7340 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -21,6 +21,10 @@
+
+ https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionClosed
+ a3b6cd2d041c342d4a5ac2ed0c90c30e9ed08f15
+
diff --git a/installer/dev/WindowsAppRuntime-License.h b/installer/dev/WindowsAppRuntime-License.h
new file mode 100644
index 0000000000..40b003e86c
--- /dev/null
+++ b/installer/dev/WindowsAppRuntime-License.h
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+
+#ifndef __WINDOWSAPPRUNTIME_LICENSE_H
+#define __WINDOWSAPPRUNTIME_LICENSE_H
+
+namespace Microsoft::Windows::ApplicationModel::Licensing
+{
+class Installer
+{
+public:
+ Installer() = default;
+
+ ~Installer() = default;
+
+ HRESULT Open()
+ {
+ return S_OK;
+ }
+
+ void Close()
+ {
+ }
+
+ HRESULT InstallLicense(HMODULE /*module*/, const std::wstring& /*licenseName*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicense(HMODULE /*module*/, PCWSTR /*licenseName*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenses(HMODULE /*module*/, size_t /*licenseCount*/, PCWSTR* /*licenseNames*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenseFile(const std::wstring& /*licenseFilename*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenseFile(PCWSTR /*licenseFilename*/)
+ {
+ return S_OK;
+ }
+
+ HRESULT InstallLicenseFiles(size_t /*licenseCount*/, PCWSTR* /*licenseFilenames*/)
+ {
+ return S_OK;
+ }
+};
+}
+
+#endif // __WINDOWSAPPRUNTIME_LICENSE_H
diff --git a/installer/dev/WindowsAppRuntimeInstall.rc b/installer/dev/WindowsAppRuntimeInstall.rc
index 4aefd12ed2..fa2d5fbcb0 100644
--- a/installer/dev/WindowsAppRuntimeInstall.rc
+++ b/installer/dev/WindowsAppRuntimeInstall.rc
@@ -1,3 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
@@ -7,6 +10,7 @@
// PACKAGE
//
#include "windowsappruntime_definitions.h"
+
#if defined(WAR_FRAMEWORK_X86_RCENTRY)
WAR_FRAMEWORK_X86_RCENTRY
#endif
@@ -47,6 +51,16 @@ WAR_DDLM_X64_RCENTRY
WAR_DDLM_ARM64_RCENTRY
#endif
+//--Licenses--
+
+#if defined(WAR_MAIN_LICENSE_RCENTRY)
+WAR_MAIN_LICENSE_RCENTRY
+#endif
+
+#if defined(WAR_SINGLETON_LICENSE_RCENTRY)
+WAR_SINGLETON_LICENSE_RCENTRY
+#endif
+
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/installer/dev/WindowsAppRuntimeInstall.vcxproj b/installer/dev/WindowsAppRuntimeInstall.vcxproj
index 606a38d992..09b0212fd0 100644
--- a/installer/dev/WindowsAppRuntimeInstall.vcxproj
+++ b/installer/dev/WindowsAppRuntimeInstall.vcxproj
@@ -115,6 +115,7 @@
+
diff --git a/installer/dev/WindowsAppRuntimeInstall.vcxproj.filters b/installer/dev/WindowsAppRuntimeInstall.vcxproj.filters
index 329c0037fc..22aee34c6c 100644
--- a/installer/dev/WindowsAppRuntimeInstall.vcxproj.filters
+++ b/installer/dev/WindowsAppRuntimeInstall.vcxproj.filters
@@ -33,6 +33,9 @@
Header Files
+
+ Header Files
+
diff --git a/installer/dev/console.cpp b/installer/dev/console.cpp
index db5fcb89a6..7ae090041f 100644
--- a/installer/dev/console.cpp
+++ b/installer/dev/console.cpp
@@ -1,13 +1,19 @@
-#include "pch.h"
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#include "pch.h"
#include "console.h"
void ShowHelp()
{
- std::wcout << L"Installs Microsoft Windows App SDK." << std::endl;
+ std::wcout << L"WindowsAppRuntimeInstaller -- Install the Microsoft Windows App SDK runtime" << std::endl;
std::wcout << L" " << wil::GetModuleFileNameW(nullptr).get() << std::endl;
- std::wcout << "Command line parameters: " << std::endl;
- std::wcout << " [-q] or [--quiet] : Runs the installer with no user interaction and suppresses all text output." << std::endl;
- std::wcout << " [-?] or [--help] : Show help information." << std::endl;
+ std::wcout << "Options (append - to disable e.g. --license- to not install licenses)" << std::endl;
+ std::wcout << " --dry-run Dry run (report but don't execute install operations)" << std::endl;
+ std::wcout << " --license Install licenses" << std::endl;
+ std::wcout << " --msix Install MSIX packages" << std::endl;
+ std::wcout << " -q, --quiet Perform no user interaction and suppress all text output" << std::endl;
+ std::wcout << " -?, --help Show help information" << std::endl;
std::wcout << std::endl;
std::wcout << "Consult the Windows App SDK documentation for additional guidance on installation and command line syntax." << std::endl;
std::wcout << "Documentation URI: https://aka.ms/ProjectReunionInstaller" << std::endl;
diff --git a/installer/dev/console.h b/installer/dev/console.h
index 5d6685e4ce..e83f5059b6 100644
--- a/installer/dev/console.h
+++ b/installer/dev/console.h
@@ -1,4 +1,8 @@
-#pragma once
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#pragma once
+
#include "pch.h"
void ShowHelp();
diff --git a/installer/dev/install.cpp b/installer/dev/install.cpp
index 5fdc5c1b34..f88a371623 100644
--- a/installer/dev/install.cpp
+++ b/installer/dev/install.cpp
@@ -1,15 +1,20 @@
-#include "pch.h"
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#include "pch.h"
#include "packages.h"
#include "install.h"
+EXTERN_C IMAGE_DOS_HEADER __ImageBase;
+
using namespace winrt;
using namespace Windows::ApplicationModel;
using namespace Windows::Foundation;
using namespace Windows::Management::Deployment;
using namespace Windows::System;
-namespace WindowsAppRuntimeInstaller {
-
+namespace WindowsAppRuntimeInstaller
+{
HRESULT RegisterPackage(const std::wstring& packageFullName)
{
PackageManager packageManager;
@@ -172,8 +177,10 @@ namespace WindowsAppRuntimeInstaller {
return outstream;
}
- void DeployPackageFromResource(const WindowsAppRuntimeInstaller::ResourcePackageInfo& resource, const bool quiet)
+ void DeployPackageFromResource(const WindowsAppRuntimeInstaller::ResourcePackageInfo& resource, const WindowsAppRuntimeInstaller::Options options)
{
+ const auto quiet{ WI_IsFlagSet(options, WindowsAppRuntimeInstaller::Options::Quiet) };
+
// Get package properties by loading the resource as a stream and reading the manifest.
auto packageStream = GetResourceStream(resource.id, resource.resourceType);
auto packageProperties = GetPackagePropertiesFromStream(packageStream);
@@ -200,6 +207,12 @@ namespace WindowsAppRuntimeInstaller {
std::wcout << "Deploying package: " << packageProperties->fullName.get() << std::endl;
}
+ // DryRun = Don't do the work
+ if (WI_IsFlagSet(options, WindowsAppRuntimeInstaller::Options::DryRun))
+ {
+ return;
+ }
+
// Write the package to a temp file. The PackageManager APIs require a Uri.
wil::com_ptr outStream{ OpenFileStream(packageFilename) };
ULARGE_INTEGER streamSize{};
@@ -213,7 +226,8 @@ namespace WindowsAppRuntimeInstaller {
auto hrAddResult = AddPackage(packageUri, packageProperties);
if (!quiet)
{
- std::wcout << "Package deployment result : 0x" << std::hex << hrAddResult << std::endl;
+ std::wcout << "Package deployment result : 0x" << std::hex << hrAddResult << " ";
+ ShowErrorMessage(hrAddResult);
}
THROW_IF_FAILED(hrAddResult);
@@ -224,22 +238,94 @@ namespace WindowsAppRuntimeInstaller {
auto hrProvisionResult = ProvisionPackage(packageProperties->familyName.get());
if (!quiet)
{
- std::wcout << "Provisioning result : 0x" << std::hex << hrProvisionResult << std::endl;
+ std::wcout << "Provisioning result : 0x" << std::hex << hrProvisionResult << " ";
+ ShowErrorMessage(hrProvisionResult);
}
LOG_IF_FAILED(hrProvisionResult);
}
+ }
- return;
+ HRESULT Deploy(const WindowsAppRuntimeInstaller::Options options) noexcept try
+ {
+ // Install licenses before packages as we stop on first error. If something
+ // does go wrong better to have all licenses and some packages than all
+ // packages and some licenses, as the latter is harder to detect something
+ // is wrong (there's lots of ways to tell if a package is present or not
+ // but very few to determine if licenses are present). So worst case,
+ // it's easier (for tools and people) to see 'incomplete packages' and
+ // know what to do about it than for 'incomplete licenses'.
+ RETURN_IF_FAILED(InstallLicenses(options));
+ RETURN_IF_FAILED(DeployPackages(options));
+ return S_OK;
}
+ CATCH_RETURN()
- HRESULT DeployPackages(bool quiet) noexcept try
+ HRESULT InstallLicenses(const WindowsAppRuntimeInstaller::Options options)
{
- for (const auto& package : WindowsAppRuntimeInstaller::c_packages)
+#if defined(WAR_PROCESS_LICENSES)
+ const auto quiet{ WI_IsFlagSet(options, WindowsAppRuntimeInstaller::Options::Quiet) };
+
+ if (WI_IsFlagSet(options, WindowsAppRuntimeInstaller::Options::InstallLicenses))
{
- DeployPackageFromResource(package, quiet);
+ Microsoft::Windows::ApplicationModel::Licensing::Installer licenseInstaller;
+ for (const auto& license : WindowsAppRuntimeInstaller::c_licenses)
+ {
+ if (!quiet)
+ {
+ std::wcout << "Installing license: " << license.id << std::endl;
+ }
+
+ // DryRun = Don't the work
+ if (WI_IsFlagSet(options, WindowsAppRuntimeInstaller::Options::DryRun))
+ {
+ continue;
+ }
+
+ // Install the license
+ auto thisModule{ reinterpret_cast(&__ImageBase) };
+ const auto hr{ licenseInstaller.InstallLicense(thisModule, license.id) };
+ if (!quiet)
+ {
+ std::wcout << "Install result : 0x" << std::hex << hr << " ";
+ ShowErrorMessage(hr);
+ }
+ RETURN_IF_FAILED_MSG(hr, "License:%ls", license.id.c_str());
+ }
}
+#endif
+ return S_OK;
+ }
+ HRESULT DeployPackages(const WindowsAppRuntimeInstaller::Options options)
+ {
+ if (WI_IsFlagSet(options, WindowsAppRuntimeInstaller::Options::InstallPackages))
+ {
+ for (const auto& package : WindowsAppRuntimeInstaller::c_packages)
+ {
+ DeployPackageFromResource(package, options);
+ }
+ }
return S_OK;
}
- CATCH_RETURN()
+
+ void ShowErrorMessage(const HRESULT hr)
+ {
+ if (SUCCEEDED(hr))
+ {
+ std::wcout << std::endl;
+ return;
+ }
+
+ PWSTR message{};
+ if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+ nullptr, hr, 0, reinterpret_cast(&message), 0, nullptr) == 0)
+ {
+ std::wcout << "Error " << hr << " (0x" << std::hex << hr << ") in FormatMessage()" << std::endl;
+ }
+ else
+ {
+ std::wcout << message;
+ LocalFree(message);
+ }
+ }
}
diff --git a/installer/dev/install.h b/installer/dev/install.h
index abcc465eb7..08b0630b27 100644
--- a/installer/dev/install.h
+++ b/installer/dev/install.h
@@ -1,9 +1,22 @@
-#pragma once
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#pragma once
+
#include "pch.h"
#include "packages.h"
namespace WindowsAppRuntimeInstaller {
+ enum class Options
+ {
+ InstallPackages = 0x0001,
+ InstallLicenses = 0x0002,
+ Quiet = 0x0004,
+ DryRun = 0x0008,
+ };
+ DEFINE_ENUM_FLAG_OPERATORS(Options)
+
struct PackageProperties
{
wil::unique_cotaskmem_string fullName;
@@ -13,5 +26,11 @@ namespace WindowsAppRuntimeInstaller {
bool isFramework{};
};
- HRESULT DeployPackages(const bool quiet) noexcept;
+ HRESULT Deploy(const WindowsAppRuntimeInstaller::Options options) noexcept;
+
+ HRESULT InstallLicenses(const WindowsAppRuntimeInstaller::Options options);
+
+ HRESULT DeployPackages(const WindowsAppRuntimeInstaller::Options options);
+
+ void ShowErrorMessage(const HRESULT hr);
}
diff --git a/installer/dev/main.cpp b/installer/dev/main.cpp
index eeb512d1b6..b20c7a8ce0 100644
--- a/installer/dev/main.cpp
+++ b/installer/dev/main.cpp
@@ -1,4 +1,7 @@
-#include "pch.h"
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#include "pch.h"
#include "console.h"
#include "install.h"
#include "resource.h"
@@ -9,14 +12,39 @@ int wmain(int argc, wchar_t *argv[])
{
init_apartment();
- bool quiet = false;
+ auto options{ WindowsAppRuntimeInstaller::Options::InstallPackages |
+ WindowsAppRuntimeInstaller::Options::InstallLicenses };
for (int i = 1; i < argc; ++i)
{
auto arg = std::wstring_view(argv[i]);
- if ((arg == L"-q") || (arg == L"--quiet"))
+ if (arg == L"--dry-run")
+ {
+ WI_SetFlag(options, WindowsAppRuntimeInstaller::Options::DryRun);
+ }
+ else if (arg == L"--license")
+ {
+ WI_SetFlag(options, WindowsAppRuntimeInstaller::Options::InstallLicenses);
+ }
+ else if (arg == L"--license-")
+ {
+ WI_ClearFlag(options, WindowsAppRuntimeInstaller::Options::InstallLicenses);
+ }
+ else if (arg == L"--msix")
+ {
+ WI_SetFlag(options, WindowsAppRuntimeInstaller::Options::InstallPackages);
+ }
+ else if (arg == L"--msix-")
+ {
+ WI_ClearFlag(options, WindowsAppRuntimeInstaller::Options::InstallPackages);
+ }
+ else if ((arg == L"-q") || (arg == L"--quiet"))
+ {
+ WI_SetFlag(options, WindowsAppRuntimeInstaller::Options::Quiet);
+ }
+ else if ((arg == L"-q-") || (arg == L"--quiet-"))
{
- quiet = true;
+ WI_ClearFlag(options, WindowsAppRuntimeInstaller::Options::Quiet);
}
else if ((arg == L"-?") || (arg == L"--help"))
{
@@ -31,16 +59,16 @@ int wmain(int argc, wchar_t *argv[])
}
}
- const HRESULT deployPackagesResult{ WindowsAppRuntimeInstaller::DeployPackages(quiet) };
- if (!quiet)
+ const HRESULT deployPackagesResult{ WindowsAppRuntimeInstaller::Deploy(options) };
+ if (WI_IsFlagClear(options, WindowsAppRuntimeInstaller::Options::Quiet))
{
if (SUCCEEDED(deployPackagesResult))
{
- std::wcout << "All packages were installed successfully." << std::endl;
+ std::wcout << "All install operations successful." << std::endl;
}
else
{
- std::wcerr << "One or more packages failed to install. Result: 0x" << std::hex << deployPackagesResult << std::endl;
+ std::wcerr << "One or more install operations failed. Result: 0x" << std::hex << deployPackagesResult << std::endl;
}
}
diff --git a/installer/dev/packages.h b/installer/dev/packages.h
index 567acf7f3a..ef1f473187 100644
--- a/installer/dev/packages.h
+++ b/installer/dev/packages.h
@@ -1,4 +1,8 @@
-#pragma once
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#pragma once
+
#include "pch.h"
#include "windowsappruntime_definitions.h"
@@ -66,4 +70,31 @@ namespace WindowsAppRuntimeInstaller {
WAR_DDLM_X86_LISTENTRY
#endif
};
+
+ struct ResourceLicenseInfo
+ {
+ std::wstring id;
+ std::wstring resourceType;
+ };
+
+ #if !defined(WAR_PROCESS_LICENSES)
+ #if defined(WAR_MAIN_LICENSE_LISTENTRY) || defined(WAR_SINGLETON_LICENSE_LISTENTRY)
+ #define WAR_PROCESS_LICENSES
+ #else
+ #undef WAR_PROCESS_LICENSES
+ #endif
+ #endif
+
+ #if defined(WAR_PROCESS_LICENSES)
+ static ResourceLicenseInfo c_licenses[] =
+ {
+ #if defined(WAR_MAIN_LICENSE_LISTENTRY)
+ WAR_MAIN_LICENSE_LISTENTRY
+ #endif
+
+ #if defined(WAR_SINGLETON_LICENSE_LISTENTRY)
+ WAR_SINGLETON_LICENSE_LISTENTRY
+ #endif
+ };
+ #endif
}
diff --git a/installer/dev/pch.cpp b/installer/dev/pch.cpp
index 331e647d75..0c48fb2c79 100644
--- a/installer/dev/pch.cpp
+++ b/installer/dev/pch.cpp
@@ -1 +1,4 @@
-#include "pch.h"
\ No newline at end of file
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#include "pch.h"
diff --git a/installer/dev/pch.h b/installer/dev/pch.h
index 4de790ca99..c61b199218 100644
--- a/installer/dev/pch.h
+++ b/installer/dev/pch.h
@@ -1,8 +1,13 @@
-#pragma once
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#pragma once
+
#include
#include
#include
#include
+
#include
#include
#include
@@ -10,10 +15,14 @@
#include
#include
#include
+
#include
+
#include
#include
#include
#include
#include
#include
+
+#include "WindowsAppRuntime-License.h"
diff --git a/installer/dev/resource.h b/installer/dev/resource.h
index 177c9ece46..dfeb52b96b 100644
--- a/installer/dev/resource.h
+++ b/installer/dev/resource.h
@@ -1,4 +1,7 @@
-//{{NO_DEPENDENCIES}}
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by WindowsAppRuntimeInstall.rc
//
diff --git a/installer/dev/windowsappruntime_definitions.h b/installer/dev/windowsappruntime_definitions.h
index 2d4c7058d0..1590a0b9a1 100644
--- a/installer/dev/windowsappruntime_definitions.h
+++ b/installer/dev/windowsappruntime_definitions.h
@@ -1,4 +1,7 @@
- #pragma once
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See LICENSE in the project root for license information.
+
+#pragma once
// This header defines the packages included in the installer.
// By default, the project will use test packages built for verification of this installer.
@@ -78,6 +81,15 @@
#define WAR_MAIN_ARM64_PATH "..\\test\\testpackages\\main_arm64.msix"
#endif
+// license Main
+#define WAR_MAIN_LICENSE_ID L"WAR_MAINPACKAGE_LICENSE"
+#define WAR_MAIN_LICENSE_RCID WAR_MAINPACKAGE_LICENSE
+#define WAR_MAIN_LICENSE_TYPE L"LICENSE"
+#define WAR_MAIN_LICENSE_RCTYPE LICENSE
+#ifndef WAR_MAIN_LICENSE_PATH
+ #define WAR_MAIN_LICENSE_PATH "..\\test\\testpackages\\main_license.xml"
+#endif
+
// x86 Singleton
#define WAR_SINGLETON_X86_ID L"WAR_SINGLETONPACKAGE_X86"
#define WAR_SINGLETON_X86_RCID WAR_SINGLETONPACKAGE_X86
@@ -108,6 +120,15 @@
#define WAR_SINGLETON_ARM64_PATH "..\\test\\testpackages\\singleton_arm64.msix"
#endif
+// license Singleton
+#define WAR_SINGLETON_LICENSE_ID L"WAR_SINGLETONPACKAGE_LICENSE"
+#define WAR_SINGLETON_LICENSE_RCID WAR_SINGLETONPACKAGE_LICENSE
+#define WAR_SINGLETON_LICENSE_TYPE L"LICENSE"
+#define WAR_SINGLETON_LICENSE_RCTYPE LICENSE
+#ifndef WAR_SINGLETON_LICENSE_PATH
+ #define WAR_SINGLETON_LICENSE_PATH "..\\test\\testpackages\\singleton_license.xml"
+#endif
+
// x86 DDLM
#define WAR_DDLM_X86_ID L"WAR_DDLMPACKAGE_X86"
#define WAR_DDLM_X86_RCID WAR_DDLMPACKAGE_X86
@@ -179,6 +200,18 @@
#define WAR_DDLM_ARM64_LISTENTRY { WAR_DDLM_ARM64_ID, WAR_DDLM_ARM64_TYPE, WAR_DDLM_ARM64_BEHAVIOR },
#define WAR_DDLM_ARM64_RCENTRY WAR_DDLM_ARM64_RCID WAR_DDLM_ARM64_RCTYPE WAR_DDLM_ARM64_PATH
+// License Inclusion
+
+// NOTE: We default to assuming a Main license file and no Singleton license file for inner-loop purposes.
+// The build pipeline will define expected values in windowsappruntime_definitions_override.h for official builds.
+
+#define WAR_MAIN_LICENSE_LISTENTRY { WAR_MAIN_LICENSE_ID, WAR_MAIN_LICENSE_TYPE },
+#define WAR_MAIN_LICENSE_RCENTRY WAR_MAIN_LICENSE_RCID WAR_MAIN_LICENSE_RCTYPE WAR_MAIN_LICENSE_PATH
+
+#undef WAR_SINGLETON_LICENSE_LISTENTRY
+#undef WAR_SINGLETON_LICENSE_RCENTRY
+
+
// This is defined in the vcxproj based on existence of the header in the same directory.
// It is defined in both the c compiler preprocessor definitions and the resource compiler preprocessor definitions.
#ifdef USE_DEFINITIONS_OVERRIDE_HEADER
diff --git a/installer/test/CreateInstallerTestPackages/Makefile.mak b/installer/test/CreateInstallerTestPackages/Makefile.mak
new file mode 100644
index 0000000000..eb3b845c4c
--- /dev/null
+++ b/installer/test/CreateInstallerTestPackages/Makefile.mak
@@ -0,0 +1,126 @@
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See LICENSE in the project root for license information.
+
+MAKEAPPX_OPTS=
+!IFDEF VERBOSE
+MAKEAPPX_OPTS=/v
+!ENDIF
+
+SIGNTOOL_OPTS=
+!IFDEF VERBOSE
+SIGNTOOL_OPTS=/v
+!ENDIF
+
+!IFDEF VERBOSE
+!MESSAGE SolutionDir =$(SolutionDir)
+!MESSAGE ProjectDir =$(ProjectDir)
+!MESSAGE OutDir =$(OutDir)
+!MESSAGE TargetName =$(TargetName)
+!ENDIF
+
+TARGET_BASENAME=Microsoft.WindowsAppRuntime.Test.InstallFramework
+
+TargetDir=$(OutDir)$(TargetName)
+MSTestPfx=$(SolutionDir)..\..\..\temp\MSTest.pfx
+InstallerPackagesDir=$(SolutionDir)\..\testpackages
+WorkDir_x86=$(TargetDir)\msix_x86
+WorkDir_x64=$(TargetDir)\msix_x64
+WorkDir_arm64=$(TargetDir)\msix_arm64
+OutMsix_x86=$(TargetDir)\$(TargetName)_x86.msix
+OutMsix_x64=$(TargetDir)\$(TargetName)_x64.msix
+OutMsix_arm64=$(TargetDir)\$(TargetName)_arm64.msix
+Framework_x86=$(InstallerPackagesDir)\framework_x86.msix
+Framework_x64=$(InstallerPackagesDir)\framework_x64.msix
+Framework_arm64=$(InstallerPackagesDir)\framework_arm64.msix
+Main_x86=$(InstallerPackagesDir)\main_x86.msix
+Main_x64=$(InstallerPackagesDir)\main_x64.msix
+Main_arm64=$(InstallerPackagesDir)\main_arm64.msix
+Main_license=$(InstallerPackagesDir)\main_license.xml
+Singleton_x86=$(InstallerPackagesDir)\singleton_x86.msix
+Singleton_x64=$(InstallerPackagesDir)\singleton_x64.msix
+Singleton_arm64=$(InstallerPackagesDir)\singleton_arm64.msix
+DDLM_x86=$(InstallerPackagesDir)\ddlm_x86.msix
+DDLM_x64=$(InstallerPackagesDir)\ddlm_x64.msix
+DDLM_arm64=$(InstallerPackagesDir)\ddlm_arm64.msix
+
+verifypfx:
+ @if not exist $(MSTestPfx) echo Missing $(MSTestPfx), please run DevCheck.cmd to set up your developer environment. && exit /b 1
+
+all: build
+
+$(OutMsix_x86): $(ProjectDir)appxmanifest_fw_x86.xml
+ @if not exist $(WorkDir_x86) md $(WorkDir_x86) >NUL
+ @if not exist $(WorkDir_x86)\Assets md $(WorkDir_x86)\Assets >NUL
+ @copy /Y $(ProjectDir)Assets\* $(WorkDir_x86)\Assets\* >NUL
+ @copy /Y $(ProjectDir)appxmanifest_fw_x86.xml $(WorkDir_x86)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x86) /p $(OutMsix_x86)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x86)
+ @if not exist $(InstallerPackagesDir) md $(InstallerPackagesDir)
+ @copy /Y $(OutMsix_x86) $(Framework_x86) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_main_x86.xml $(WorkDir_x86)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x86) /p $(OutMsix_x86)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x86)
+ @copy /Y $(OutMsix_x86) $(Main_x86) >NUL
+ @copy /Y $(ProjectDir)main_license.xml $(Main_license) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_singleton_x86.xml $(WorkDir_x86)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x86) /p $(OutMsix_x86)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x86)
+ @copy /Y $(OutMsix_x86) $(Singleton_x86) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_ddlm_x86.xml $(WorkDir_x86)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x86) /p $(OutMsix_x86)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x86)
+ @copy /Y $(OutMsix_x86) $(DDLM_x86) >NUL
+
+$(OutMsix_x64): $(ProjectDir)appxmanifest_fw_x64.xml
+ @if not exist $(WorkDir_x64) md $(WorkDir_x64) >NUL
+ @if not exist $(WorkDir_x64)\Assets md $(WorkDir_x64)\Assets >NUL
+ @copy /Y $(ProjectDir)Assets\* $(WorkDir_x64)\Assets\* >NUL
+ @copy /Y $(ProjectDir)appxmanifest_fw_x64.xml $(WorkDir_x64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x64) /p $(OutMsix_x64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x64)
+ @if not exist $(InstallerPackagesDir) md $(InstallerPackagesDir)
+ @copy /Y $(OutMsix_x64) $(Framework_x64) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_main_x64.xml $(WorkDir_x64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x64) /p $(OutMsix_x64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x64)
+ @copy /Y $(OutMsix_x64) $(Main_x64) >NUL
+ @copy /Y $(ProjectDir)main_license.xml $(Main_license) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_singleton_x64.xml $(WorkDir_x64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x64) /p $(OutMsix_x64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x64)
+ @copy /Y $(OutMsix_x64) $(Singleton_x64) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_ddlm_x64.xml $(WorkDir_x64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_x64) /p $(OutMsix_x64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_x64)
+ @copy /Y $(OutMsix_x64) $(DDLM_x64) >NUL
+
+$(OutMsix_arm64): $(ProjectDir)appxmanifest_fw_arm64.xml
+ @if not exist $(WorkDir_arm64) md $(WorkDir_arm64) >NUL
+ @if not exist $(WorkDir_arm64)\Assets md $(WorkDir_arm64)\Assets >NUL
+ @copy /Y $(ProjectDir)Assets\* $(WorkDir_arm64)\Assets\* >NUL
+ @copy /Y $(ProjectDir)appxmanifest_fw_arm64.xml $(WorkDir_arm64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_arm64) /p $(OutMsix_arm64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_arm64)
+ @if not exist $(InstallerPackagesDir) md $(InstallerPackagesDir)
+ @copy /Y $(OutMsix_arm64) $(Framework_arm64) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_main_arm64.xml $(WorkDir_arm64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_arm64) /p $(OutMsix_arm64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_arm64)
+ @copy /Y $(OutMsix_arm64) $(Main_arm64) >NUL
+ @copy /Y $(ProjectDir)main_license.xml $(Main_license) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_singleton_arm64.xml $(WorkDir_arm64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_arm64) /p $(OutMsix_arm64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_arm64)
+ @copy /Y $(OutMsix_arm64) $(Singleton_arm64) >NUL
+ @copy /Y $(ProjectDir)appxmanifest_ddlm_arm64.xml $(WorkDir_arm64)\appxmanifest.xml >NUL
+ @makeappx.exe pack $(MAKEAPPX_OPTS)/o /h SHA256 /d $(WorkDir_arm64) /p $(OutMsix_arm64)
+ @signtool.exe sign /a $(SIGNTOOL_OPTS) /fd SHA256 /f $(MSTestPfx) $(OutMsix_arm64)
+ @copy /Y $(OutMsix_arm64) $(DDLM_arm64) >NUL
+
+clean:
+ @if exist $(TargetDir) rd $(TargetDir) /s /q
+ @if exist $(InstallerPackagesDir) rd $(InstallerPackagesDir) /s /q
+
+build: verifypfx $(OutMsix_x86) $(OutMsix_x64) $(OutMsix_arm64)
+
+rebuild: clean build
diff --git a/installer/test/CreateTestPackages/TestPackage_Framework/TestPackage_Framework.vcxproj b/installer/test/CreateTestPackages/TestPackage_Framework/TestPackage_Framework.vcxproj
index b3ac68ae95..92d1c13c95 100644
--- a/installer/test/CreateTestPackages/TestPackage_Framework/TestPackage_Framework.vcxproj
+++ b/installer/test/CreateTestPackages/TestPackage_Framework/TestPackage_Framework.vcxproj
@@ -85,6 +85,7 @@
appxmanifest.xml
+
$(RepoTestCertificatePFX)
@@ -95,6 +96,7 @@
+
diff --git a/installer/test/CreateTestPackages/TestPackage_Framework/main_license.xml b/installer/test/CreateTestPackages/TestPackage_Framework/main_license.xml
new file mode 100644
index 0000000000..ae6edf13a5
--- /dev/null
+++ b/installer/test/CreateTestPackages/TestPackage_Framework/main_license.xml
@@ -0,0 +1 @@
+9NDSMLH55WPCmicrosoftcorporationii.appnametestpackage_8wekyb3d8bbwe743e853a-f769-4592-934d-cadf190946952c3f1d47-426d-c7d7-face-ef1add208818False2021-11-09T20:58:29.5758952Z2021-11-09T20:58:29.5755999Z2021-11-09T20:58:29.5755987ZFAAAANgAAADJAAAACgAAAAMAAQD24IphAgDLAAAAEAAAABplsIyboV66mVT2AOKd/mvOAAAAcAAAAG0AaQBjAHIAbwBzAG8AZgB0AGMAbwByAHAAbwByAGEAdABpAG8AbgBpAGkALgBhAHAAcABuAGEAbQBlAHQAZQBzAHQAcABhAGMAawBhAGcAZQBfADgAdwBlAGsAeQBiADMAZAA4AGIAYgB3AGUAAADNAAAAIgAAAAEARF9KVhftTKFGI1Xj7uclv+xJ+qA+T81NpD6agN+wAgkgAAAABAAAAPbgimHMAAAARAAAAAEAAgB0Lx7uCZHOw4MSNOA6/W07o4UC3AvsoMhG5KJJhmutmFsYaJZvGNcPMroAWgHPDyg8rYk7lx8Y9a0gqBIgDjLR+M2Sqa5aCt+RqhQhwtkQyDjTABU9YKI7Zakib83/4Bs=GAFoIdf+m93Dlc714v51cpCl2aP0Q8L3UurFW9V/Ps4zYMNt0t8GuPCJ8+Y1ZngJBVVBF3+l+i2BSwNUf++b+AJkkS0MIJTgPswvokPjxxHbbNlrx3S1AoM/8JIjcbEF1HTeSUlOjT2anx1joiMhjreoE3rCVEKR/YeJW4x0hybx3ilZ0vHGSq9oHz2EL3pRCqz4J1hc5q4w+mbAdhJqI/imLZpXyQWTuHzfMuJ+Y3wUg6hpG0BC0l2F4JEOrwIqphYHtUQZ6hbo0bIoCIsJ8R1cAL/G4evbfi8xNK2fLv5tmkEkI2ehvjHAUvek2sLGuS3wQu85UyV8kG9+sOYzIg==oVSJXItDsaAIfwyR9bhh/ZSppCAO+in9POLWdC2/TQodgeHZzbdBvxJvKhpbrq6ZP0FsSElLwRoLAmv7zIuVw3Vb7tfQt5bjCDHRAG9fesNlYKV3ybyNrHyzglfZPRB5UJZw32yi03zQa+LLa05fjs6joEmlHc5BrGQrGrbNMBahz4cmuxKC4/dhEb7JZFUkc0MRhs/M3Ve511HQfKuG+92g1OffJdRsAPzWRdskPoN35knnqno7F85OBmGV/LNBgdtDWUH6di1eUCQFeKGfMp+Q/LFUX9jawTTEPn72tYbpYASug05Skcg6KTHlcLGzevxGw7BYsOsqfDka5n0YGw==AAEAAQ==
\ No newline at end of file