summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-06-21 22:17:29 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-06-24 10:59:30 +0200
commit784371488b759420fb84bc93ce21ec84cc0b0643 (patch)
treee1f18974212be7a148a22d0698f7ee6691529e8f /desktop
parent42a6c0d0e75fc1b3c04d90910025196735783e6e (diff)
updater: forward the command line arguments to the updater
The arguments will then be used again to restart LibreOffice with the same arguments. Change-Id: I17697c997a1dfeebecd9ec64e8f4ea66cadc4690 Reviewed-on: https://gerrit.libreoffice.org/39079 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/app/updater.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 1d2b7585321c..9701691c1fb4 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -25,6 +25,7 @@
#include <unotools/tempfile.hxx>
#include <unotools/configmgr.hxx>
#include <osl/file.hxx>
+#include <rtl/process.h>
#include <curl/curl.h>
@@ -140,7 +141,8 @@ char** createCommandLine()
OUString aInstallDir( "$BRAND_BASE_DIR/" );
rtl::Bootstrap::expandMacros(aInstallDir);
- size_t nArgs = 8;
+ size_t nCommandLineArgs = rtl_getAppCommandArgCount();
+ size_t nArgs = 8 + nCommandLineArgs;
char** pArgs = new char*[nArgs];
{
createStr(pUpdaterName, pArgs, 0);
@@ -183,6 +185,15 @@ char** createCommandLine()
OUString aSofficePath = getPathFromURL(aSofficePathURL);
createStr(aSofficePath, pArgs, 6);
}
+
+ // add the command line arguments from the soffice list
+ for (size_t i = 0; i < nCommandLineArgs; ++i)
+ {
+ OUString aCommandLineArg;
+ rtl_getAppCommandArg(i, &aCommandLineArg.pData);
+ createStr(aCommandLineArg, pArgs, 7 + i);
+ }
+
pArgs[nArgs - 1] = nullptr;
return pArgs;