From 90562b72b73e293873415c87c3456eb18270922c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 22 Apr 2009 19:55:47 +0000 Subject: [PATCH] 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 --- src/apps/installer/InstallerWindow.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/apps/installer/InstallerWindow.cpp b/src/apps/installer/InstallerWindow.cpp index a38d5e6376..a87940c7d1 100644 --- a/src/apps/installer/InstallerWindow.cpp +++ b/src/apps/installer/InstallerWindow.cpp @@ -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(); + } + } }