Try really hard to launch DriveSetup. The registrar may have trouble to launch

an app by signature if the mime database is incomplete. Like on a boot CD.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30333 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-04-22 19:55:47 +00:00
parent 31b2d189ab
commit 90562b72b7
1 changed files with 18 additions and 2 deletions

View File

@ -331,8 +331,24 @@ InstallerWindow::ShowBottom()
void
InstallerWindow::LaunchDriveSetup()
{
if (be_roster->Launch(DRIVESETUP_SIG) != B_OK)
fprintf(stderr, "There was an error while launching DriveSetup\n");
if (true || be_roster->Launch(DRIVESETUP_SIG) != B_OK) {
// Try really hard to launch it. It's very likely that this fails,
// when we run from the CD and there is only an incomplete mime
// database for example...
BPath path;
if (find_directory(B_SYSTEM_APPS_DIRECTORY, &path) != B_OK
|| path.Append("DriveSetup") != B_OK) {
path.SetTo("/boot/system/apps/DriveSetup");
}
BEntry entry(path.Path());
entry_ref ref;
if (entry.GetRef(&ref) != B_OK || be_roster->Launch(&ref) != B_OK) {
BAlert* alert = new BAlert("error", "DriveSetup, the application "
"to configure disk partitions, could not be launched.",
"Ok");
alert->Go();
}
}
}