Use _wexecl on Windows
Allows original path to contain any Unicode character.
This commit is contained in:
@@ -305,6 +305,12 @@ bool update_manager::handle_rpcs3(const QByteArray& rpcs3_data, bool /*automatic
|
|||||||
|
|
||||||
std::string replace_path;
|
std::string replace_path;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
// Get executable path
|
||||||
|
wchar_t orig_path[32767];
|
||||||
|
GetModuleFileNameW(nullptr, orig_path, sizeof(orig_path) / 2);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|
||||||
const char* appimage_path = ::getenv("APPIMAGE");
|
const char* appimage_path = ::getenv("APPIMAGE");
|
||||||
@@ -558,16 +564,13 @@ bool update_manager::handle_rpcs3(const QByteArray& rpcs3_data, bool /*automatic
|
|||||||
error_free7z();
|
error_free7z();
|
||||||
if (res)
|
if (res)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
replace_path = Emulator::GetEmuDir() + "rpcs3.exe";
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_progress_dialog->close();
|
m_progress_dialog->close();
|
||||||
QMessageBox::information(m_parent, tr("Auto-updater"), tr("Update successful!"));
|
QMessageBox::information(m_parent, tr("Auto-updater"), tr("Update successful!"));
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int ret = _execl(replace_path.c_str(), replace_path.c_str(), nullptr);
|
int ret = _wexecl(orig_path, orig_path, nullptr);
|
||||||
#else
|
#else
|
||||||
int ret = execl(replace_path.c_str(), replace_path.c_str(), nullptr);
|
int ret = execl(replace_path.c_str(), replace_path.c_str(), nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user