Skip to content

The only downloader you need. 下载器的集大成者。

fix(updater): 保持 log 在 restartElevated 期间打开

XiaoYouChRb83066a2d358
diff --git a/tools/updater/updater.c b/tools/updater/updater.c
index a64ec5e5..f6a31d21 100644
--- a/tools/updater/updater.c
+++ b/tools/updater/updater.c
@@ -986,10 +986,11 @@ int main(int argc, char *argv[]) {
if (geteuid() != 0) {
openLog(exeDir);
logMsg("install failed, requesting elevation");
- closeLog();
- if (restartElevated(appDir, appExe, patchFile) == 0)
+ if (restartElevated(appDir, appExe, patchFile) == 0) {
+ logMsg("elevation submitted");
+ closeLog();
return EXIT_OK;
- openLog(exeDir);
+ }
logMsg("elevation failed or cancelled");
closeLog();
return EXIT_RENAME_FAILED;