[OOBE] Out of box experience window (#9973)

This commit is contained in:
Seraphima Zykova
2021-03-02 20:56:37 +03:00
committed by GitHub
parent a12350274b
commit 078aa3d89b
81 changed files with 2460 additions and 78 deletions

View File

@@ -19,10 +19,12 @@ namespace PowerToys.Settings
Theme, // used in the old settings
ElevatedStatus,
IsUserAdmin,
ShowOobeWindow,
}
// Quantity of arguments
private const int ArgumentsQty = 6;
private const int RequiredArgumentsQty = 6;
private const int RequiredAndOptionalArgumentsQty = 7;
// Create an instance of the IPC wrapper.
private static TwoWayPipeMessageIPCManaged ipcmanager;
@@ -43,7 +45,7 @@ namespace PowerToys.Settings
App app = new App();
app.InitializeComponent();
if (args != null && args.Length >= ArgumentsQty)
if (args != null && args.Length >= RequiredArgumentsQty)
{
_ = int.TryParse(args[(int)Arguments.PTPid], out int powerToysPID);
PowerToysPID = powerToysPID;
@@ -51,6 +53,12 @@ namespace PowerToys.Settings
IsElevated = args[(int)Arguments.ElevatedStatus] == "true";
IsUserAnAdmin = args[(int)Arguments.IsUserAdmin] == "true";
if (args.Length == RequiredAndOptionalArgumentsQty)
{
// open oobe window
app.ShowOobe = args[(int)Arguments.ShowOobeWindow] == "true";
}
RunnerHelper.WaitForPowerToysRunner(PowerToysPID, () =>
{
Environment.Exit(0);