mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
[OOBE] Out of box experience window (#9973)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user