Installer: Fixed installer

- InstallerWindow.cpp announces a message with a boolean that defines whether the install has been completed. That boolean will define InstallerApp.cpp's behavior.
- Changed the method that was used (unsuccessfully) to open FirstBootPrompt within the Installer itself, upon quitting.

Change-Id: Ibbba2f0ee3b79e091032294afcb3ed404e898f5c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3218
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Panagiotis Vasilopoulos 2020-09-15 07:44:34 +03:00 committed by Adrien Destugues
parent 963ebbca4f
commit b05b0c1c29
3 changed files with 13 additions and 5 deletions

View File

@ -78,7 +78,7 @@ InstallerApp::Quit()
BApplication::Quit();
if (!be_roster->IsRunning(kDeskbarSignature)) {
if (fInstallStatus == kFinished) {
if (CurrentMessage()->GetBool("install_complete")) {
// Synchronize disks
sync();
@ -94,7 +94,7 @@ InstallerApp::Quit()
} else {
// Return to FirstBootPrompt if the user hasn't
// installed Haiku yet
BLaunchRoster().Target("firstbootprompt");
be_roster->Launch("application/x-vnd.Haiku-FirstBootPrompt");
}
}
}

View File

@ -516,6 +516,7 @@ InstallerWindow::MessageReceived(BMessage *msg)
_SetStatusMessage(status.String());
fInstallStatus = kFinished;
_DisableInterface(false);
fProgressLayoutItem->SetVisible(false);
fPkgSwitchLayoutItem->SetVisible(true);
@ -638,8 +639,16 @@ InstallerWindow::QuitRequested()
}
_QuitCopyEngine(false);
fWorkerThread->PostMessage(B_QUIT_REQUESTED);
be_app->PostMessage(B_QUIT_REQUESTED);
BMessage* quitWithInstallStatus = new BMessage(B_QUIT_REQUESTED);
if (fInstallStatus == kFinished)
quitWithInstallStatus->AddBool("install_complete", true);
else
quitWithInstallStatus->AddBool("install_compelte", false);
fWorkerThread->PostMessage(quitWithInstallStatus);
be_app->PostMessage(quitWithInstallStatus);
return true;
}

View File

@ -43,7 +43,6 @@ public:
virtual void MessageReceived(BMessage* message);
virtual bool QuitRequested();
private:
void _ShowOptionalPackages();
void _LaunchDriveSetup();