Skip to content

Commit bc97af7

Browse files
authored
Profile auto-elevation, version 3 (#12137)
## Summary of the Pull Request This is the resurrection of #8514 and #11310. WE determined that we didn't want to do #11308 after all, so this should be profile auto-elevation, without the warning. This PR adds two features: * the `elevate: bool` property to profiles - If the user is running unelevated, **and** `elevate` is set to `true`, then instead of opening a new tab, we'll open an elevated Terminal window with the profile. - Otherwise, we'll just open a new tab in the existing window. This includes cases where the window is elevated, and the profile is set to `elevate:false`. `elevate:false` basically just means "do nothing special with me". * the `elevate: bool?` property to `NewTerminalArgs` (`newTab`, `splitPane`) - This allows a user to create an action that will elevate the profile, even if the profile is not otherwise set to auto-elevate. - `elevate:null` (_the default_) does not change the profile's elevation status. The action will use whatever is set by the profile. - `elevate:true` will attempt to auto-elevate the profile - `elevate:false` will do nothing special. ## References * #5000 for obvious reasons * Spec'd in #8455 ## PR Checklist * [x] Closes #632 * [x] I work here * [x] Tests added/passed * [ ] Requires documentation to be updated - sure does, but that'll come all at the end. ## Detailed Description of the Pull Request / Additional comments After playing with de-elevation a bit, it turns out it behaves weirdly with packaged applications. I can try and ask `explorer.exe` to launch the process on our behalf. However, if the thing we're launching is an execution alias (`wt.exe`), and we're elevated, then the child process will _still launch elevated_. There's also something super BODGEY at work here. `ShellExecute` is the function we use to ask the OS to elevate something for us. But `ShellExecute` needs to be able to send a window message to the process that called it (if the caller was a WINDOWS subsystem application). So if we die immediately after calling `ShellExecute`, then the elevated process never actually spawns - sad. So we're adding a helper process, `elevate-shim.exe`, that lives in our process. That'll be the one that actually calls `ShellExecute`, so that it can live for the duration of the UAC prompt. ## Validation Steps Performed * Ran tests * Opened a bunch of terminal tabs at various different elevation levels * opened new splits too * In the defaults (base layer) as well, for madness Some settings to use for testing <details> ```jsonc "keybindings" : [ ////////// ELEVATION /////////////// { "keys": "f1", "name": "ELEVATED TAB", "icon": "\uEA18", "command": { "action": "newTab", "elevate": true } }, { "keys": "f2", "name": "ELEVATED, Color", "icon": "\uEA18", "command": { "action": "newTab", "elevate": true, "commandline": "PowerShell.exe", "startingDirectory": "C:\\Windows", "tabColor": "#bbaa00" } }, { "keys": "f3", "name": "unelevated ELEVATED", "icon": "🙃", "command": { "action": "newTab", "elevate": false, "profile": "elevated cmd" } }, ////////////////////////////// ], "profiles": { "defaults": { "elevate": true, }, "list": [ { "hidden":false, "name" : "cmd", "commandline" : "cmd.exe", "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "startingDirectory" : "%USERPROFILE%", "opacity" : 20 }, { "name" : "the COOLER cmd", "commandline" : "c:\\windows\\system32\\cmd.exe", "startingDirectory" : "%USERPROFILE%", }, { "name" : "the sneaky cmd", "commandline" : "c:\\windows\\system32\\cmd.exe /k echo sneaky sneaks", "startingDirectory" : "%USERPROFILE%", }, { "name": "elevated cmd", "commandline": "cmd.exe /k echo This profile is always elevated", "startingDirectory" : "well this is garbage", "elevate": true, "background": "#9C1C0C", "tabColor": "#9C1C0C", "colorScheme": "Desert" }, { "name": "unelevated cmd", "commandline": "cmd.exe /k echo This profile is just as elevated as you started with", "elevate": false, "background": "#1C0C9C", "tabColor": "#1C0C9C", "colorScheme": "DotGov", "useAcrylic": true }, ] ``` </details> Also try: * `wtd nt -p "elevated cmd" ; sp -p "elevated cmd"` * `wtd nt -p "elevated cmd" ; nt -p "elevated cmd"` This was merged manually via ``` git diff dev/migrie/f/non-terminal-content-elevation-warning dev/migrie/f/632-on-warning-dialog > ..\632.patch git apply ..\632.patch --ignore-whitespace --reject ```
1 parent 4455bdb commit bc97af7

File tree

18 files changed

+689
-19
lines changed

18 files changed

+689
-19
lines changed

OpenConsole.sln

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfTerminalTestNetCore", "s
334334
EndProject
335335
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wt", "src\cascadia\wt\wt.vcxproj", "{506FD703-BAA7-4F6E-9361-64F550EC8FCA}"
336336
EndProject
337+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "elevate-shim", "src\cascadia\ElevateShim\elevate-shim.vcxproj", "{416FD703-BAA7-4F6E-9361-64F550EC8FCA}"
338+
EndProject
337339
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.Settings.Editor", "src\cascadia\TerminalSettingsEditor\Microsoft.Terminal.Settings.Editor.vcxproj", "{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}"
338340
ProjectSection(ProjectDependencies) = postProject
339341
{CA5CAD1A-082C-4476-9F33-94B339494076} = {CA5CAD1A-082C-4476-9F33-94B339494076}
@@ -398,6 +400,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsTerminal.UIA.Tests",
398400
EndProject
399401
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "api-ms-win-core-synch-l1-2-0", "src\api-ms-win-core-synch-l1-2-0\api-ms-win-core-synch-l1-2-0.vcxproj", "{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5}"
400402
EndProject
403+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{61901E80-E97D-4D61-A9BB-E8F2FDA8B40C}"
404+
EndProject
401405
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RendererAtlas", "src\renderer\atlas\atlas.vcxproj", "{8222900C-8B6C-452A-91AC-BE95DB04B95F}"
402406
EndProject
403407
Global
@@ -2759,6 +2763,43 @@ Global
27592763
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x64.Build.0 = Release|x64
27602764
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.ActiveCfg = Release|Win32
27612765
{506FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.Build.0 = Release|Win32
2766+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|Any CPU.ActiveCfg = AuditMode|Win32
2767+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|ARM.ActiveCfg = AuditMode|Win32
2768+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|ARM64.ActiveCfg = AuditMode|ARM64
2769+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|ARM64.Build.0 = AuditMode|ARM64
2770+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|DotNet_x64Test.ActiveCfg = AuditMode|Win32
2771+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|DotNet_x86Test.ActiveCfg = AuditMode|Win32
2772+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|x64.ActiveCfg = AuditMode|x64
2773+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|x64.Build.0 = AuditMode|x64
2774+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|x86.ActiveCfg = AuditMode|Win32
2775+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.AuditMode|x86.Build.0 = AuditMode|Win32
2776+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|Any CPU.ActiveCfg = Debug|Win32
2777+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|ARM.ActiveCfg = Debug|Win32
2778+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|ARM64.ActiveCfg = Debug|ARM64
2779+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|ARM64.Build.0 = Debug|ARM64
2780+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|DotNet_x64Test.ActiveCfg = Debug|Win32
2781+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|DotNet_x86Test.ActiveCfg = Debug|Win32
2782+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|x64.ActiveCfg = Debug|x64
2783+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|x64.Build.0 = Debug|x64
2784+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|x86.ActiveCfg = Debug|Win32
2785+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Debug|x86.Build.0 = Debug|Win32
2786+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Fuzzing|Any CPU.ActiveCfg = Fuzzing|Win32
2787+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Fuzzing|ARM.ActiveCfg = Fuzzing|Win32
2788+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Fuzzing|ARM64.ActiveCfg = Fuzzing|ARM64
2789+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Fuzzing|DotNet_x64Test.ActiveCfg = Fuzzing|Win32
2790+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Fuzzing|DotNet_x86Test.ActiveCfg = Fuzzing|Win32
2791+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Fuzzing|x64.ActiveCfg = Fuzzing|x64
2792+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Fuzzing|x86.ActiveCfg = Fuzzing|Win32
2793+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|Any CPU.ActiveCfg = Release|Win32
2794+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|ARM.ActiveCfg = Release|Win32
2795+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|ARM64.ActiveCfg = Release|ARM64
2796+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|ARM64.Build.0 = Release|ARM64
2797+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|DotNet_x64Test.ActiveCfg = Release|Win32
2798+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|DotNet_x86Test.ActiveCfg = Release|Win32
2799+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x64.ActiveCfg = Release|x64
2800+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x64.Build.0 = Release|x64
2801+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.ActiveCfg = Release|Win32
2802+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA}.Release|x86.Build.0 = Release|Win32
27622803
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.ActiveCfg = Release|x64
27632804
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.Build.0 = Release|x64
27642805
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32}.AuditMode|Any CPU.Deploy.0 = Release|x64
@@ -3399,7 +3440,7 @@ Global
33993440
{CA5CAD1A-9A12-429C-B551-8562EC954746} = {59840756-302F-44DF-AA47-441A9D673202}
34003441
{CA5CAD1A-B11C-4DDB-A4FE-C3AFAE9B5506} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
34013442
{48D21369-3D7B-4431-9967-24E81292CF63} = {05500DEF-2294-41E3-AF9A-24E580B82836}
3402-
{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE} = {59840756-302F-44DF-AA47-441A9D673202}
3443+
{CA5CAD1A-039A-4929-BA2A-8BEB2E4106FE} = {61901E80-E97D-4D61-A9BB-E8F2FDA8B40C}
34033444
{58A03BB2-DF5A-4B66-91A0-7EF3BA01269A} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
34043445
{A22EC5F6-7851-4B88-AC52-47249D437A52} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
34053446
{A021EDFF-45C8-4DC2-BEF7-36E1B3B8CFE8} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
@@ -3411,10 +3452,11 @@ Global
34113452
{D3EF7B96-CD5E-47C9-B9A9-136259563033} = {04170EEF-983A-4195-BFEF-2321E5E38A1E}
34123453
{95B136F9-B238-490C-A7C5-5843C1FECAC4} = {05500DEF-2294-41E3-AF9A-24E580B82836}
34133454
{024052DE-83FB-4653-AEA4-90790D29D5BD} = {E8F24881-5E37-4362-B191-A3BA0ED7F4EB}
3414-
{067F0A06-FCB7-472C-96E9-B03B54E8E18D} = {59840756-302F-44DF-AA47-441A9D673202}
3455+
{067F0A06-FCB7-472C-96E9-B03B54E8E18D} = {61901E80-E97D-4D61-A9BB-E8F2FDA8B40C}
34153456
{6BAE5851-50D5-4934-8D5E-30361A8A40F3} = {81C352DB-1818-45B7-A284-18E259F1CC87}
34163457
{1588FD7C-241E-4E7D-9113-43735F3E6BAD} = {4DAF0299-495E-4CD1-A982-9BAC16A45932}
3417-
{506FD703-BAA7-4F6E-9361-64F550EC8FCA} = {59840756-302F-44DF-AA47-441A9D673202}
3458+
{506FD703-BAA7-4F6E-9361-64F550EC8FCA} = {61901E80-E97D-4D61-A9BB-E8F2FDA8B40C}
3459+
{416FD703-BAA7-4F6E-9361-64F550EC8FCA} = {61901E80-E97D-4D61-A9BB-E8F2FDA8B40C}
34183460
{CA5CAD1A-0B5E-45C3-96A8-BB496BFE4E32} = {77875138-BB08-49F9-8BB1-409C2150E0E1}
34193461
{CA5CAD1A-D7EC-4107-B7C6-79CB77AE2907} = {77875138-BB08-49F9-8BB1-409C2150E0E1}
34203462
{CA5CAD1A-082C-4476-9F33-94B339494076} = {77875138-BB08-49F9-8BB1-409C2150E0E1}
@@ -3433,6 +3475,7 @@ Global
34333475
{C323DAEE-B307-4C7B-ACE5-7293CBEFCB5B} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
34343476
{F19DACD5-0C6E-40DC-B6E4-767A3200542C} = {BDB237B6-1D1D-400F-84CC-40A58FA59C8E}
34353477
{9CF74355-F018-4C19-81AD-9DC6B7F2C6F5} = {89CDCC5C-9F53-4054-97A4-639D99F169CD}
3478+
{61901E80-E97D-4D61-A9BB-E8F2FDA8B40C} = {59840756-302F-44DF-AA47-441A9D673202}
34363479
{8222900C-8B6C-452A-91AC-BE95DB04B95F} = {05500DEF-2294-41E3-AF9A-24E580B82836}
34373480
EndGlobalSection
34383481
GlobalSection(ExtensibilityGlobals) = postSolution

