Merge pull request #15705 from danteruiz/allowing-launching-from-dmg

BUGZ-588: MAC LAUNCHER: We can not run from inside of the DMG
This commit is contained in:
Bradley Austin Davis 2019-06-10 10:47:39 -07:00 committed by GitHub
commit 355249a402
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -57,6 +57,7 @@ typedef enum LoginErrorTypes
- (BOOL) loginShouldSetErrorState;
- (void) displayErrorPage;
- (void) showLoginScreen;
- (NSString*) getLauncherPath;
- (ProcessState) currentProccessState;
- (void) setCurrentProcessState:(ProcessState) aProcessState;
- (void) setLoginErrorState:(LoginError) aLoginError;

View file

@ -73,6 +73,11 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
return filePath;
}
- (NSString*) getLauncherPath
{
return [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/MacOS/"];
}
- (void) extractZipFileAtDestination:(NSString *)destination :(NSString*)file
{
NSTask* task = [[NSTask alloc] init];
@ -174,7 +179,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
- (NSString*) getAppPath
{
return [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/Contents/MacOS/"];
return [self getDownloadPathForContentAndScripts];
}
- (BOOL) loginShouldSetErrorState
@ -317,7 +322,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
- (void) launchInterface
{
NSString* launcherPath = [[self getAppPath] stringByAppendingString:@"HQ Launcher"];
NSString* launcherPath = [[self getLauncherPath] stringByAppendingString:@"HQ Launcher"];
[[Settings sharedSettings] setLauncherPath:launcherPath];
[[Settings sharedSettings] save];
@ -351,8 +356,6 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
}
[workspace launchApplicationAtURL:url options:NSWorkspaceLaunchNewInstance configuration:[NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments] error:&error];
//NSLog(@"arguments %@", [NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments]);
[NSApp terminate:self];
}