From 4407020ba450ea3f7d02db93ac9e5b2c4e22d25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 16 Feb 2014 12:19:16 +0100 Subject: [PATCH] PackageInstaller: Install apps to non-packaged "apps" folder. Previously, the target folder was always unset, which meant one needed to select a target folder manually. When running from a read-only media, this would still be a problem (a TODO), so that instead of failing to install the package, the user is simply prompted for a path. The change means that together with rewriting old paths to packaged locations to the non-packaged equivalents, just double clicking a PKG and hitting "Install" will now work. Tested with Moho installer and Gobe Productive. --- src/apps/packageinstaller/PackageView.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/apps/packageinstaller/PackageView.cpp b/src/apps/packageinstaller/PackageView.cpp index 7febddd852..76e9aaaaf1 100644 --- a/src/apps/packageinstaller/PackageView.cpp +++ b/src/apps/packageinstaller/PackageView.cpp @@ -563,26 +563,20 @@ PackageView::_InstallTypeChanged(int32 index) if (profile->path_type == P_INSTALL_PATH) { BMenuItem* item = NULL; - if (find_directory(B_BEOS_APPS_DIRECTORY, &path) == B_OK) { + if (find_directory(B_SYSTEM_NONPACKAGED_DIRECTORY, &path) == B_OK) { dev_t device = dev_for_path(path.Path()); - if (volume.SetTo(device) == B_OK && !volume.IsReadOnly()) { + if (volume.SetTo(device) == B_OK && !volume.IsReadOnly() + && path.Append("apps") == B_OK) { item = _AddDestinationMenuItem(path.Path(), volume.FreeBytes(), path.Path()); } } - if (find_directory(B_APPS_DIRECTORY, &path) == B_OK) { - dev_t device = dev_for_path(path.Path()); - if (volume.SetTo(device) == B_OK && !volume.IsReadOnly()) { - item = _AddDestinationMenuItem(path.Path(), - volume.FreeBytes(), path.Path()); - } - } if (item != NULL) { item->SetMarked(true); fCurrentPath.SetTo(path.Path()); + fDestination->AddSeparatorItem(); } - fDestination->AddSeparatorItem(); _AddMenuItem(B_TRANSLATE("Other" B_UTF8_ELLIPSIS), new BMessage(P_MSG_OPEN_PANEL), fDestination);