Skip to content

Commit 7f9c212

Browse files
authored
[Experimental] Self-contained deployment samples (#152)
* Initial self-contained deployment sample. * Pull description from Resources.resw to exercise MRT Core. * Bind to the description with x:Uid. * Added README.md. * Added a C# console sample. * Added the license header. * Removed AnyCPU and added ARM64. * Removed empty directories. * Added a C# packaging project sample. * Added cpp-winui-packaged. * Added a C++ console sample. * Removed unnecessary guidance. * Removed unnecessary qualifier. * Removed unnecessary qualifier. * Removed unnecessary code. * Added cpp-winui-unpackaged. MRT won't resolve without changing the x:Uid. * Added workaround for https://task.ms/36913638. * Added cs-winui-unpackaged. * Added PublishProfiles to the console sample. * Updated to .NET 6. Updated WinAppSDK. Removed workaround for Package.appxmanifest. * Updated to .NET 6. Updated WinAppSDK. * Added cs-wpf-unpackaged. * Updated SDK references. * Updated SDK version. * Updated SDK references. * Updated SDK references. * Updated SDK references. * Updated to 1.1.0-preview1. * Updated stale vcxproj package references. * Added Hybrid CRT to enable xcopy deployment. * Added hybrid CRT to cpp-console-unpackaged. * Added hybrid CRT to cpp-winui-packaged. * Updated C++ samples to 1.1-preview3. * Updated C# samples to 1.1-preview3.
1 parent db8b8b9 commit 7f9c212

File tree

190 files changed

+6979
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+6979
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
page_type: sample
3+
languages:
4+
- csharp
5+
- cppwinrt
6+
products:
7+
- windows
8+
- windows-app-sdk
9+
name: "Self-Contained Deployment"
10+
urlFragment: SelfContainedDeployment
11+
description: "Deploy the Windows App SDK with your application rather than as a framework package dependency."
12+
extendedZipContent:
13+
- path: LICENSE
14+
target: LICENSE
15+
---
16+
17+
# Self-Contained Deployment
18+
19+
Deploy the Windows App SDK with your application rather than as a framework package dependency.
20+
21+
## Prerequisites
22+
23+
* See [System requirements for Windows app development](https://docs.microsoft.com/windows/apps/windows-app-sdk/system-requirements).
24+
* Make sure that your development environment is set up correctly—see [Install tools for developing apps for Windows 10 and Windows 11](https://docs.microsoft.com/windows/apps/windows-app-sdk/set-up-your-development-environment).
25+
26+
## Building and running any of the samples
27+
28+
* Open the solution file (`.sln`) from the subfolder of your preferred sample in Visual Studio.
29+
* From Visual Studio, either **Start Without Debugging** (Ctrl+F5) or **Start Debugging** (F5).
30+
31+
## Related Links
32+
33+
- [Windows App SDK](https://docs.microsoft.com/windows/apps/windows-app-sdk/)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildThisFileDirectory)HybridCRT.props" />
4+
</Project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
3+
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4+
5+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
6+
<ClCompile>
7+
<!-- We use MultiThreadedDebug, rather than MultiThreadedDebugDLL, to avoid DLL dependencies on VCRUNTIME140d.dll and MSVCP140d.dll. -->
8+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
9+
</ClCompile>
10+
<Link>
11+
<!-- Link statically against the runtime and STL, but link dynamically against the CRT by ignoring the static CRT
12+
lib and instead linking against the Universal CRT DLL import library. This "hybrid" linking mechanism is
13+
supported according to the CRT maintainer. Dynamic linking against the CRT makes the binaries a bit smaller
14+
than they would otherwise be if the CRT, runtime, and STL were all statically linked in. -->
15+
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries);libucrtd.lib</IgnoreSpecificDefaultLibraries>
16+
<AdditionalOptions>%(AdditionalOptions) /defaultlib:ucrtd.lib</AdditionalOptions>
17+
</Link>
18+
</ItemDefinitionGroup>
19+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
20+
<ClCompile>
21+
<!-- We use MultiThreaded, rather than MultiThreadedDLL, to avoid DLL dependencies on VCRUNTIME140.dll and MSVCP140.dll. -->
22+
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
23+
</ClCompile>
24+
<Link>
25+
<!-- Link statically against the runtime and STL, but link dynamically against the CRT by ignoring the static CRT
26+
lib and instead linking against the Universal CRT DLL import library. This "hybrid" linking mechanism is
27+
supported according to the CRT maintainer. Dynamic linking against the CRT makes the binaries a bit smaller
28+
than they would otherwise be if the CRT, runtime, and STL were all statically linked in. -->
29+
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries);libucrt.lib</IgnoreSpecificDefaultLibraries>
30+
<AdditionalOptions>%(AdditionalOptions) /defaultlib:ucrt.lib</AdditionalOptions>
31+
</Link>
32+
</ItemDefinitionGroup>
33+
34+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ImportGroup Label="PropertySheets" />
4+
<PropertyGroup Label="UserMacros" />
5+
<!--
6+
To customize common C++/WinRT project properties:
7+
* right-click the project node
8+
* expand the Common Properties item
9+
* select the C++/WinRT property page
10+
11+
For more advanced scenarios, and complete documentation, please see:
12+
https://github.com/Microsoft/cppwinrt/tree/master/nuget
13+
-->
14+
<PropertyGroup />
15+
<ItemDefinitionGroup />
16+
</Project>
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root>
3+
<!--
4+
Microsoft ResX Schema
5+
6+
Version 2.0
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
11+
associated with the data types.
12+
13+
Example:
14+
15+
... ado.net/XML headers & schema ...
16+
<resheader name="resmimetype">text/microsoft-resx</resheader>
17+
<resheader name="version">2.0</resheader>
18+
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19+
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20+
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21+
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22+
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23+
<value>[base64 mime encoded serialized .NET Framework object]</value>
24+
</data>
25+
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26+
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27+
<comment>This is a comment</comment>
28+
</data>
29+
30+
There are any number of "resheader" rows that contain simple
31+
name/value pairs.
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
37+
mimetype set.
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
41+
extensible. For a given mimetype the value must be set accordingly:
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
45+
read any of the formats listed below.
46+
47+
mimetype: application/x-microsoft.net.object.binary.base64
48+
value : The object must be serialized with
49+
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50+
: and then encoded with base64 encoding.
51+
52+
mimetype: application/x-microsoft.net.object.soap.base64
53+
value : The object must be serialized with
54+
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55+
: and then encoded with base64 encoding.
56+
57+
mimetype: application/x-microsoft.net.object.bytearray.base64
58+
value : The object must be serialized into a byte array
59+
: using a System.ComponentModel.TypeConverter
60+
: and then encoded with base64 encoding.
61+
-->
62+
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63+
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64+
<xsd:element name="root" msdata:IsDataSet="true">
65+
<xsd:complexType>
66+
<xsd:choice maxOccurs="unbounded">
67+
<xsd:element name="metadata">
68+
<xsd:complexType>
69+
<xsd:sequence>
70+
<xsd:element name="value" type="xsd:string" minOccurs="0" />
71+
</xsd:sequence>
72+
<xsd:attribute name="name" use="required" type="xsd:string" />
73+
<xsd:attribute name="type" type="xsd:string" />
74+
<xsd:attribute name="mimetype" type="xsd:string" />
75+
<xsd:attribute ref="xml:space" />
76+
</xsd:complexType>
77+
</xsd:element>
78+
<xsd:element name="assembly">
79+
<xsd:complexType>
80+
<xsd:attribute name="alias" type="xsd:string" />
81+
<xsd:attribute name="name" type="xsd:string" />
82+
</xsd:complexType>
83+
</xsd:element>
84+
<xsd:element name="data">
85+
<xsd:complexType>
86+
<xsd:sequence>
87+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88+
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89+
</xsd:sequence>
90+
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91+
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92+
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93+
<xsd:attribute ref="xml:space" />
94+
</xsd:complexType>
95+
</xsd:element>
96+
<xsd:element name="resheader">
97+
<xsd:complexType>
98+
<xsd:sequence>
99+
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100+
</xsd:sequence>
101+
<xsd:attribute name="name" type="xsd:string" use="required" />
102+
</xsd:complexType>
103+
</xsd:element>
104+
</xsd:choice>
105+
</xsd:complexType>
106+
</xsd:element>
107+
</xsd:schema>
108+
<resheader name="resmimetype">
109+
<value>text/microsoft-resx</value>
110+
</resheader>
111+
<resheader name="version">
112+
<value>2.0</value>
113+
</resheader>
114+
<resheader name="reader">
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116+
</resheader>
117+
<resheader name="writer">
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119+
</resheader>
120+
<data name="Description" xml:space="preserve">
121+
<value>Add &lt;WindowsAppSDKSelfContained&gt;true&lt;/WindowsAppSDKSelfContained&gt; to the project file to enable self-contained deployment.
122+
123+
Right-click the project then select Edit Project File to open the project file for editing, then add &lt;WindowsAppSDKSelfContained&gt;true&lt;/WindowsAppSDKSelfContained&gt; to the main PropertyGroup. You may need to select Unload Project first before Edit Project File is offered.
124+
125+
The contents of the Windows App SDK framework package will be extracted to your build output and deployed as part of your application.</value>
126+
</data>
127+
</root>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.1.31911.260
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SelfContainedDeployment", "SelfContainedDeployment.vcxproj", "{3E29D69A-7C0F-4089-BA35-9A45497DC333}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM64 = Debug|ARM64
11+
Debug|x64 = Debug|x64
12+
Debug|x86 = Debug|x86
13+
Release|ARM64 = Release|ARM64
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Debug|ARM64.ActiveCfg = Debug|ARM64
19+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Debug|ARM64.Build.0 = Debug|ARM64
20+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Debug|x64.ActiveCfg = Debug|x64
21+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Debug|x64.Build.0 = Debug|x64
22+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Debug|x86.ActiveCfg = Debug|Win32
23+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Debug|x86.Build.0 = Debug|Win32
24+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Release|ARM64.ActiveCfg = Release|ARM64
25+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Release|ARM64.Build.0 = Release|ARM64
26+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Release|x64.ActiveCfg = Release|x64
27+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Release|x64.Build.0 = Release|x64
28+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Release|x86.ActiveCfg = Release|Win32
29+
{3E29D69A-7C0F-4089-BA35-9A45497DC333}.Release|x86.Build.0 = Release|Win32
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {0F1CFBFF-A001-4C9C-B8FF-03AA4CB42668}
36+
EndGlobalSection
37+
EndGlobal

0 commit comments

Comments
 (0)