Skip to main content
Question

OneDrive Enable Extension erro

  • April 11, 2018
  • 28 replies
  • 132 views

Show first post

28 replies

KyleEricson
Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • May 8, 2018

@cddwyer Any other ideas I’m at a lose why this doesn’t work?


KyleEricson
Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • May 9, 2018

I think I have finally found a solution via a .pkg file. Testing now.

#!/bin/sh
## postinstall

pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3

#Get current user
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`

#Kill OneDrive
killall OneDrive

#OneDrive app store version
su $loggedInUser -c 'pluginkit -e use -i com.microsoft.OneDrive-mac.FinderSync'

#OneDrive standalone version
su $loggedInUser -c 'pluginkit -e use -i com.microsoft.OneDrive.FinderSync'

#Move Plist file
mv /tmp/com.microsoft.OneDriveUpdater.plist /Users/$USER/Library/Preferences/
mv /tmp/com.microsoft.OneDrive.plist /Users/$USER/Library/Preferences/

#Take ownership
chown -R $loggedInUser:staff /Users/$USER/Library/Preferences/com.microsoft.OneDriveUpdater.plist
chown -R $loggedInUser:staff /Users/$USER/Library/Preferences/com.microsoft.OneDrive.plist

#Clear cache
killall cfprefsd

#open OneDrive
su $loggedInUser -c 'open /Applications/OneDrive.app'


exit 0      ## Success
exit 1      ## Failure

KyleEricson
Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • May 10, 2018

After testing looks like AppStore version will not enable via a script only if you run the command locally on the Mac will it work.