From c77c3df48560fc5a918296e1844a2ee0a3915dc8 Mon Sep 17 00:00:00 2001 From: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Date: Fri, 19 Apr 2024 22:56:51 -0700 Subject: [PATCH] Update CemuUpdateWindow.cpp --- src/gui/CemuUpdateWindow.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/gui/CemuUpdateWindow.cpp b/src/gui/CemuUpdateWindow.cpp index 100073806..98031cea4 100644 --- a/src/gui/CemuUpdateWindow.cpp +++ b/src/gui/CemuUpdateWindow.cpp @@ -503,18 +503,15 @@ void CemuUpdateWindow::WorkerThread() fs::rename(exec, target_exe); m_restartFile = exec; #elif BOOST_OS_LINUX - if (std::getenv("APPIMAGE")) - { - std::string target_directory = exePath.parent_path().generic_string(); - const auto exec = exePath; - const auto target_exe = fs::path(exePath).replace_extension("AppImage.backup"); + const char* appimage_path = std::getenv("APPIMAGE"); + const auto target_exe = fs::path(appimage_path).replace_extension("AppImage.backup"); const char* filePath = update_file.c_str(); mode_t permissions = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; - fs::rename(exec, target_exe); - m_restartFile = exec; + fs::rename(appimage_path, target_exe); + m_restartFile = appimage_path; chmod(filePath, permissions); - wxCopyFile (wxT("/tmp/cemu_update/Cemu.AppImage"), wxT("/home/ubuntu/Downloads/Cemu.AppImage")); - } + wxString wxAppPath = wxString::FromUTF8(appimage_path); + wxCopyFile (wxT("/tmp/cemu_update/Cemu.AppImage"), wxT(wxAppPath)); #elif BOOST_OS_MACOS #endif