terminal/src/cascadia/TerminalSettingsModel
Mike Griese c79334ffbb
Add a file for storing elevated-only state (#11222)
## Summary of the Pull Request

This creates an `elevated-state.json` that lives in `%LOCALAPPDATA%` next to `state.json`, that's only writable when elevated. It doesn't _use_ this file for anything, it just puts the framework down for use later.

It's _just like `ApplicationState`_. We'll use it the same way. 

It's readable when unelevated, which is nice, but not writable. If you're dumb and try to write to the file when unelevated, it'll just silently do nothing.

If we try opening the file and find out the permissions are different, we'll _blow the file away entirely_. This is to prevent someone from renaming the original file (which they can do unelevated), then slapping a new file that's writable by them down in it's place. 

## References
* We're going to use this in #11096, but these PRs need to be broken up.

## PR Checklist
* [x] Closes nothing
* [x] I work here
* [x] Tests added/passed
* [ ] Requires documentation to be updated - maybe? not sure we have docs on `state.json` at all yet

## Validation Steps Performed
I've played with this much more in `dev/migrie/f/non-terminal-content-elevation-warning`

###### followed by #11308, #11310
2021-11-13 01:58:43 +01:00
..
dll Update to MUX 2.7 (#11240) 2021-09-20 22:08:55 +00:00
Resources/en-US Minor typos in 1.12 features in SUI (#11362) 2021-09-29 10:24:46 +00:00
ActionAndArgs.cpp Add an openSystemMenu keybinding (#11086) 2021-09-10 18:25:43 +00:00
ActionAndArgs.h Add action to run multiple actions. (#11045) 2021-08-31 19:35:51 +00:00
ActionArgs.cpp Add the ability to interact with subtrees of panes (#11153) 2021-09-28 19:16:05 +00:00
ActionArgs.h Fix globalSummon.dropdownDuration not saving correctly (#11401) 2021-10-04 13:15:50 +00:00
ActionArgs.idl Add the ability to interact with subtrees of panes (#11153) 2021-09-28 19:16:05 +00:00
ActionMap.cpp Fix crash and empty action in SUI Actions Page (#11427) 2021-10-06 11:33:05 +00:00
ActionMap.h Make ActionMap compatible with ScanCode-only KeyChords (#10945) 2021-08-20 00:21:33 +00:00
ActionMap.idl Adding/fixing Alt+Space handling (#10799) 2021-08-10 19:53:07 +00:00
ActionMapSerialization.cpp Use WinRT VirtualKeyModifiers instead of a custom enum (#10603) 2021-07-12 21:24:26 +00:00
AllShortcutActions.h Add an openSystemMenu keybinding (#11086) 2021-09-10 18:25:43 +00:00
AppearanceConfig.cpp Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
AppearanceConfig.h Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
AppearanceConfig.idl Add support for a profile to specify an "unfocused" appearance (#8392) 2021-04-08 22:46:16 +00:00
ApplicationState.cpp Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
ApplicationState.h Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
ApplicationState.idl Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
AzureCloudShellGenerator.cpp Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
AzureCloudShellGenerator.h Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
CascadiaSettings.cpp Remove unused rendering settings from profile (#11685) 2021-11-04 14:50:59 -05:00
CascadiaSettings.h Fix loading of fragments that update multiple profiles (#11598) 2021-10-27 01:43:10 +00:00
CascadiaSettings.idl Add a information popup about default terminals (#11397) 2021-10-07 17:44:03 +00:00
CascadiaSettingsSerialization.cpp Fix loading of fragments that update multiple profiles (#11598) 2021-10-27 01:43:10 +00:00
ColorScheme.cpp Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
ColorScheme.h Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
ColorScheme.idl Persist window layout on window close (#10972) 2021-09-08 22:44:53 +00:00
Command.cpp Bugfix: serialize iterable commands (#10373) 2021-06-10 18:25:27 +00:00
Command.h Introduce serialization for actions (#9926) 2021-05-20 18:44:04 +00:00
Command.idl Introduce ActionMap to Terminal Settings Model (#9621) 2021-05-04 21:50:13 -07:00
defaults-universal.json Remove double-space in defaults.json (#11518) 2021-10-18 16:25:13 -05:00
defaults.json Trim trailing whitespace option (#11473) 2021-10-28 15:38:23 +00:00
DefaultTerminal.cpp Add logging for default terminal (#11458) 2021-10-12 15:56:17 +00:00
DefaultTerminal.h Add a information popup about default terminals (#11397) 2021-10-07 17:44:03 +00:00
DefaultTerminal.idl Fix default terminal setting dropdown (#11430) 2021-10-06 16:58:09 +00:00
DynamicProfileUtils.cpp Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
DynamicProfileUtils.h Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
EnumMappings.cpp Persist window layout on window close (#10972) 2021-09-08 22:44:53 +00:00
EnumMappings.h Persist window layout on window close (#10972) 2021-09-08 22:44:53 +00:00
EnumMappings.idl Persist window layout on window close (#10972) 2021-09-08 22:44:53 +00:00
FileUtils.cpp Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
FileUtils.h Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
FontConfig.cpp Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
FontConfig.h Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
FontConfig.idl Allow users to set font features and font axes (#10525) 2021-07-22 23:15:44 +00:00
GlobalAppSettings.cpp Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
GlobalAppSettings.h Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
GlobalAppSettings.idl Trim trailing whitespace option (#11473) 2021-10-28 15:38:23 +00:00
HashUtils.h Introduce ActionMap to Terminal Settings Model (#9621) 2021-05-04 21:50:13 -07:00
IAppearanceConfig.idl Implement the Delta E algorithm to improve color perception (#11095) 2021-10-07 22:43:17 +00:00
IconPathConverter.cpp Revert "Add the profile, page icons to the page headers (#10046)" (#10124) 2021-05-18 17:35:50 -05:00
IconPathConverter.h Move IconSourceConverter from TerminalApp to TSM 2020-12-11 13:17:22 -08:00
IconPathConverter.idl Move IconSourceConverter from TerminalApp to TSM 2020-12-11 13:17:22 -08:00
IDynamicProfileGenerator.h Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
IInheritable.h Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
IInheritable.idl.h Introduce setting override tracking and update SettingContainer (#9079) 2021-02-19 23:50:52 +00:00
init.cpp Hook up the WIL fallback error tracer in Terminal (#7864) 2020-10-09 22:20:12 +00:00
JsonUtils.h Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
KeyChordSerialization.cpp Fix: Multimedia Key Hotkey Support (#10801) 2021-07-27 17:11:51 +00:00
KeyChordSerialization.h Introduce ActionMap to Terminal Settings Model (#9621) 2021-05-04 21:50:13 -07:00
KeyChordSerialization.idl Rename Microsoft.Terminal.TerminalControl to .Control; Split into dll & lib (#9472) 2021-03-17 20:47:24 +00:00
LegacyProfileGeneratorNamespaces.h From orbit, nuke the Telnet connection and all supporting infra. (#7840) 2020-10-09 18:59:58 +00:00
Microsoft.Terminal.Settings.ModelLib.vcxproj Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
Microsoft.Terminal.Settings.ModelLib.vcxproj.filters Use X-macros to simplify new setting creation in SettingsModel (#11416) 2021-11-03 15:01:20 +00:00
MTSMSettings.h Introduce AtlasEngine - A new text rendering prototype (#11623) 2021-11-13 00:10:06 +00:00
packages.config Add profile generators for Visual Studio (#7774) 2021-09-15 17:20:06 -05:00
pch.cpp Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
pch.h Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
PowershellCoreProfileGenerator.cpp Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
PowershellCoreProfileGenerator.h Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
Profile.cpp Remove unused rendering settings from profile (#11685) 2021-11-04 14:50:59 -05:00
Profile.h Remove unused rendering settings from profile (#11685) 2021-11-04 14:50:59 -05:00
Profile.idl Introduce AtlasEngine - A new text rendering prototype (#11623) 2021-11-13 00:10:06 +00:00
SettingsTypes.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
TerminalSettings.cpp Introduce AtlasEngine - A new text rendering prototype (#11623) 2021-11-13 00:10:06 +00:00
TerminalSettings.h Introduce AtlasEngine - A new text rendering prototype (#11623) 2021-11-13 00:10:06 +00:00
TerminalSettings.idl Persist window layout on window close (#10972) 2021-09-08 22:44:53 +00:00
TerminalSettingsSerializationHelpers.h Add a information popup about default terminals (#11397) 2021-10-07 17:44:03 +00:00
TerminalWarnings.h Introduce TerminalSettingsModel project (#7667) 2020-10-06 09:56:59 -07:00
TerminalWarnings.idl Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00
userDefaults.json Make sure all the commandlines are fully qualified (#11437) 2021-10-07 12:18:11 -05:00
VisualStudioGenerator.cpp Further reduce number of generated VS profiles (#11489) 2021-10-19 23:52:00 +00:00
VisualStudioGenerator.h Show only latest VS, VC prompts by default (#11326) 2021-09-29 22:03:05 +00:00
VsDevCmdGenerator.cpp Fixed VsDevCmd command line quoting (#11554) 2021-10-20 21:57:55 +02:00
VsDevCmdGenerator.h Show only latest VS, VC prompts by default (#11326) 2021-09-29 22:03:05 +00:00
VsDevShellGenerator.cpp Further reduce number of generated VS profiles (#11489) 2021-10-19 23:52:00 +00:00
VsDevShellGenerator.h Show only latest VS, VC prompts by default (#11326) 2021-09-29 22:03:05 +00:00
VsSetupConfiguration.cpp Further reduce number of generated VS profiles (#11489) 2021-10-19 23:52:00 +00:00
VsSetupConfiguration.h Further reduce number of generated VS profiles (#11489) 2021-10-19 23:52:00 +00:00
WslDistroGenerator.cpp Implement basic profile matching (#11390) 2021-10-08 00:40:10 +00:00
WslDistroGenerator.h Reduce usage of Json::Value throughout Terminal.Settings.Model (#11184) 2021-09-22 16:27:31 +00:00