Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

AutoUpdate Mac Installer Script Administrator privileges changes #656

Merged
merged 5 commits into from
Jul 24, 2018
Merged

AutoUpdate Mac Installer Script Administrator privileges changes #656

merged 5 commits into from
Jul 24, 2018

Conversation

niteskum
Copy link
Contributor

@niteskum niteskum commented Jun 15, 2018

ping @vickramdhawal @nethip @mbhavi @swmitra for review.

This PR include Fix for adobe/brackets#14417
In this PR I have wrapped update.sh script in applescript and running from RunAppUpdate Function.
AppleScript runs update.sh script in elevated mode for non-admin user

@niteskum niteskum changed the title Auto update administrator permission changes AutoUpdate Mac Installer Script Administrator privileges changes Jun 15, 2018
@madanbn madanbn requested a review from nethip June 21, 2018 05:35
pArgs = [NSArray arrayWithObjects:shPath, scriptPath, @"-a", bracketsAppName, @"-b", installDir, @"-l", logFilePath, @"-m", mountPoint, @"-t", updateDir, @"-p", pidString, @"&", nil];

retval = RunScript(nohupPath, pArgs, false);
BOOL isAdmin = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BOOL isAdmin = NO or bool isAdmin = false

/*Build the Apple Script String*/
NSAppleEventDescriptor *returnDescriptor = NULL;
NSString * appleScriptString = @"do shell script \"";
appleScriptString = [appleScriptString stringByAppendingString:nohupPath];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer an [NSString stringWithFormat:]

appleScriptString = [appleScriptString stringByAppendingString:@" with administrator privileges"];
}

NSAppleScript *theScript = [[NSAppleScript alloc] initWithSource:appleScriptString];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theScript string needs be freed. But anyways since this in the destruction sequence I guess we can live with it.

@nethip
Copy link
Contributor

nethip commented Jun 21, 2018

@niteskum Please address the review comments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants