summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-31 19:11:22 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-19 03:43:22 +0200
commit6c3fa47fc9a22bbe78e2aa8a016af922003580f5 (patch)
treeed49a551bf1d5595a01b409564a35a5ad1effcf1 /desktop/source
parentdd889869c574bc7b257995cad46deb53c6fd7072 (diff)
restart soffice after the update
Change-Id: I0647f51099bace568f18b478ed500164f532eb40
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/app/updater.cxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 1529036fe65b..1e0d571f3a3c 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -39,6 +39,8 @@ static const char kUserAgent[] = "UpdateChecker/1.0 (Linux)";
const char* pUpdaterName = "updater";
+const char* pSofficeExeName = "soffice";
+
void CopyFileToDir(const OUString& rTempDirURL, const OUString rFileName, const OUString& rOldDir)
{
OUString aSourceURL = rOldDir + "/" + rFileName;
@@ -84,9 +86,12 @@ void createStr(const OUString& rStr, char** pArgs, size_t i)
pArgs[i] = pStr;
}
-char** createCommandLine(const OUString& rInstallDir, bool bReplace)
+char** createCommandLine()
{
- size_t nArgs = 6;
+ OUString aLibExecDirURL( "$BRAND_BASE_DIR/" );
+ rtl::Bootstrap::expandMacros(aLibExecDirURL);
+
+ size_t nArgs = 7;
char** pArgs = new char*[nArgs];
{
createStr(pUpdaterName, pArgs, 0);
@@ -98,16 +103,22 @@ char** createCommandLine(const OUString& rInstallDir, bool bReplace)
createStr(aPatchDir, pArgs, 1);
}
{
- createStr(rInstallDir, pArgs, 2);
+ OUString aInstallPath = getPathFromURL(aLibExecDirURL);
+ createStr(aInstallPath, pArgs, 2);
}
{
- OUString aWorkingDir = rInstallDir + "/updated";
+ OUString aWorkingDir = getPathFromURL(aLibExecDirURL + "/updated");
createStr(aWorkingDir, pArgs, 3);
}
{
- const char* pPID = bReplace ? "/replace" : "-1";
+ const char* pPID = "/replace";
createStr(pPID, pArgs, 4);
}
+ {
+ OUString aSofficePathURL = aLibExecDirURL + OUString::fromUtf8(pSofficeExeName);
+ OUString aSofficePath = getPathFromURL(aSofficePathURL);
+ createStr(aSofficePath, pArgs, 5);
+ }
pArgs[nArgs - 1] = nullptr;
return pArgs;
@@ -150,7 +161,7 @@ void Update()
OUString aTempDirPath = getPathFromURL(aTempDirURL);
OString aPath = OUStringToOString(aTempDirPath + "/" + OUString::fromUtf8(pUpdaterName), RTL_TEXTENCODING_UTF8);
- char** pArgs = createCommandLine(aLibExecDirURL, true);
+ char** pArgs = createCommandLine();
if (execv(aPath.getStr(), pArgs))
{