Skip to content

Commit a64e5c2

Browse files
angelazhangmsftSantosh Chintalapati
andauthored
Add C++ DeploymentManager sample and add ForceDeploy option (#186)
* use sample templates and add force deploy * add comment on force option * update prereqs * add C++ DeploymentManager sample * fix overload * Update README.md * update to 1.1 preview 2 * update packages.config * Update to refer to 1.1.4 with required latest fixes for the sample to work. * Updating C# project as well to 1.1.4 * Fix bad merge from main * Fix Unreferenced object error Co-authored-by: Santosh Chintalapati <[email protected]>
1 parent 4509434 commit a64e5c2

File tree

80 files changed

+2335
-333
lines changed

Some content is hidden

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

80 files changed

+2335
-333
lines changed

Samples/DeploymentManager/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
page_type: sample
33
languages:
44
- csharp
5+
- cpp
56
products:
67
- windows
78
- windows-app-sdk
@@ -20,7 +21,7 @@ This sample demonstrates how to use the DeploymentManager class to ensure the Wi
2021

2122
* See [System requirements for Windows app development](https://docs.microsoft.com/windows/apps/windows-app-sdk/system-requirements).
2223
* Make sure that your development environment is set up correctly&mdash;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).
23-
* The C# sample requires either .NET SDK 5.0.205 or later, or .NET SDK 5.0.400 or later.
24+
* The C# sample requires Visual Studio 2022 and .NET 6.
2425

2526
## Building and running the sample
2627

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Copyright (c) Microsoft Corporation.
2+
Licensed under the MIT License. -->
3+
<Application
4+
x:Class="DeploymentManagerSample.App"
5+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
6+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
7+
xmlns:local="using:DeploymentManagerSample">
8+
9+
<Application.Resources>
10+
<!-- Application-specific resources -->
11+
<ResourceDictionary>
12+
<ResourceDictionary.MergedDictionaries>
13+
<!--
14+
Styles that define common aspects of the platform look and feel
15+
Required by Visual Studio project and item templates
16+
-->
17+
<ResourceDictionary Source="ms-appx:///Styles.xaml"/>
18+
</ResourceDictionary.MergedDictionaries>
19+
</ResourceDictionary>
20+
</Application.Resources>
21+
</Application>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
#include "pch.h"
5+
6+
#include "App.xaml.h"
7+
#include "MainWindow.xaml.h"
8+
9+
namespace winrt
10+
{
11+
using namespace Windows::Foundation;
12+
using namespace Microsoft::UI::Xaml;
13+
}
14+
15+
namespace winrt::DeploymentManagerSample::implementation
16+
{
17+
App::App()
18+
{
19+
InitializeComponent();
20+
21+
#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
22+
UnhandledException([](winrt::IInspectable const&, winrt::UnhandledExceptionEventArgs const& e)
23+
{
24+
if (IsDebuggerPresent())
25+
{
26+
auto errorMessage = e.Message();
27+
__debugbreak();
28+
}
29+
});
30+
#endif
31+
}
32+
33+
void App::OnLaunched(winrt::LaunchActivatedEventArgs const&)
34+
{
35+
window = winrt::make<MainWindow>();
36+
window.Activate();
37+
}
38+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
#pragma once
5+
#include "App.xaml.g.h"
6+
#include "pch.h"
7+
8+
namespace winrt::DeploymentManagerSample::implementation
9+
{
10+
struct App : AppT<App>
11+
{
12+
App();
13+
14+
void OnLaunched(Microsoft::UI::Xaml::LaunchActivatedEventArgs const&);
15+
16+
private:
17+
Microsoft::UI::Xaml::Window window{ nullptr };
18+
};
19+
}
76.3 KB
Loading
10.6 KB
Loading
2.73 KB
Loading
10.9 KB
Loading
3.06 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)