summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-10-12 03:36:32 +0300
committerTor Lillqvist <tml@iki.fi>2018-10-12 03:54:41 +0300
commita68bf798532c93c1fef8def82fe049ca55b5cb33 (patch)
tree8489e1db9e97833b746a7f644e464eca0fc98443
parent18446d16ea801f465bb79471f7cf9f3b95ea2e92 (diff)
Make sure the UserInstallation/user directory exists on iOS (and Android)
If it doesn't exist lots of things go very badly. Took a while for me to understand the mechanism, sigh. Change-Id: I40300587a5f422876cbda68c5aa98a23ed707135
-rw-r--r--desktop/source/app/userinstall.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx
index bec53d861d59..d748a948c585 100644
--- a/desktop/source/app/userinstall.cxx
+++ b/desktop/source/app/userinstall.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -27,6 +27,7 @@
#include <officecfg/Setup.hxx>
#include <osl/file.h>
#include <osl/file.hxx>
+#include <rtl/bootstrap.hxx>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
#include <unotools/bootstrap.hxx>
@@ -128,6 +129,12 @@ Status create(OUString const & uri) {
default:
return ERROR_OTHER;
}
+#else
+ // On (Android and) iOS, just create the user directory. Later code fails mysteriously if it
+ // doesn't exist.
+ OUString userDir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/user");
+ rtl::Bootstrap::expandMacros(userDir);
+ osl::Directory::createPath(userDir);
#endif
std::shared_ptr<comphelper::ConfigurationChanges> batch(
comphelper::ConfigurationChanges::create());