Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion syncthing/DaemonProcess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let MaxKeepLogLines = 200
}

private func launchSync() {
NSLog("Launching Syncthing daemon")
NSLog("Launching Syncthing daemon: \(path)")
shouldTerminate = false

// Since release v1.7.0-1 we don't allow Syncthing daemon to update by itself
Expand Down
10 changes: 10 additions & 0 deletions syncthing/STApplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ - (void)applicationLoadConfiguration {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

_executable = self.arguments = [defaults stringForKey:@"Executable"];
if (_executable) {
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:_executable]) {
NSLog(@"Resetting Syncthing daemon executable path because it doesn't exist: (%@)", _executable);
_executable = nil;
} else if (![fileManager isExecutableFileAtPath:_executable]) {
NSLog(@"Resetting Syncthing daemon executable path because it's non-executable: (%@)", _executable);
_executable = nil;
}
}
if (!_executable) {
_executable = [NSString stringWithFormat:@"%@/%@",
[[NSBundle mainBundle] resourcePath],
Expand Down