Skip to content

Commit

Permalink
More resilient postinstall updated for High Sierra
Browse files Browse the repository at this point in the history
  • Loading branch information
shysaur committed Sep 29, 2017
1 parent 6c313ae commit 838c68e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions PackageResources/Scripts/postinstall
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/sh
#!/bin/bash -x
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v "$2/Library/Spotlight/ChiptuneImporter.mdimporter/Contents/Resources/ChiptuneImporterUTIHelper.app"
su $USER -c "/usr/bin/mdimport -d3 -r ""$2/Library/Spotlight/ChiptuneImporter.mdimporter"
macosv=($(sw_vers -productVersion | sed 's/\./ /g'))
echo macos version ${macosv[*]}
if [[ ${macosv[1]} -gt 12 ]]; then
com='/usr/bin/mdutil -r '
else
com='/usr/bin/mdimport -d3 -r '
fi;
su $USER -c "${com}$2/Library/Spotlight/ChiptuneImporter.mdimporter; echo returned \$?";
exit 0

0 comments on commit 838c68e

Please sign in to comment.