Skip to content

Commit

Permalink
recognize -install-dir to install to the right directory after admin …
Browse files Browse the repository at this point in the history
…re-launch (fixes #2626)
  • Loading branch information
kjk committed May 29, 2022
1 parent 03d2939 commit c9f83f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ static void ParseScrollValue(Point* scroll, const WCHAR* txt) {
V(ExtractText, "extract-text") \
V(Bench, "bench") \
V(Dir, "d") \
V(InstallDir, "install-dir") \
V(Lang, "lang") \
V(UpdateSelfTo, "update-self-to") \
V(ArgDeleteFile, "delete-file") \
Expand Down Expand Up @@ -538,7 +539,7 @@ void ParseFlags(const WCHAR* cmdLine, Flags& i) {
i.exitImmediately = true;
continue;
}
if (arg == Arg::Dir) {
if (arg == Arg::Dir || arg == Arg::InstallDir) {
i.installDir = str::Dup(param);
continue;
}
Expand Down
5 changes: 3 additions & 2 deletions src/Installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void RemoveShortcutFile(int csidl) {
return;
}
DeleteFileW(path);
logf("RemoveShorcuts: deleted '%s'\n", path);
logf(L"RemoveShortcutFile: deleted '%s'\n", path);
}

// those are shortcuts created by versions before 3.4
Expand Down Expand Up @@ -1052,7 +1052,8 @@ int RunInstaller() {
const char* installerLogPath = nullptr;
if (gCli->log) {
installerLogPath = GetInstallerLogPath();
StartLogToFile(installerLogPath, true);
bool removeLog = !gCli->runInstallNow;
StartLogToFile(installerLogPath, removeLog);
}
logf("------------- Starting SumatraPDF installation\n");

Expand Down

0 comments on commit c9f83f1

Please sign in to comment.