Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(updater): Use module path, not working dir
Browse files Browse the repository at this point in the history
Fix #3255
  • Loading branch information
tux3 committed May 9, 2016
1 parent 7c63594 commit 0a2e96a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/net/autoupdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,14 @@ void AutoUpdater::installLocalUpdate()
// Workaround QTBUG-7645
// QProcess fails silently when elevation is required instead of showing a UAC prompt on Win7/Vista
#ifdef Q_OS_WIN
HINSTANCE result = ::ShellExecuteW(0, L"open", updaterBin.toStdWString().c_str(), 0, 0, SW_SHOWNORMAL);
QString modulePath = qApp->applicationDirPath().replace('/', '\\');
HINSTANCE result = ::ShellExecuteW(0, L"open", updaterBin.toStdWString().c_str(),
0, modulePath.toStdWString().c_str(), SW_SHOWNORMAL);
if (result == (HINSTANCE)SE_ERR_ACCESSDENIED)
{
// Requesting elevation
result = ::ShellExecuteW(0, L"runas", updaterBin.toStdWString().c_str(), 0, 0, SW_SHOWNORMAL);
result = ::ShellExecuteW(0, L"runas", updaterBin.toStdWString().c_str(),
0, modulePath.toStdWString().c_str(), SW_SHOWNORMAL);
}
if (result <= (HINSTANCE)32)
failExit();
Expand Down

0 comments on commit 0a2e96a

Please sign in to comment.