-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fsck, fixed the bug that prevented non-admin users from installing Cl…
…ickToFlash to their OWN FRIGGIN' HOME DIRECTORY because we have to support 10.4 and because non-admin users can't write to the Receipts directory; fix involves creating TWO packages, one requiring admin privs, one not, and then creating a friggin' METAPKG which chooses which one to use based on whether the user is an admin and whether a receipt already exists, so that a password is required only when ABSOLUTELY needed; the updated script also replaces the bom and pax.gz files in one of the installers with a symbolic links to the respective files of the other installer, so we aren't having users unnecessarily download stuff; FRIGGIN' APPLE FIX YOUR INSTALLER TECHNOLOGY ALREADY, JESUS H. M. CHRIST
- Loading branch information
Simone Manganelli
authored and
Simone Manganelli
committed
Aug 23, 2009
1 parent
c73bba6
commit 96f78ed
Showing
9 changed files
with
217 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.github.rentzsch.clicktoflash.admin.pkg</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1</string> | ||
<key>IFMajorVersion</key> | ||
<integer>1</integer> | ||
<key>IFMinorVersion</key> | ||
<integer>0</integer> | ||
<key>IFPkgFlagAllowBackRev</key> | ||
<true/> | ||
<key>IFPkgFlagAuthorizationAction</key> | ||
<string>RootAuthorization</string> | ||
<key>IFPkgFlagDefaultLocation</key> | ||
<string>/tmp</string> | ||
<key>IFPkgFlagFollowLinks</key> | ||
<true/> | ||
<key>IFPkgFlagInstallFat</key> | ||
<false/> | ||
<key>IFPkgFlagInstalledSize</key> | ||
<integer>1736</integer> | ||
<key>IFPkgFlagIsRequired</key> | ||
<false/> | ||
<key>IFPkgFlagOverwritePermissions</key> | ||
<false/> | ||
<key>IFPkgFlagRelocatable</key> | ||
<false/> | ||
<key>IFPkgFlagRestartAction</key> | ||
<string>None</string> | ||
<key>IFPkgFlagRootVolumeOnly</key> | ||
<false/> | ||
<key>IFPkgFlagUpdateInstalledLanguages</key> | ||
<false/> | ||
<key>IFPkgFormatVersion</key> | ||
<real>0.1000000014901161</real> | ||
</dict> | ||
</plist> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174"> | ||
<title>ClickToFlash</title> | ||
<options customize="never" allow-external-scripts="yes" rootVolumeOnly="false"/> | ||
<installation-check script="pm_install_check();"/> | ||
<volume-check script="pm_volume_check();"/> | ||
<script>function pm_volume_check() { | ||
if(!(my.target.mountpoint == '/')) { | ||
my.result.title = 'Failure'; | ||
my.result.message = 'This software can only be installed on the root volume.'; | ||
my.result.type = 'Fatal'; | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
|
||
function pm_install_check() { | ||
if(!(system.version.ProductVersion >= '10.5.0')) { | ||
my.result.title = 'ClickToFlash requires MacOS X 10.5 Leopard'; | ||
my.result.message = 'ClickToFlash cannot be used with the version of Mac OS X installed on your computer.'; | ||
my.result.type = 'Fatal'; | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
|
||
|
||
function pm_clicktoflashadmin_selected() { | ||
result = true; | ||
result = result && (system.run('admin_privs_needed.command') == true); | ||
return result; | ||
} | ||
|
||
|
||
function pm_clicktoflashadmin_hidden() { | ||
result = true; | ||
result = result && (system.run('admin_privs_needed.command') == true); | ||
return result; | ||
} | ||
|
||
|
||
function pm_clicktoflashadmin_enabled() { | ||
result = true; | ||
result = result && (system.run('admin_privs_needed.command') == true); | ||
return result; | ||
} | ||
|
||
|
||
function pm_clicktoflashnonadmin_selected() { | ||
result = true; | ||
result = result && (system.run('no_admin_privs_needed.command') == true); | ||
return result; | ||
} | ||
|
||
|
||
function pm_clicktoflashnonadmin_hidden() { | ||
result = true; | ||
result = result && (system.run('no_admin_privs_needed.command') == true); | ||
return result; | ||
} | ||
|
||
|
||
function pm_clicktoflashnonadmin_enabled() { | ||
result = true; | ||
result = result && (system.run('no_admin_privs_needed.command') == true); | ||
return result; | ||
}</script> | ||
<background file="background" alignment="bottomright" scaling="none"/> | ||
<readme file="ReadMe"/> | ||
<choices-outline> | ||
<line choice="clicktoflashadmin"/> | ||
<line choice="clicktoflashnonadmin"/> | ||
</choices-outline> | ||
<choice id="clicktoflashadmin" title="ClickToFlash-admin" selected="pm_clicktoflashadmin_selected()" enabled="pm_clicktoflashadmin_enabled()" visible="!pm_clicktoflashadmin_hidden()"> | ||
<pkg-ref id="com.github.rentzsch.clicktoflash.admin.pkg"/> | ||
</choice> | ||
<choice id="clicktoflashnonadmin" title="ClickToFlash-nonadmin" selected="pm_clicktoflashnonadmin_selected()" enabled="pm_clicktoflashnonadmin_enabled()" visible="!pm_clicktoflashnonadmin_hidden()"> | ||
<pkg-ref id="com.github.rentzsch.clicktoflash.nonadmin.pkg"/> | ||
</choice> | ||
<pkg-ref id="com.github.rentzsch.clicktoflash.admin.pkg" installKBytes="1736" version="1" auth="Root">file:./Contents/Packages/clicktoflash-admin.pkg</pkg-ref> | ||
<pkg-ref id="com.github.rentzsch.clicktoflash.nonadmin.pkg" installKBytes="1736" version="1">file:./Contents/Packages/clicktoflash-nonadmin.pkg</pkg-ref> | ||
</installer-script> |
23 changes: 23 additions & 0 deletions
23
Installer/distribution-mpkg/resources/admin_privs_needed.command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
cd "`dirname \"$0\"`" | ||
SCRIPT_WD=`pwd` | ||
DIR=/Library/Receipts/clicktoflash-nonadmin.pkg/ | ||
GROUPS=`id -Gn $USER` | ||
|
||
if [ -d $DIR ]; then | ||
echo "There is a receipt, no admin privs required for installer pkg." | ||
exit 0 | ||
fi | ||
|
||
if [ "$GROUPS" == "20" ]; then | ||
echo "User has admin privs, no admin privs required for installer pkg." | ||
exit 0 | ||
else | ||
if [[ "$GROUPS" =~ " 20 " ]]; then | ||
echo "User has admin privs, no admin privs required for installer pkg." | ||
exit 0 | ||
fi | ||
fi | ||
|
||
echo "No receipt, no admin privs, installer must ask for admin password." | ||
exit 1 |
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
Installer/distribution-mpkg/resources/no_admin_privs_needed.command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
cd "`dirname \"$0\"`" | ||
SCRIPT_WD=`pwd` | ||
DIR=/Library/Receipts/clicktoflash-nonadmin.pkg/ | ||
GROUPS=`id -Gn $USER` | ||
|
||
if [ -d $DIR ]; then | ||
echo "There is a receipt, no admin privs required for installer pkg." | ||
exit 1 | ||
fi | ||
|
||
if [ "$GROUPS" == "20" ]; then | ||
echo "User has admin privs, no admin privs required for installer pkg." | ||
exit 1 | ||
else | ||
if [[ "$GROUPS" =~ " 20 " ]]; then | ||
echo "User has admin privs, no admin privs required for installer pkg." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
echo "No receipt, no admin privs, installer must ask for admin password." | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters