Skip to content
Snippets Groups Projects
Commit a00e9d6c authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

processes: close Jami and QWebEngineProcess using WiX Quiet Execution Custom Action

Change-Id: I64cb7e86e2ff418c03ea374e05e14d43c8597acc
parent c4a086ae
Branches
No related tags found
No related merge requests found
......@@ -40,6 +40,12 @@
<CustomAction Id="removeOldJamiFiles" Directory="APPLICATIONFOLDER" ExeCommand="cmd /c &quot;del vc_redist.x64.exe; del uninstall.exe; del WinSparkle.dll;&quot;" Execute="deferred" Return="ignore" HideTarget="no" Impersonate="no" />
<Property Id="QtExecCmdLine" Value='"[WindowsFolder]\System32\taskkill.exe" /F /IM QtWebEngineProcess.exe /IM Jami.exe'/>
<CustomAction Id="JamiProcesses.TaskKill"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Execute="immediate"
Return="ignore"/>
</Product>
<Fragment Id="DirectoryStructure">
......@@ -51,6 +57,7 @@
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" />
</Directory>
<Directory Id="WindowsFolder" Name="WINDOWS"/>
</Directory>
</Fragment>
......@@ -104,6 +111,7 @@
</InstallUISequence>
</UI>
<InstallExecuteSequence>
<Custom Action='JamiProcesses.TaskKill' Before='InstallValidate'/>
<Custom Action="removeOldJamiFiles" After="RemoveFiles" />
<Custom Action="LaunchApplication_nonUI" After="InstallFinalize"> WIXNONUILAUNCH </Custom>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
......
......@@ -35,6 +35,7 @@
#include "networkmanager.h"
#include "updateconfirmdialog.h"
#include "version.h"
#include "mainwindow.h"
#include <globalinstances.h>
#include <qrencode.h>
......@@ -439,12 +440,13 @@ Utils::applyUpdates(bool updateToBeta, QWidget* parent)
}
auto args = QString(" /passive /norestart WIXNONUILAUNCH=1");
auto dir = Utils::WinGetEnv("TEMP");
auto cmd = "powershell " + QString(dir) + "\\" + downloadPath.fileName()
auto cmdStartInstaller = "powershell " + QString(dir) + "\\" + downloadPath.fileName()
+ " /L*V " + QString(dir) + "\\jami_x64_install.log" + args;
auto retq = QProcess::startDetached(cmd);
if (retq) {
QCoreApplication::exit();
}
MainWindow::instance().close();
LRCInstance::instance().reset();
QProcess::startDetached(cmdStartInstaller);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment