Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 17 additions & 3 deletions syncthing/STApplication.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,25 @@ - (void)applicationLoadConfiguration {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

_executable = self.arguments = [defaults stringForKey:@"Executable"];
if (!_executable) {
_executable = [NSString stringWithFormat:@"%@/%@",

// Check that the excutable is valid (not null, exists and is executable)
// If it's not, nullify it so that it will be set to the default value
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],
@"syncthing/syncthing"];
}
}

_syncthing.URI = [defaults stringForKey:@"URI"];
_syncthing.ApiKey = [defaults stringForKey:@"ApiKey"];
Expand Down