winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 53ceda5743d9a3c9405da5a03bfee6d29222d7e7
parent 34a3363c69615d5122095e04b827d9b511adb37b
Author: Flor Chacón <14323496+florelis@users.noreply.github.com>
Date:   Thu, 16 Jan 2025 16:41:41 -0800

Add sample projects of how to use the NuGet packages (#5142)

Adding some sample projects to demonstrate how to use all the NuGet
packages we publish - from C++ and C#, and using inproc and outofproc.

Diffstat:
Asamples/MinimalCallers/C#/Configuration-InProc/C#_Configuration_InProc.csproj | 21+++++++++++++++++++++
Asamples/MinimalCallers/C#/Configuration-InProc/Program.cs | 30++++++++++++++++++++++++++++++
Asamples/MinimalCallers/C#/Configuration-OutOfProc/C#_Configuration_OutOfProc.csproj | 21+++++++++++++++++++++
Asamples/MinimalCallers/C#/Configuration-OutOfProc/Program.cs | 28++++++++++++++++++++++++++++
Asamples/MinimalCallers/C#/WinGet-InProc/C#_WinGet_InProc.csproj | 39+++++++++++++++++++++++++++++++++++++++
Asamples/MinimalCallers/C#/WinGet-InProc/Program.cs | 25+++++++++++++++++++++++++
Asamples/MinimalCallers/C#/WinGet-OutOfProc/C#_WinGet_OutOfProc.csproj | 39+++++++++++++++++++++++++++++++++++++++
Asamples/MinimalCallers/C#/WinGet-OutOfProc/Program.cs | 25+++++++++++++++++++++++++
Asamples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.cpp | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asamples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.vcxproj | 118+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asamples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.vcxproj.filters | 26++++++++++++++++++++++++++
Asamples/MinimalCallers/C++/WinGet-InProc/packages.config | 6++++++
Asamples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.cpp | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asamples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.vcxproj | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asamples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.vcxproj.filters | 26++++++++++++++++++++++++++
Asamples/MinimalCallers/C++/WinGet-OutOfProc/packages.config | 6++++++
Asamples/MinimalCallers/MinimalCallers.sln | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asamples/MinimalCallers/README.md | 4++++
18 files changed, 760 insertions(+), 0 deletions(-)

diff --git a/samples/MinimalCallers/C#/Configuration-InProc/C#_Configuration_InProc.csproj b/samples/MinimalCallers/C#/Configuration-InProc/C#_Configuration_InProc.csproj @@ -0,0 +1,21 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net8.0-windows10.0.22000.0</TargetFramework> + <RootNamespace>Configuration_InProc</RootNamespace> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + <Platforms>x64;x86;ARM64</Platforms> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.WindowsPackageManager.Configuration" Version="1.9.25180" GeneratePathProperty="True" /> + </ItemGroup> + + <ItemGroup> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_Configuration)\runtimes\win10-$(Platform)\native\Microsoft.Management.Configuration.dll" Link="Microsoft.Management.Configuration.dll" CopyToOutputDirectory="PreserveNewest" /> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_Configuration)\runtimes\win10-$(Platform)\native\Microsoft.Management.Configuration.winmd" Link="Microsoft.Management.Configuration.winmd" CopyToOutputDirectory="PreserveNewest" /> + </ItemGroup> + +</Project> diff --git a/samples/MinimalCallers/C#/Configuration-InProc/Program.cs b/samples/MinimalCallers/C#/Configuration-InProc/Program.cs @@ -0,0 +1,30 @@ +// Shows the contents of a configuration yml file +using Windows.Storage; +using Microsoft.Management.Configuration; +using Microsoft.Management.Configuration.Processor; + +if (args.Length != 1) +{ + Console.WriteLine("Usage: Configuration-InProc <path>"); + return; +} + +var configStatics = new ConfigurationStaticFunctions(); +if (!configStatics.IsConfigurationAvailable) +{ + throw new Exception("Configuration is not available"); +} + +// Differs from the OutOfProc version in that we create the factory object directly +var factory = new PowerShellConfigurationSetProcessorFactory(); + +var processor = configStatics.CreateConfigurationProcessor(factory); + +var file = await StorageFile.GetFileFromPathAsync(args[0]); +var fileStream = await file.OpenStreamForReadAsync(); + +var openResult = processor.OpenConfigurationSet(fileStream.AsInputStream()); +var configSet = openResult.Set; + +Console.WriteLine("Configuration set:"); +configSet.Serialize(Console.OpenStandardOutput().AsOutputStream()); diff --git a/samples/MinimalCallers/C#/Configuration-OutOfProc/C#_Configuration_OutOfProc.csproj b/samples/MinimalCallers/C#/Configuration-OutOfProc/C#_Configuration_OutOfProc.csproj @@ -0,0 +1,21 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net8.0-windows10.0.22000.0</TargetFramework> + <RootNamespace>Configuration_OutOfProc</RootNamespace> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + <Platforms>x64;x86;ARM64</Platforms> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.WindowsPackageManager.Configuration.OutOfProc" Version="1.9.25180" GeneratePathProperty="True" /> + </ItemGroup> + + <ItemGroup> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_Configuration_OutOfProc)\runtimes\win10-$(Platform)\native\Microsoft.Management.Configuration.dll" Link="Microsoft.Management.Configuration.dll" CopyToOutputDirectory="PreserveNewest" /> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_Configuration_OutOfProc)\runtimes\win10-$(Platform)\native\Microsoft.Management.Configuration.winmd" Link="Microsoft.Management.Configuration.winmd" CopyToOutputDirectory="PreserveNewest" /> + </ItemGroup> + +</Project> diff --git a/samples/MinimalCallers/C#/Configuration-OutOfProc/Program.cs b/samples/MinimalCallers/C#/Configuration-OutOfProc/Program.cs @@ -0,0 +1,28 @@ +// Shows the contents of a configuration yml file +using Windows.Storage; +using Microsoft.Management.Configuration; + +if (args.Length != 1) +{ + Console.WriteLine("Usage: Configuration-InProc <path>"); + return; +} + +var configStatics = new ConfigurationStaticFunctions(); +if (!configStatics.IsConfigurationAvailable) +{ + throw new Exception("Configuration is not available"); +} + +var factory = await configStatics.CreateConfigurationSetProcessorFactoryAsync("pwsh"); + +var processor = configStatics.CreateConfigurationProcessor(factory); + +var file = await StorageFile.GetFileFromPathAsync(args[0]); +var fileStream = await file.OpenStreamForReadAsync(); + +var openResult = processor.OpenConfigurationSet(fileStream.AsInputStream()); +var configSet = openResult.Set; + +Console.WriteLine("Configuration set:"); +configSet.Serialize(Console.OpenStandardOutput().AsOutputStream()); diff --git a/samples/MinimalCallers/C#/WinGet-InProc/C#_WinGet_InProc.csproj b/samples/MinimalCallers/C#/WinGet-InProc/C#_WinGet_InProc.csproj @@ -0,0 +1,39 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net8.0-windows10.0.22000.0</TargetFramework> + <RootNamespace>WinGet_InProc</RootNamespace> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + <Platforms>x64;x86;ARM64</Platforms> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" /> + <PackageReference Include="Microsoft.WindowsPackageManager.InProcCom" Version="1.9.25180"> + <!-- NU1701: The package targets .NET Framework, but this uses .NET --> + <NoWarn>NU1701</NoWarn> + <GeneratePathProperty>true</GeneratePathProperty> + <IncludeAssets>none</IncludeAssets> + </PackageReference> + </ItemGroup> + + <!-- Tell CsWinRT to create the projection for the API --> + <PropertyGroup> + <CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata> + <CsWinRTIncludes>Microsoft.Management.Deployment</CsWinRTIncludes> + </PropertyGroup> + <ItemGroup> + <CsWinRTInputs Include="$(PkgMicrosoft_WindowsPackageManager_InProcCom)\lib\Microsoft.Management.Deployment.winmd" /> + </ItemGroup> + + <!-- Reference and include necessary binaries --> + <ItemGroup> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_InProcCom)\runtimes\win-$(Platform)\native\Microsoft.Management.Deployment.InProc.dll" Link="Microsoft.Management.Deployment.dll" CopyToOutputDirectory="PreserveNewest" /> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_InProcCom)\runtimes\win-$(Platform)\native\Microsoft.Management.Deployment.InProc.dll.manifest" Link="Microsoft.Management.Deployment.dll.manifest" CopyToOutputDirectory="PreserveNewest" /> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_InProcCom)\runtimes\win-$(Platform)\native\Microsoft.Management.Deployment.winmd" Link="Microsoft.Management.Deployment.winmd" CopyToOutputDirectory="PreserveNewest" /> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_InProcCom)\runtimes\win-$(Platform)\native\WindowsPackageManager.dll" Link="WindowsPackageManager.dll" CopyToOutputDirectory="PreserveNewest" /> + </ItemGroup> + +</Project> diff --git a/samples/MinimalCallers/C#/WinGet-InProc/Program.cs b/samples/MinimalCallers/C#/WinGet-InProc/Program.cs @@ -0,0 +1,25 @@ +// Lists all installed packages +using Microsoft.Management.Deployment; + +var packageManager = new PackageManager(); + +var installedCatalogConnectResult = packageManager.GetLocalPackageCatalog(LocalPackageCatalog.InstalledPackages).Connect(); +if (installedCatalogConnectResult.Status != ConnectResultStatus.Ok) +{ + throw new Exception("Error connecting to catalog"); +} + +var installedCatalog = installedCatalogConnectResult.PackageCatalog; + +var findOptions = new FindPackagesOptions(); +var searchResult = installedCatalog.FindPackages(findOptions); +if (searchResult.Status != FindPackagesResultStatus.Ok) +{ + throw new Exception("Error finding packages"); +} + +// Can't use foreach due to C#/WinRT limitations +for (int i = 0; i < searchResult.Matches.Count; ++i) +{ + Console.WriteLine("Package found: " + searchResult.Matches[i].CatalogPackage.Id); +} diff --git a/samples/MinimalCallers/C#/WinGet-OutOfProc/C#_WinGet_OutOfProc.csproj b/samples/MinimalCallers/C#/WinGet-OutOfProc/C#_WinGet_OutOfProc.csproj @@ -0,0 +1,39 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>Exe</OutputType> + <TargetFramework>net8.0-windows10.0.22000.0</TargetFramework> + <RootNamespace>WinGet_OutOfProc</RootNamespace> + <ImplicitUsings>enable</ImplicitUsings> + <Nullable>enable</Nullable> + <Platforms>x64;ARM64;x86</Platforms> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.2.0" /> + <PackageReference Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.9.25180"> + <!-- NU1701: The package targets .NET Framework, but this uses .NET --> + <NoWarn>NU1701</NoWarn> + <GeneratePathProperty>true</GeneratePathProperty> + <IncludeAssets>none</IncludeAssets> + </PackageReference> + </ItemGroup> + + <!-- Tell CsWinRT to create the projection for the API --> + <PropertyGroup> + <CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata> + <CsWinRTIncludes>Microsoft.Management.Deployment</CsWinRTIncludes> + </PropertyGroup> + <ItemGroup> + <CsWinRTInputs Include="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\lib\Microsoft.Management.Deployment.winmd" /> + </ItemGroup> + + <!-- Reference and include necessary binaries --> + <ItemGroup> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\lib\Microsoft.Management.Deployment.winmd" Link="Microsoft.Management.Deployment.winmd" CopyToOutputDirectory="PreserveNewest" /> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\runtimes\win10-$(Platform)\native\winrtact.dll" Link="winrtact.dll" CopyToOutputDirectory="PreserveNewest" /> + <!-- Replace 'dynamic' with 'static' to use binaries compiled with static linking --> + <Content Include="$(PkgMicrosoft_WindowsPackageManager_ComInterop)\bin\win10-$(Platform)\native\dynamic\Microsoft.Management.Deployment.dll" Link="Microsoft.Management.Deployment.dll" CopyToOutputDirectory="PreserveNewest" /> + </ItemGroup> + +</Project> diff --git a/samples/MinimalCallers/C#/WinGet-OutOfProc/Program.cs b/samples/MinimalCallers/C#/WinGet-OutOfProc/Program.cs @@ -0,0 +1,25 @@ +// Lists all installed packages +using Microsoft.Management.Deployment; + +var packageManager = new PackageManager(); + +var installedCatalogConnectResult = packageManager.GetLocalPackageCatalog(LocalPackageCatalog.InstalledPackages).Connect(); +if (installedCatalogConnectResult.Status != ConnectResultStatus.Ok) +{ + throw new Exception("Error connecting to catalog"); +} + +var installedCatalog = installedCatalogConnectResult.PackageCatalog; + +var findOptions = new FindPackagesOptions(); +var searchResult = installedCatalog.FindPackages(findOptions); +if (searchResult.Status != FindPackagesResultStatus.Ok) +{ + throw new Exception("Error finding packages"); +} + +// Can't use foreach due to C#/WinRT limitations +for (int i = 0; i < searchResult.Matches.Count; ++i) +{ + Console.WriteLine("Package found: " + searchResult.Matches[i].CatalogPackage.Id); +} diff --git a/samples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.cpp b/samples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.cpp @@ -0,0 +1,54 @@ +#include <Windows.h> + +#include <winrt/Microsoft.Management.Deployment.h> +#include <winrt/Windows.Foundation.Collections.h> + +#include <iostream> + +using namespace winrt::Microsoft::Management::Deployment; + +const CLSID CLSID_PackageManager = { 0xC53A4F16, 0x787E, 0x42A4, 0xB3, 0x04, 0x29, 0xEF, 0xFB, 0x4B, 0xF5, 0x97 }; //C53A4F16-787E-42A4-B304-29EFFB4BF597 +const CLSID CLSID_FindPackagesOptions = { 0x572DED96, 0x9C60, 0x4526, { 0x8F, 0x92, 0xEE, 0x7D, 0x91, 0xD3, 0x8C, 0x1A } }; //572DED96-9C60-4526-8F92-EE7D91D38C1A + +// Simple RAII for COM initialization +struct ComInitialization +{ + ComInitialization() + { + winrt::check_hresult(CoInitialize(nullptr)); + } + + ~ComInitialization() + { + CoUninitialize(); + } +}; + +// Lists all installed packages +int main() +{ + ComInitialization comInitialization; + + auto packageManager = winrt::create_instance<PackageManager>(CLSID_PackageManager, CLSCTX_ALL); + + auto installedCatalogConnectResult = packageManager.GetLocalPackageCatalog(LocalPackageCatalog::InstalledPackages).Connect(); + if (installedCatalogConnectResult.Status() != ConnectResultStatus::Ok) + { + std::wcerr << L"Error connecting to catalog" << std::endl; + return E_FAIL; + } + auto installedCatalog = installedCatalogConnectResult.PackageCatalog(); + + auto findOptions = winrt::create_instance<FindPackagesOptions>(CLSID_FindPackagesOptions, CLSCTX_ALL); + auto searchResult = installedCatalog.FindPackages(findOptions); + if (searchResult.Status() != FindPackagesResultStatus::Ok) + { + std::wcerr << L"Error finding packages" << std::endl; + return E_FAIL; + } + + for (auto package : searchResult.Matches()) + { + std::wcout << L"Found package: " << package.CatalogPackage().Id().c_str() << std::endl; + } +} diff --git a/samples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.vcxproj b/samples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.vcxproj @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" /> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM64"> + <Configuration>Debug</Configuration> + <Platform>ARM64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM64"> + <Configuration>Release</Configuration> + <Platform>ARM64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>17.0</VCProjectVersion> + <Keyword>Win32Proj</Keyword> + <ProjectGuid>{925454b7-a3fa-40c9-806a-4b64d5764157}</ProjectGuid> + <RootNamespace>WinGetInProc</RootNamespace> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + <ProjectName>C++_WinGet_InProc</ProjectName> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <PlatformToolset>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> + <UseDebugLibraries>true</UseDebugLibraries> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <ItemDefinitionGroup> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> + <ClCompile> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> + <ClCompile> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="WinGet-InProc.cpp" /> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <!-- Reference the .winmd so that it can be processed by CppWinRT --> + <ItemGroup> + <Reference Include="Microsoft.Management.Deployment"> + <HintPath>..\..\packages\Microsoft.WindowsPackageManager.InProcCom.1.9.25180\lib\Microsoft.Management.Deployment.winmd</HintPath> + <IsWinMDFile>true</IsWinMDFile> + </Reference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + <Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets')" /> + </ImportGroup> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props'))" /> + <Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets'))" /> + </Target> +</Project>+ \ No newline at end of file diff --git a/samples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.vcxproj.filters b/samples/MinimalCallers/C++/WinGet-InProc/WinGet-InProc.vcxproj.filters @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="WinGet-InProc.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> +</Project>+ \ No newline at end of file diff --git a/samples/MinimalCallers/C++/WinGet-InProc/packages.config b/samples/MinimalCallers/C++/WinGet-InProc/packages.config @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" /> + <package id="Microsoft.WindowsPackageManager.InProcCom" version="1.9.25180" targetFramework="native" /> +</packages>+ \ No newline at end of file diff --git a/samples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.cpp b/samples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.cpp @@ -0,0 +1,54 @@ +#include <Windows.h> + +#include <winrt/Microsoft.Management.Deployment.h> +#include <winrt/Windows.Foundation.Collections.h> + +#include <iostream> + +using namespace winrt::Microsoft::Management::Deployment; + +const CLSID CLSID_PackageManager = { 0xC53A4F16, 0x787E, 0x42A4, 0xB3, 0x04, 0x29, 0xEF, 0xFB, 0x4B, 0xF5, 0x97 }; //C53A4F16-787E-42A4-B304-29EFFB4BF597 +const CLSID CLSID_FindPackagesOptions = { 0x572DED96, 0x9C60, 0x4526, { 0x8F, 0x92, 0xEE, 0x7D, 0x91, 0xD3, 0x8C, 0x1A } }; //572DED96-9C60-4526-8F92-EE7D91D38C1A + +// Simple RAII for COM initialization +struct ComInitialization +{ + ComInitialization() + { + winrt::check_hresult(CoInitialize(nullptr)); + } + + ~ComInitialization() + { + CoUninitialize(); + } +}; + +// Lists all installed packages +int main() +{ + ComInitialization comInitialization; + + auto packageManager = winrt::create_instance<PackageManager>(CLSID_PackageManager, CLSCTX_ALL); + + auto installedCatalogConnectResult = packageManager.GetLocalPackageCatalog(LocalPackageCatalog::InstalledPackages).Connect(); + if (installedCatalogConnectResult.Status() != ConnectResultStatus::Ok) + { + std::wcerr << L"Error connecting to catalog" << std::endl; + return E_FAIL; + } + auto installedCatalog = installedCatalogConnectResult.PackageCatalog(); + + auto findOptions = winrt::create_instance<FindPackagesOptions>(CLSID_FindPackagesOptions, CLSCTX_ALL); + auto searchResult = installedCatalog.FindPackages(findOptions); + if (searchResult.Status() != FindPackagesResultStatus::Ok) + { + std::wcerr << L"Error finding packages" << std::endl; + return E_FAIL; + } + + for (auto package : searchResult.Matches()) + { + std::wcout << L"Found package: " << package.CatalogPackage().Id().c_str() << std::endl; + } +} diff --git a/samples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.vcxproj b/samples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.vcxproj @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" /> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|ARM64"> + <Configuration>Debug</Configuration> + <Platform>ARM64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|ARM64"> + <Configuration>Release</Configuration> + <Platform>ARM64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>17.0</VCProjectVersion> + <Keyword>Win32Proj</Keyword> + <ProjectGuid>{01cb5485-d1f3-421f-8e8a-7bc04b9ca037}</ProjectGuid> + <RootNamespace>WinGetOutOfProc</RootNamespace> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + <ProjectName>C++_WinGet_OutOfProc</ProjectName> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <PlatformToolset>v143</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> + <UseDebugLibraries>true</UseDebugLibraries> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <ItemDefinitionGroup> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> + <ClCompile> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> + <ClCompile> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="WinGet-OutOfProc.cpp" /> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <!-- Reference and include necessary binaries --> + <PropertyGroup> + <WinGetNuGetPlatform Condition="'$(Platform)' == 'Win32'">x86</WinGetNuGetPlatform> + <WinGetNuGetPlatform Condition="'$(Platform)' != 'Win32'">$(Platform)</WinGetNuGetPlatform> + </PropertyGroup> + <ItemGroup> + <WindowsMetadataReference Include="..\..\packages\Microsoft.WindowsPackageManager.ComInterop.1.9.25180\lib\Microsoft.Management.Deployment.winmd" /> + <Reference Include="..\..\packages\Microsoft.WindowsPackageManager.ComInterop.1.9.25180\lib\Microsoft.Management.Deployment.winmd"> + <Implementation>Microsoft.Management.Deployment.dll</Implementation> + </Reference> + <ReferenceCopyLocalPaths Include="..\..\packages\Microsoft.WindowsPackageManager.ComInterop.1.9.25180\lib\Microsoft.Management.Deployment.winmd"> + <Implementation>Microsoft.Management.Deployment.dll</Implementation> + <IsOutOfProcess>true</IsOutOfProcess> + </ReferenceCopyLocalPaths> + <!-- Replace 'dynamic' with 'static' to use binaries compiled with static linking --> + <ReferenceCopyLocalPaths Include="..\..\packages\Microsoft.WindowsPackageManager.ComInterop.1.9.25180\bin\win10-$(WinGetNuGetPlatform)\native\dynamic\Microsoft.Management.Deployment.dll" /> + <ReferenceCopyLocalPaths Include="..\..\packages\Microsoft.WindowsPackageManager.ComInterop.1.9.25180\runtimes\win10-$(WinGetNuGetPlatform)\native\winrtact.dll" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + <Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets')" /> + </ImportGroup> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.props'))" /> + <Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.240405.15\build\native\Microsoft.Windows.CppWinRT.targets'))" /> + </Target> +</Project>+ \ No newline at end of file diff --git a/samples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.vcxproj.filters b/samples/MinimalCallers/C++/WinGet-OutOfProc/WinGet-OutOfProc.vcxproj.filters @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="WinGet-OutOfProc.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> +</Project>+ \ No newline at end of file diff --git a/samples/MinimalCallers/C++/WinGet-OutOfProc/packages.config b/samples/MinimalCallers/C++/WinGet-OutOfProc/packages.config @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Microsoft.Windows.CppWinRT" version="2.0.240405.15" targetFramework="native" /> + <package id="Microsoft.WindowsPackageManager.ComInterop" version="1.9.25180" targetFramework="native" /> +</packages>+ \ No newline at end of file diff --git a/samples/MinimalCallers/MinimalCallers.sln b/samples/MinimalCallers/MinimalCallers.sln @@ -0,0 +1,109 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35527.113 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{ABB7C5E7-2192-4D33-9130-BBB951BF9284}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "C#", "C#", "{FD31D4E6-4934-4273-B5A3-C89CF7197E93}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C#_WinGet_OutOfProc", "C#\WinGet-OutOfProc\C#_WinGet_OutOfProc.csproj", "{A7CC8A07-02FC-4035-848F-1EBECCCE9C07}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C#_WinGet_InProc", "C#\WinGet-InProc\C#_WinGet_InProc.csproj", "{DD80F640-5071-4200-9BDE-620FBDFF1725}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C#_Configuration_InProc", "C#\Configuration-InProc\C#_Configuration_InProc.csproj", "{B44C18DE-FE76-4D30-B740-25A5AD99257F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C#_Configuration_OutOfProc", "C#\Configuration-OutOfProc\C#_Configuration_OutOfProc.csproj", "{93B5C28B-04AC-4B35-9253-81C1405D9A72}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "C++", "C++", "{41D22958-B935-4B37-A3BA-9E60441CE3E9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "C++_WinGet_InProc", "C++\WinGet-InProc\WinGet-InProc.vcxproj", "{925454B7-A3FA-40C9-806A-4B64D5764157}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "C++_WinGet_OutOfProc", "C++\WinGet-OutOfProc\WinGet-OutOfProc.vcxproj", "{01CB5485-D1F3-421F-8E8A-7BC04B9CA037}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Debug|ARM64.Build.0 = Debug|ARM64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Debug|x64.ActiveCfg = Debug|x64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Debug|x64.Build.0 = Debug|x64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Debug|x86.ActiveCfg = Debug|x86 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Debug|x86.Build.0 = Debug|x86 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Release|ARM64.ActiveCfg = Release|ARM64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Release|ARM64.Build.0 = Release|ARM64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Release|x64.ActiveCfg = Release|x64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Release|x64.Build.0 = Release|x64 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Release|x86.ActiveCfg = Release|x86 + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07}.Release|x86.Build.0 = Release|x86 + {DD80F640-5071-4200-9BDE-620FBDFF1725}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {DD80F640-5071-4200-9BDE-620FBDFF1725}.Debug|x64.ActiveCfg = Debug|x64 + {DD80F640-5071-4200-9BDE-620FBDFF1725}.Debug|x86.ActiveCfg = Debug|x86 + {DD80F640-5071-4200-9BDE-620FBDFF1725}.Release|ARM64.ActiveCfg = Release|ARM64 + {DD80F640-5071-4200-9BDE-620FBDFF1725}.Release|x64.ActiveCfg = Release|x64 + {DD80F640-5071-4200-9BDE-620FBDFF1725}.Release|x86.ActiveCfg = Release|x86 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Debug|ARM64.Build.0 = Debug|ARM64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Debug|x64.ActiveCfg = Debug|x64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Debug|x64.Build.0 = Debug|x64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Debug|x86.ActiveCfg = Debug|x86 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Debug|x86.Build.0 = Debug|x86 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Release|ARM64.ActiveCfg = Release|ARM64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Release|ARM64.Build.0 = Release|ARM64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Release|x64.ActiveCfg = Release|x64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Release|x64.Build.0 = Release|x64 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Release|x86.ActiveCfg = Release|x86 + {B44C18DE-FE76-4D30-B740-25A5AD99257F}.Release|x86.Build.0 = Release|x86 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Debug|ARM64.Build.0 = Debug|ARM64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Debug|x64.ActiveCfg = Debug|x64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Debug|x64.Build.0 = Debug|x64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Debug|x86.ActiveCfg = Debug|x86 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Debug|x86.Build.0 = Debug|x86 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Release|ARM64.ActiveCfg = Release|ARM64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Release|ARM64.Build.0 = Release|ARM64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Release|x64.ActiveCfg = Release|x64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Release|x64.Build.0 = Release|x64 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Release|x86.ActiveCfg = Release|x86 + {93B5C28B-04AC-4B35-9253-81C1405D9A72}.Release|x86.Build.0 = Release|x86 + {925454B7-A3FA-40C9-806A-4B64D5764157}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {925454B7-A3FA-40C9-806A-4B64D5764157}.Debug|x64.ActiveCfg = Debug|x64 + {925454B7-A3FA-40C9-806A-4B64D5764157}.Debug|x86.ActiveCfg = Debug|Win32 + {925454B7-A3FA-40C9-806A-4B64D5764157}.Release|ARM64.ActiveCfg = Release|ARM64 + {925454B7-A3FA-40C9-806A-4B64D5764157}.Release|x64.ActiveCfg = Release|x64 + {925454B7-A3FA-40C9-806A-4B64D5764157}.Release|x86.ActiveCfg = Release|Win32 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Debug|ARM64.Build.0 = Debug|ARM64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Debug|x64.ActiveCfg = Debug|x64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Debug|x64.Build.0 = Debug|x64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Debug|x86.ActiveCfg = Debug|Win32 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Debug|x86.Build.0 = Debug|Win32 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Release|ARM64.ActiveCfg = Release|ARM64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Release|ARM64.Build.0 = Release|ARM64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Release|x64.ActiveCfg = Release|x64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Release|x64.Build.0 = Release|x64 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Release|x86.ActiveCfg = Release|Win32 + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A7CC8A07-02FC-4035-848F-1EBECCCE9C07} = {FD31D4E6-4934-4273-B5A3-C89CF7197E93} + {DD80F640-5071-4200-9BDE-620FBDFF1725} = {FD31D4E6-4934-4273-B5A3-C89CF7197E93} + {B44C18DE-FE76-4D30-B740-25A5AD99257F} = {FD31D4E6-4934-4273-B5A3-C89CF7197E93} + {93B5C28B-04AC-4B35-9253-81C1405D9A72} = {FD31D4E6-4934-4273-B5A3-C89CF7197E93} + {925454B7-A3FA-40C9-806A-4B64D5764157} = {41D22958-B935-4B37-A3BA-9E60441CE3E9} + {01CB5485-D1F3-421F-8E8A-7BC04B9CA037} = {41D22958-B935-4B37-A3BA-9E60441CE3E9} + EndGlobalSection +EndGlobal diff --git a/samples/MinimalCallers/README.md b/samples/MinimalCallers/README.md @@ -0,0 +1,3 @@ +# Sample projects for COM APIs + +These are minimal samples for using the winget COM APIs in C++ and C#. The samples are mostly centered around the required project settings. For a more fleshed out example, see [`/Samples/WinGetUWPCaller`](https://github.com/microsoft/winget-cli/tree/master/samples/WinGetUWPCaller).+ \ No newline at end of file