doc/cascadia/profiles.schema.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,12 @@
469469
"colorScheme": {
470470
"description": "The name of a color scheme to use, instead of the one specified by the profile",
471471
"type": "string"
472-
}
472+
},
473+
"elevate": {
474+
"type": "boolean",
475+
"default": false,
476+
"description": "This will override the profile's `elevate` setting."
477+
},
473478
},
474479
"type": "object"
475480
},
@@ -1951,6 +1956,11 @@
19511956
],
19521957
"type": "string"
19531958
},
1959+
"elevate": {
1960+
"type": "boolean",
1961+
"default": false,
1962+
"description": "When true, this profile should always open in an elevated context. If the window isn't running as an Administrator, then a new elevated window will be created."
1963+
},
19541964
"experimental.retroTerminalEffect": {
19551965
"description": "When set to true, enable retro terminal effects. This is an experimental feature, and its continued existence is not guaranteed.",
19561966
"type": "boolean"

src/cascadia/CascadiaPackage/CascadiaPackage.wapproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
<ProjectReference Include="$(OpenConsoleDir)src\host\exe\Host.EXE.vcxproj">
7979
<Project>{9CBD7DFA-1754-4A9D-93D7-857A9D17CB1B}</Project>
8080
</ProjectReference>
81+
<ProjectReference Include="$(OpenConsoleDir)src\cascadia\ElevateShim\elevate-shim.vcxproj" >
82+
<Project>{416fd703-baa7-4f6e-9361-64f550ec8fca}</Project>
83+
</ProjectReference>
8184
<ProjectReference Include="$(OpenConsoleDir)src\host\proxy\Host.Proxy.vcxproj">
8285
<Project>{71CC9D78-BA29-4D93-946F-BEF5D9A3A6EF}</Project>
8386
</ProjectReference>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
#include <string>
5+
#include <filesystem>
6+
7+
#define WIN32_LEAN_AND_MEAN
8+
#include <windows.h>
9+
#include <wil/stl.h>
10+
#include <wil/resource.h>
11+
#include <wil/win32_helpers.h>
12+
#include <shellapi.h>
13+
14+
// BODGY
15+
//
16+
// If we try to do this in the Terminal itself, then there's a bunch of weird
17+
// things that can go wrong and prevent the elevated Terminal window from
18+
// getting created. Specifically, if the origin Terminal exits right away after
19+
// spawning the elevated WT, then ShellExecute might not successfully complete
20+
// the elevation. What's even more, the Terminal will mysteriously crash
21+
// somewhere in XAML land.
22+
//
23+
// To mitigate this, the Terminal will call into us with the commandline it
24+
// wants elevated. We'll hang around until ShellExecute is finished, so that the
25+
// process can successfully elevate.
26+
27+
#pragma warning(suppress : 26461) // we can't change the signature of wWinMain
28+
int __stdcall wWinMain(HINSTANCE, HINSTANCE, LPWSTR pCmdLine, int)
29+
{
30+
// All of the args passed to us (something like `new-tab -p {guid}`) are in
31+
// pCmdLine
32+
33+
// Get the path to WindowsTerminal.exe, which should live next to us.
34+
std::filesystem::path module{ wil::GetModuleFileNameW<std::wstring>(nullptr) };
35+
// Swap elevate-shim.exe for WindowsTerminal.exe
36+
module.replace_filename(L"WindowsTerminal.exe");
37+
38+
// Go!
39+
40+
// disable warnings from SHELLEXECUTEINFOW struct. We can't fix that.
41+
#pragma warning(push)
42+
#pragma warning(disable : 26476) // Macro uses naked union over variant.
43+
SHELLEXECUTEINFOW seInfo{ 0 };
44+
#pragma warning(pop)
45+
46+
seInfo.cbSize = sizeof(seInfo);
47+
seInfo.fMask = SEE_MASK_DEFAULT;
48+
seInfo.lpVerb = L"runas"; // This asks the shell to elevate the process
49+
seInfo.lpFile = module.c_str(); // This is `...\WindowsTerminal.exe`
50+
seInfo.lpParameters = pCmdLine; // This is `new-tab -p {guid}`
51+
seInfo.nShow = SW_SHOWNORMAL;
52+
LOG_IF_WIN32_BOOL_FALSE(ShellExecuteExW(&seInfo));
53+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Microsoft Visual C++ generated resource script.
2+
//
3+
#include "resource.h"
4+
5+
#define APSTUDIO_READONLY_SYMBOLS
6+
/////////////////////////////////////////////////////////////////////////////
7+
//
8+
// Generated from the TEXTINCLUDE 2 resource.
9+
//
10+
#include "winres.h"
11+
/////////////////////////////////////////////////////////////////////////////
12+
#undef APSTUDIO_READONLY_SYMBOLS
13+
14+
/////////////////////////////////////////////////////////////////////////////
15+
// English (United States) resources
16+
17+
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
18+
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
19+
#pragma code_page(1252)
20+
21+
#ifdef APSTUDIO_INVOKED
22+
/////////////////////////////////////////////////////////////////////////////
23+
//
24+
// TEXTINCLUDE
25+
//
26+
27+
1 TEXTINCLUDE
28+
BEGIN
29+
"resource.h\0"
30+
END
31+
32+
2 TEXTINCLUDE
33+
BEGIN
34+
"#include ""winres.h""\0"
35+
END
36+
37+
3 TEXTINCLUDE
38+
BEGIN
39+
"\r\n"
40+
"\0"
41+
END
42+
43+
#endif // APSTUDIO_INVOKED
44+
45+
46+
/////////////////////////////////////////////////////////////////////////////
47+
//
48+
// Icon
49+
//
50+
51+
// Icon with lowest ID value placed first to ensure application icon
52+
// remains consistent on all systems.
53+
IDI_APPICON ICON "..\\..\\..\\res\\terminal.ico"
54+
55+
#endif // English (United States) resources
56+
/////////////////////////////////////////////////////////////////////////////
57+
58+
59+
60+
#ifndef APSTUDIO_INVOKED
61+
/////////////////////////////////////////////////////////////////////////////
62+
//
63+
// Generated from the TEXTINCLUDE 3 resource.
64+
//
65+
66+
67+
/////////////////////////////////////////////////////////////////////////////
68+
#endif // not APSTUDIO_INVOKED
69+
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+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>{416fd703-baa7-4f6e-9361-64f550ec8fca}</ProjectGuid>
5+
<Keyword>Win32Proj</Keyword>
6+
<RootNamespace>elevate-shim</RootNamespace>
7+
<ProjectName>elevate-shim</ProjectName>
8+
<TargetName>elevate-shim</TargetName>
9+
<ConfigurationType>Application</ConfigurationType>
10+
</PropertyGroup>
11+
12+
<Import Project="..\..\..\common.openconsole.props" Condition="'$(OpenConsoleDir)'==''" />
13+
<Import Project="$(OpenConsoleDir)src\common.build.pre.props" />
14+
15+
<!-- Source Files -->
16+
<ItemGroup>
17+
<ClCompile Include="elevate-shim.cpp">
18+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
19+
</ClCompile>
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<ResourceCompile Include="elevate-shim.rc" />
24+
</ItemGroup>
25+
26+
<Import Project="$(OpenConsoleDir)src\common.build.post.props" />
27+
28+
<ItemDefinitionGroup>
29+
<Link>
30+
<!-- Remove all non-onecore dependencies -->
31+
<AdditionalDependencies>onecore.lib</AdditionalDependencies>
32+
</Link>
33+
</ItemDefinitionGroup>
34+
</Project>

src/cascadia/ElevateShim/resource.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//{{NO_DEPENDENCIES}}
2+
// Microsoft Visual C++ generated include file.
3+
// Used by wt.rc
4+
//
5+
#define IDI_APPICON 101
6+
7+
// Next default values for new objects
8+
//
9+
#ifdef APSTUDIO_INVOKED
10+
#ifndef APSTUDIO_READONLY_SYMBOLS
11+
#define _APS_NEXT_RESOURCE_VALUE 102
12+
#define _APS_NEXT_COMMAND_VALUE 40001
13+
#define _APS_NEXT_CONTROL_VALUE 1001
14+
#define _APS_NEXT_SYMED_VALUE 101
15+
#endif
16+
#endif

0 commit comments

Comments
 (0)