feat: 优化客户端跨平台配置和运行态管理
This commit is contained in:
@@ -45,6 +45,8 @@ static QString joinPath(const QString& root, const QString& relativePath)
|
||||
|
||||
static bool removeWithRetry(const QString& path)
|
||||
{
|
||||
// Windows 上主程序退出后,DLL/EXE 句柄可能还会短时间被系统占用。
|
||||
// Bootstrap 用短重试等待文件释放,而不是一次失败就判定升级失败。
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
if (!QFileInfo::exists(path))
|
||||
return true;
|
||||
@@ -164,6 +166,8 @@ int main(int argc, char* argv[])
|
||||
rolledBack = rollback(installDir, backupDir, paths);
|
||||
success = false;
|
||||
} else {
|
||||
// Bootstrap 是替换文件的接力进程:Updater 先退出,Bootstrap 再覆盖安装目录。
|
||||
// 它不会更新自身,避免正在运行的 Bootstrap 被覆盖导致升级中断。
|
||||
for (const PlanItem& item : items) {
|
||||
const QString& relativePath = item.relativePath;
|
||||
if (isBootstrapSelfPath(relativePath)) {
|
||||
|
||||
Reference in New Issue
Block a user