fix: copy needs to overwrite
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
@ -672,7 +672,7 @@ void PrismUpdaterApp::moveAndFinishUpdate(QDir target)
|
||||
auto install_path = FS::PathCombine(target.absolutePath(), rel_path);
|
||||
logUpdate(tr("Installing %1 from %2").arg(install_path).arg(to_install_file));
|
||||
FS::ensureFilePathExists(install_path);
|
||||
auto result = FS::copy(to_install_file, install_path)();
|
||||
auto result = FS::copy(to_install_file, install_path).overwrite(true)();
|
||||
if (!result) {
|
||||
error = true;
|
||||
logUpdate(tr("Failed copy %1 to %2").arg(to_install_file).arg(install_path));
|
||||
@ -686,11 +686,11 @@ void PrismUpdaterApp::moveAndFinishUpdate(QDir target)
|
||||
if (error) {
|
||||
logUpdate(tr("There were errors installing the update."));
|
||||
auto fail_marker = FS::PathCombine(m_dataPath, ".prism_launcher_update.fail");
|
||||
FS::copy(m_updateLogPath, fail_marker)();
|
||||
FS::copy(m_updateLogPath, fail_marker).overwrite(true)();
|
||||
} else {
|
||||
logUpdate(tr("Update succeed."));
|
||||
auto success_marker = FS::PathCombine(m_dataPath, ".prism_launcher_update.success");
|
||||
FS::copy(m_updateLogPath, success_marker)();
|
||||
FS::copy(m_updateLogPath, success_marker).overwrite(true)();
|
||||
}
|
||||
auto update_lock_path = FS::PathCombine(m_dataPath, ".prism_launcher_update.lock");
|
||||
FS::deletePath(update_lock_path);
|
||||
@ -1078,7 +1078,7 @@ void PrismUpdaterApp::backupAppDir()
|
||||
auto bak_path = FS::PathCombine(backup_dir, rel_path);
|
||||
logUpdate(tr("Backing up and then removing %1").arg(to_bak_file));
|
||||
FS::ensureFilePathExists(bak_path);
|
||||
auto result = FS::copy(to_bak_file, bak_path)();
|
||||
auto result = FS::copy(to_bak_file, bak_path).overwrite(true)();
|
||||
if (!result) {
|
||||
logUpdate(tr("Failed to backup %1 to %2").arg(to_bak_file).arg(bak_path));
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user