Skip to content

Commit 25fe18d

Browse files
Separate setup app to install, launch and uninstall the cpp/winrt app (#45)
* Separate setup app to install, launch and uninstall the cpp/winrt app * Retargeted to "latest installed SDK version". * Addressed PR comments * Addressed PR comments * Fixed casing. * Addressed PR comments * Addressed PR comments * More chagnes * More changes * Addressed PR comments --------- Co-authored-by: Mike Battista <13860912+mikebattista@users.noreply.github.com>
1 parent bec8689 commit 25fe18d

File tree

11 files changed

+355
-36
lines changed

11 files changed

+355
-36
lines changed

Samples/PackageWithExternalLocation/cppwinrt/PackageWithExternalLocationCppApp.sln

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.13.35931.197 d17.13
4+
VisualStudioVersion = 17.13.35931.197
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PackageWithExternalLocationCppApp", "PackageWithExternalLocationCppApp\PackageWithExternalLocationCppApp.vcxproj", "{32A904A3-B902-4D21-B150-98D77B3E0916}"
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PackageWithExternalLocationCppApp", "PackageWithExternalLocationCppApp\PackageWithExternalLocationCppApp.vcxproj", "{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}"
7+
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PackageWithExternalLocationCppAppSetup", "PackageWithExternalLocationCppAppSetup\PackageWithExternalLocationCppAppSetup.vcxproj", "{EF52920E-B52D-48E9-9348-88E89429E26D}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,14 +15,22 @@ Global
1315
Release|x86 = Release|x86
1416
EndGlobalSection
1517
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Debug|x64.ActiveCfg = Debug|x64
17-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Debug|x64.Build.0 = Debug|x64
18-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Debug|x86.ActiveCfg = Debug|Win32
19-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Debug|x86.Build.0 = Debug|Win32
20-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Release|x64.ActiveCfg = Release|x64
21-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Release|x64.Build.0 = Release|x64
22-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Release|x86.ActiveCfg = Release|Win32
23-
{32A904A3-B902-4D21-B150-98D77B3E0916}.Release|x86.Build.0 = Release|Win32
18+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Debug|x64.ActiveCfg = Debug|x64
19+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Debug|x64.Build.0 = Debug|x64
20+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Debug|x86.ActiveCfg = Debug|Win32
21+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Debug|x86.Build.0 = Debug|Win32
22+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Release|x64.ActiveCfg = Release|x64
23+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Release|x64.Build.0 = Release|x64
24+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Release|x86.ActiveCfg = Release|Win32
25+
{1A597D15-7EF3-47F2-B89D-D180CBAA0F32}.Release|x86.Build.0 = Release|Win32
26+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Debug|x64.ActiveCfg = Debug|x64
27+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Debug|x64.Build.0 = Debug|x64
28+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Debug|x86.ActiveCfg = Debug|Win32
29+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Debug|x86.Build.0 = Debug|Win32
30+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Release|x64.ActiveCfg = Release|x64
31+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Release|x64.Build.0 = Release|x64
32+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Release|x86.ActiveCfg = Release|Win32
33+
{EF52920E-B52D-48E9-9348-88E89429E26D}.Release|x86.Build.0 = Release|Win32
2434
EndGlobalSection
2535
GlobalSection(SolutionProperties) = preSolution
2636
HideSolutionNode = FALSE

Samples/PackageWithExternalLocation/cppwinrt/PackageWithExternalLocationCppApp/WinMain.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -176,30 +176,6 @@ HRESULT RegisterPackageWithExternalLocation(const std::wstring& externalLocation
176176

177177
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow)
178178
{
179-
180-
//TODO - update the value of externalLocation to match the output location of your VS Build binaries and the value of
181-
//packagePath to match the path to your signed Sparse Package (.msix).
182-
//Note that these values cannot be relative paths and must be complete paths
183-
std::wstring externalLocation = L"";
184-
std::wstring packagePath = L"";
185-
186-
//Attempt registration
187-
if (!externalLocation.empty() && !packagePath.empty())
188-
{
189-
auto result = RegisterPackageWithExternalLocation(externalLocation, packagePath);
190-
if (result != HRESULT_FROM_WIN32(ERROR_PACKAGES_IN_USE) && FAILED(result))
191-
{
192-
if (result == HRESULT_FROM_WIN32(CERT_E_UNTRUSTEDROOT))
193-
{
194-
MessageBox(nullptr, L"Please install your certificate to Trusted Root Certification Authorities for Local Machine. Running without identity", L"result", MB_ICONINFORMATION);
195-
}
196-
else
197-
{
198-
MessageBox(nullptr, L"Failed to register app with identity. Running without identity", L"result", MB_ICONINFORMATION);
199-
}
200-
}
201-
}
202-
203179
MFStartup(MF_VERSION);
204180

205181
// Register window class

Samples/PackageWithExternalLocation/cppwinrt/PackageWithExternalLocationCppApp/pch.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#undef GetCurrentTime
66
#endif
77

8-
// Ensure the C++/WinRT headers are included correctly
98
#include <winrt/base.h>
109
#include <winrt/Windows.Foundation.h>
1110
#include <winrt/Windows.Foundation.Collections.h>
@@ -16,7 +15,6 @@
1615
#include <winrt/Windows.UI.Xaml.Media.h>
1716
#include <Windows.UI.Xaml.Hosting.DesktopWindowXamlSource.h>
1817

19-
#include <windows.h>
2018
#include <mfapi.h>
2119
#include <mfidl.h>
2220
#include <mfreadwrite.h>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props')" />
4+
<PropertyGroup Label="Globals">
5+
<CppWinRTOptimized>true</CppWinRTOptimized>
6+
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
7+
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
8+
<MinimalCoreWin>true</MinimalCoreWin>
9+
<VCProjectVersion>15.0</VCProjectVersion>
10+
<ProjectGuid>{ef52920e-b52d-48e9-9348-88e89429e26d}</ProjectGuid>
11+
<Keyword>Win32Proj</Keyword>
12+
<RootNamespace>PackageWithExternalLocationCppAppSetup</RootNamespace>
13+
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0</WindowsTargetPlatformVersion>
14+
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
15+
</PropertyGroup>
16+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
17+
<ItemGroup Label="ProjectConfigurations">
18+
<ProjectConfiguration Include="Debug|Win32">
19+
<Configuration>Debug</Configuration>
20+
<Platform>Win32</Platform>
21+
</ProjectConfiguration>
22+
<ProjectConfiguration Include="Release|Win32">
23+
<Configuration>Release</Configuration>
24+
<Platform>Win32</Platform>
25+
</ProjectConfiguration>
26+
<ProjectConfiguration Include="Debug|x64">
27+
<Configuration>Debug</Configuration>
28+
<Platform>x64</Platform>
29+
</ProjectConfiguration>
30+
<ProjectConfiguration Include="Release|x64">
31+
<Configuration>Release</Configuration>
32+
<Platform>x64</Platform>
33+
</ProjectConfiguration>
34+
</ItemGroup>
35+
<PropertyGroup Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<PlatformToolset>v143</PlatformToolset>
38+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
39+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
40+
<PlatformToolset Condition="'$(VisualStudioVersion)' == '14.0'">v140</PlatformToolset>
41+
<CharacterSet>Unicode</CharacterSet>
42+
</PropertyGroup>
43+
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<LinkIncremental>true</LinkIncremental>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
48+
<UseDebugLibraries>false</UseDebugLibraries>
49+
<WholeProgramOptimization>true</WholeProgramOptimization>
50+
<LinkIncremental>false</LinkIncremental>
51+
</PropertyGroup>
52+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
53+
<ImportGroup Label="ExtensionSettings">
54+
</ImportGroup>
55+
<ImportGroup Label="Shared">
56+
</ImportGroup>
57+
<ImportGroup Label="PropertySheets">
58+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets">
61+
<Import Project="PropertySheet.props" />
62+
</ImportGroup>
63+
<PropertyGroup Label="UserMacros" />
64+
<ItemDefinitionGroup>
65+
<ClCompile>
66+
<PrecompiledHeader>Use</PrecompiledHeader>
67+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
68+
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
69+
<PreprocessorDefinitions>_CONSOLE;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
70+
<WarningLevel>Level4</WarningLevel>
71+
<AdditionalOptions>%(AdditionalOptions) /permissive- /bigobj</AdditionalOptions>
72+
</ClCompile>
73+
</ItemDefinitionGroup>
74+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
75+
<ClCompile>
76+
<Optimization>Disabled</Optimization>
77+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78+
</ClCompile>
79+
<Link>
80+
<SubSystem>Console</SubSystem>
81+
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
82+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(CoreLibraryDependencies);shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
83+
</Link>
84+
</ItemDefinitionGroup>
85+
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
86+
<ClCompile>
87+
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
88+
</ClCompile>
89+
<Link>
90+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(CoreLibraryDependencies);shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
91+
</Link>
92+
</ItemDefinitionGroup>
93+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
94+
<ClCompile>
95+
<Optimization>MaxSpeed</Optimization>
96+
<FunctionLevelLinking>true</FunctionLevelLinking>
97+
<IntrinsicFunctions>true</IntrinsicFunctions>
98+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
99+
</ClCompile>
100+
<Link>
101+
<SubSystem>Console</SubSystem>
102+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
103+
<OptimizeReferences>true</OptimizeReferences>
104+
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
105+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(CoreLibraryDependencies);shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
106+
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(CoreLibraryDependencies);shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
107+
</Link>
108+
</ItemDefinitionGroup>
109+
<ItemGroup>
110+
<ClInclude Include="pch.h" />
111+
</ItemGroup>
112+
<ItemGroup>
113+
<ClCompile Include="main.cpp" />
114+
<ClCompile Include="pch.cpp">
115+
<PrecompiledHeader>Create</PrecompiledHeader>
116+
</ClCompile>
117+
</ItemGroup>
118+
<ItemGroup>
119+
<None Include="packages.config" />
120+
<None Include="PropertySheet.props" />
121+
<Text Include="readme.txt">
122+
<DeploymentContent>false</DeploymentContent>
123+
</Text>
124+
</ItemGroup>
125+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
126+
<ImportGroup Label="ExtensionTargets">
127+
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets')" />
128+
</ImportGroup>
129+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
130+
<PropertyGroup>
131+
<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>
132+
</PropertyGroup>
133+
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.props'))" />
134+
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.220531.1\build\native\Microsoft.Windows.CppWinRT.targets'))" />
135+
</Target>
136+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="Resource Files">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClInclude Include="pch.h">
19+
<Filter>Header Files</Filter>
20+
</ClInclude>
21+
</ItemGroup>
22+
<ItemGroup>
23+
<ClCompile Include="pch.cpp">
24+
<Filter>Source Files</Filter>
25+
</ClCompile>
26+
<ClCompile Include="main.cpp">
27+
<Filter>Source Files</Filter>
28+
</ClCompile>
29+
</ItemGroup>
30+
<ItemGroup>
31+
<None Include="PropertySheet.props" />
32+
<None Include="packages.config" />
33+
</ItemGroup>
34+
<ItemGroup>
35+
<Text Include="readme.txt" />
36+
</ItemGroup>
37+
</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: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#include "pch.h"
2+
#include <iostream>
3+
#include <string>
4+
#include <winrt/Windows.Management.Deployment.h>
5+
#include <winrt/Windows.ApplicationModel.Activation.h>
6+
#include <shellapi.h>
7+
8+
using namespace winrt;
9+
using namespace winrt::Windows::Management::Deployment;
10+
11+
void InstallPackage(const std::wstring& packagePath, const std::wstring& externalLocation)
12+
{
13+
try
14+
{
15+
if (externalLocation.empty() || packagePath.empty())
16+
{
17+
MessageBox(nullptr, L"Failed to register app with identity. Please provide the correct absolute path to your package and external location", L"", MB_ICONINFORMATION);
18+
return;
19+
}
20+
21+
winrt::Windows::Management::Deployment::PackageManager packageManager;
22+
winrt::Windows::Management::Deployment::AddPackageOptions addOptions;
23+
addOptions.ExternalLocationUri(winrt::Windows::Foundation::Uri(winrt::hstring(externalLocation)));
24+
25+
auto deploymentResult = packageManager.AddPackageByUriAsync(winrt::Windows::Foundation::Uri(winrt::hstring(packagePath)), addOptions).get();
26+
auto extendedErrorCode = deploymentResult.ExtendedErrorCode();
27+
28+
if (extendedErrorCode != HRESULT_FROM_WIN32(ERROR_PACKAGES_IN_USE) && FAILED(extendedErrorCode))
29+
{
30+
wchar_t buff[10];
31+
_itow_s(extendedErrorCode, buff, 16);
32+
if (extendedErrorCode == HRESULT_FROM_WIN32(CERT_E_UNTRUSTEDROOT))
33+
{
34+
MessageBox(nullptr, L"Please install your certificate to Trusted People for Local Machine. Running without identity", buff, MB_ICONINFORMATION);
35+
}
36+
else
37+
{
38+
MessageBox(nullptr, L"Failed to register app with identity. Running without identity", buff, MB_ICONINFORMATION);
39+
}
40+
}
41+
}
42+
catch (const std::exception& ex)
43+
{
44+
MessageBoxA(nullptr, "Error during installation: ", ex.what(), MB_ICONERROR);
45+
}
46+
}
47+
48+
void LaunchApplication(const std::wstring& exePath)
49+
{
50+
HINSTANCE result = ShellExecute(nullptr, L"open", exePath.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
51+
if ((int)result <= 32)
52+
{
53+
wchar_t buff[10];
54+
_itow_s((int)result, buff, 16);
55+
MessageBox(nullptr, L"Failed to launch application", buff, MB_ICONERROR);
56+
}
57+
}
58+
59+
void UninstallPackage(const std::wstring& packageFullName)
60+
{
61+
winrt::Windows::Management::Deployment::PackageManager packageManager;
62+
auto deploymentOperation = packageManager.RemovePackageAsync(packageFullName).get();
63+
}
64+
65+
int main()
66+
{
67+
//TODO - update the value of externalLocation to match the output location of your VS Build binaries even if you want to run without identity.
68+
//To run with identity, update the value of packagePath to match the path to your signed identity package (.msix).
69+
//Note that these values cannot be relative paths and must be complete paths
70+
std::wstring packagePath = L"";
71+
std::wstring externalLocation = L"";
72+
std::wstring packageFullName = L"PackageWithExternalLocationCppSample_1.0.0.0_neutral__h91ms92gdsmmt";
73+
74+
UninstallPackage(packageFullName); // if the package was not clearly uninstalled, this will remove it
75+
InstallPackage(packagePath, externalLocation);
76+
77+
// To launch the application make sure you are passing the correct absolute path to your executable
78+
if (externalLocation.empty())
79+
{
80+
MessageBox(nullptr, L"To launch the application make sure you are passing the correct absolute path to your executable", L"", MB_ICONERROR);
81+
return -1;
82+
}
83+
LaunchApplication(externalLocation + L"\\PackageWithExternalLocationCppApp.exe");
84+
UninstallPackage(packageFullName);
85+
86+
return 0;
87+
}
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+
<packages>
3+
<package id="Microsoft.Windows.CppWinRT" version="2.0.220531.1" targetFramework="native" />
4+
</packages>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "pch.h"

0 commit comments

Comments
 (0)