Skip to content

Commit c9f83f1

Browse files
committed
recognize -install-dir to install to the right directory after admin re-launch (fixes #2626)
1 parent 03d2939 commit c9f83f1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Flags.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ static void ParseScrollValue(Point* scroll, const WCHAR* txt) {
230230
V(ExtractText, "extract-text") \
231231
V(Bench, "bench") \
232232
V(Dir, "d") \
233+
V(InstallDir, "install-dir") \
233234
V(Lang, "lang") \
234235
V(UpdateSelfTo, "update-self-to") \
235236
V(ArgDeleteFile, "delete-file") \
@@ -538,7 +539,7 @@ void ParseFlags(const WCHAR* cmdLine, Flags& i) {
538539
i.exitImmediately = true;
539540
continue;
540541
}
541-
if (arg == Arg::Dir) {
542+
if (arg == Arg::Dir || arg == Arg::InstallDir) {
542543
i.installDir = str::Dup(param);
543544
continue;
544545
}

src/Installer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static void RemoveShortcutFile(int csidl) {
219219
return;
220220
}
221221
DeleteFileW(path);
222-
logf("RemoveShorcuts: deleted '%s'\n", path);
222+
logf(L"RemoveShortcutFile: deleted '%s'\n", path);
223223
}
224224

225225
// those are shortcuts created by versions before 3.4
@@ -1052,7 +1052,8 @@ int RunInstaller() {
10521052
const char* installerLogPath = nullptr;
10531053
if (gCli->log) {
10541054
installerLogPath = GetInstallerLogPath();
1055-
StartLogToFile(installerLogPath, true);
1055+
bool removeLog = !gCli->runInstallNow;
1056+
StartLogToFile(installerLogPath, removeLog);
10561057
}
10571058
logf("------------- Starting SumatraPDF installation\n");
10581059

0 commit comments

Comments
 (0)