Exemplo n.º 1
0
int WINAPI
wWinMain(IN HINSTANCE hInst,
         IN HINSTANCE hPrevInstance,
         IN LPWSTR lpszCmdLine,
         IN int nCmdShow)
{
    STATE State;

    hInstance = hInst;

    SetUserSettings();

    if (IsLiveCD())
    {
        State.NextPage = LOCALEPAGE;
        State.Run = SHELL;
    }
    else
    {
        State.NextPage = DONE;
        State.Run = SHELL;
    }

    if (State.NextPage != DONE)
    {
        RunLiveCD(&State);
    }

    if (State.Run == SHELL)
    {
        StartShell();
        NotifyLogon();
    }
    else if (State.Run == INSTALLER)
    {
        StartInstaller();
    }

    return 0;
}
Exemplo n.º 2
0
int
WINAPI
_tWinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPTSTR lpCmdLine,
    int nShowCmd)
{
    LPTSTR CmdLine;
    LPTSTR p;

    CmdLine = GetCommandLine();

    DPRINT("CmdLine: <%s>\n",CmdLine);

    p = lstrchr(CmdLine, TEXT('-'));
    if (p == NULL)
        return 0;

    if (!lstrcmpi(p, TEXT("-newsetup")))
    {
        RunNewSetup(hInstance);
    }
    else if (!lstrcmpi(p, TEXT("-mini")))
    {
        RunLiveCD(hInstance);
    }

#if 0
  /* Add new setup types here */
    else if (...)
    {

    }
#endif

    return 0;
}
Exemplo n.º 3
0
int WINAPI
wWinMain(IN HINSTANCE hInst,
         IN HINSTANCE hPrevInstance,
         IN LPWSTR lpszCmdLine,
         IN int nCmdShow)
{
    BOOL bIsLiveCD, Success = TRUE;
    STATE State;

    hInstance = hInst;

    bIsLiveCD = IsLiveCD();

Restart:
    SetUserSettings();

    if (bIsLiveCD)
    {
        State.NextPage = LOCALEPAGE;
        State.Run = SHELL;
    }
    else
    {
        State.NextPage = DONE;
        State.Run = SHELL;
    }

    if (State.NextPage != DONE) // && bIsLiveCD
    {
        RunLiveCD(&State);
    }

    switch (State.Run)
    {
        case SHELL:
            Success = StartShell();
            if (Success)
                NotifyLogon();
            break;

        case INSTALLER:
            Success = StartInstaller();
            break;

        case REBOOT:
        {
            EnablePrivilege(SE_SHUTDOWN_NAME, TRUE);
            ExitWindowsEx(EWX_REBOOT, 0);
            EnablePrivilege(SE_SHUTDOWN_NAME, FALSE);
            Success = TRUE;
            break;
        }

        default:
            Success = FALSE;
            break;
    }

    /*
     * In LiveCD mode, go back to the main menu if we failed
     * to either start the shell or the installer.
     */
    if (bIsLiveCD && !Success)
        goto Restart;

    return 0;
}