|
|
@ -22,7 +22,6 @@ NSString* CONFIG_PATH = @"/Library/Application Support/pEp/Updater"; |
|
|
|
if (self) { |
|
|
|
self.configPath = CONFIG_PATH; |
|
|
|
} |
|
|
|
[self scheduleUpdates]; |
|
|
|
return self; |
|
|
|
} |
|
|
|
|
|
|
@ -101,11 +100,14 @@ NSString* CONFIG_PATH = @"/Library/Application Support/pEp/Updater"; |
|
|
|
|
|
|
|
NSLog(@"using key from %s", keyfile.c_str()); |
|
|
|
|
|
|
|
NSFileManager *localFileManager=[NSFileManager new]; |
|
|
|
NSString* cwd = localFileManager.currentDirectoryPath; |
|
|
|
NSString* tmp = NSTemporaryDirectory(); |
|
|
|
|
|
|
|
[localFileManager changeCurrentDirectoryPath:tmp]; |
|
|
|
NSString* cwd = [NSFileManager defaultManager].currentDirectoryPath; |
|
|
|
NSURL* dirurl = [[[NSFileManager defaultManager] |
|
|
|
URLsForDirectory:NSDownloadsDirectory inDomains:NSUserDomainMask] |
|
|
|
lastObject]; |
|
|
|
|
|
|
|
NSString* dir = [dirurl path]; |
|
|
|
|
|
|
|
[[NSFileManager defaultManager] changeCurrentDirectoryPath:dir]; |
|
|
|
std::string _filename; |
|
|
|
|
|
|
|
pEp::notifyRead_t notifyRead = [=]()->void{ |
|
|
@ -120,8 +122,8 @@ NSString* CONFIG_PATH = @"/Library/Application Support/pEp/Updater"; |
|
|
|
|
|
|
|
if (_filename.length()) { |
|
|
|
NSString* filename = [NSString stringWithUTF8String:_filename.c_str()]; |
|
|
|
NSString* download = [NSString stringWithFormat:@"%@/%@", tmp, filename]; |
|
|
|
[localFileManager changeCurrentDirectoryPath:cwd]; |
|
|
|
NSString* download = [NSString stringWithFormat:@"%@/%@", dir, filename]; |
|
|
|
[[NSFileManager defaultManager] changeCurrentDirectoryPath:cwd]; |
|
|
|
|
|
|
|
NSLog(@"download arrived %@", download); |
|
|
|
if (_subscriber) { |
|
|
|