Language

SystemSetupInfo クラス

定義

Out-of-Box Experience (OOBE) のライフサイクルの現在のステージを記述するプロパティとイベントを提供します。

public ref class SystemSetupInfo abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 458752)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SystemSetupInfo final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 458752)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class SystemSetupInfo
Public Class SystemSetupInfo
継承
Object Platform::Object IInspectable SystemSetupInfo
属性

Windows の要件

要件 説明
デバイス ファミリ
Windows 10, version 1809 (10.0.17763.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v7.0 で導入)

例

ユニバーサル Windows プラットフォーム (UWP) アプリは、OOBE 中に特別な動作 (たとえば、ユーザー インターフェイス (UI)、または OOBE が完了した後にのみ開始されるバックグラウンド タスク) で特別な動作が行われるので、OOBE が完了したかどうかを認識する必要があります。 OEM として、これは OOBE 中に実行されるアプリである可能性があります。

private bool ShouldUseSimpleUserInterface()
{
    var oobeState = Windows.System.Profile.SystemSetupInfo.OutOfBoxExperienceState;

    // When this UWP is shown before OOBE is complete, use a simplified UI
    // with limited options, which matches the style of the rest of OOBE.
    return (oobeState != SystemOutOfBoxExperienceState.Completed);
}

OEM は、工場のフロア テスト中にデバイスが OOBE に正常に起動することを知りたい場合です。 すべてのデバイスでこのテストを製造プロセスの最後の検証手順として実行する必要があるため、自動化中に OOBE が進行中で準備ができたときに通知を受け取る必要があります。

// Task that has its result set once OOBE is in progress.
private TaskCompletionSource<object> oobeInProgress;

// Called when OOBE state changes. Guaranteed to be called at least once, at
// the time of event registration.
private void OnOobeStateChanged(object sender, object e)
{
    var oobeState = Windows.System.Profile.SystemSetupInfo.OutOfBoxExperienceState;
    if (oobeState == SystemOutOfBoxExperienceState.InProgress)
    {
        oobeInProgress.TrySetResult(null);
    } 
}

private async void WaitForOobeStartedAsync()
{
    oobeInProgress = new TaskCompletionSource<object>();
    Windows.System.Profile.SystemSetupInfo.OutOfBoxExperienceStateChanged += OnOobeStateChanged;
    await oobeInProgress.Task; // NOTE: you could add a timeout here, and fail when hit.
    Windows.System.Profile.SystemSetupInfo.OutOfBoxExperienceStateChanged -= OnOobeStateChanged;
 }

注釈

Out-of-Box Experience (OOBE) は、ユーザーが初めて Windows 10 デバイスをオンにした場合に発生するフローです。 OOBE は EULA の同意を取得し、システムの既定のロケールを設定し、初期ユーザー アカウントの設定に役立ちます。

プロパティ

名前 説明
OutOfBoxExperienceState

Out-of-Box Experience (OOBE) のライフサイクルにおける現在のステージを表す値を取得します。

イベント

名前 説明
OutOfBoxExperienceStateChanged

Out-of-Box Experience (OOBE) のライフサイクルの現在のステージが変更されたときに発生します。

適用対象