[Interest] Process started with QProcess::startDetached is still a child, and is killed when parent quits

Bo Thorsen bthorsen at ics.com
Thu Mar 6 12:56:00 CET 2014


Hi Wiebe,

Den 05-03-2014 21:40, Wiebe Cazemier skrev:
> I'm trying to get my auto-updater to work for my Qt 5.1 project
> (running on Windows 7 32 bit, but Windows XP has the same problem).
> It downloads an installer, starts it, and quits itself. The problem
> is that when the application quits, the installer is killed along
> with it, regardless of the fact that the process is started
> detached.

For this reason, I don't use QProcess but go for Windows specific code 
to run my upgrade executable:

QString path = QDir::toNativeSeparators(d->downloader->path());
ShellExecuteW(0, L"runas", (wchar_t*)path.utf16(), 0, 0, SW_NORMAL);

Bo.

-- 
Bo Thorsen, European Engineering Manager, ICS
Meet me at our quickstarts across Europe in March.
London, Copenhagen, Hamburg, Munich and Zurich.
See this page: http://ics.com/qt-quickstart



More information about the Interest mailing list