{"id":268,"date":"2011-01-25T11:43:32","date_gmt":"2011-01-25T17:43:32","guid":{"rendered":"http:\/\/www.brunerd.com\/blog\/?p=268"},"modified":"2011-01-25T11:47:16","modified_gmt":"2011-01-25T17:47:16","slug":"more-app-store-tips-for-admins","status":"publish","type":"post","link":"https:\/\/www.brunerd.com\/blog\/2011\/01\/25\/more-app-store-tips-for-admins\/","title":{"rendered":"More App Store tips for admins"},"content":{"rendered":"<p>Continuing the tech ramble about how to keep the App Store from your users&#8230;<\/p>\n<p>So, I figured out the two ways the App Store icon is added to the dock:<\/p>\n<p>1. <strong>Existing<\/strong> users on an upgraded system are affected by this file: <strong>\/Library\/Preferences\/com.apple.dockfixup<\/strong><\/p>\n<p>Looking at the add-app key inside contains the answer:<\/p>\n<p><code> <\/code><\/p>\n<p><code> <\/code><\/p>\n<p><code><\/p>\n<div id=\"_mcePaste\">&lt;key&gt;add-app&lt;\/key&gt;<\/div>\n<div id=\"_mcePaste\">&lt;array&gt;<\/div>\n<div id=\"_mcePaste\" style=\"padding-left: 30px;\">&lt;dict&gt;<\/div>\n<div id=\"_mcePaste\" style=\"padding-left: 60px;\">&lt;key&gt;path&lt;\/key&gt;<\/div>\n<div id=\"_mcePaste\" style=\"padding-left: 60px;\">&lt;string&gt;\/Applications\/App Store.app&lt;\/string&gt;<\/div>\n<div id=\"_mcePaste\" style=\"padding-left: 60px;\">&lt;key&gt;after&lt;\/key&gt;<\/div>\n<div id=\"_mcePaste\" style=\"padding-left: 60px;\">&lt;string&gt;begin&lt;\/string&gt;<\/div>\n<div id=\"_mcePaste\" style=\"padding-left: 30px;\">&lt;\/dict&gt;<\/div>\n<div id=\"_mcePaste\">&lt;\/array&gt;<\/div>\n<p><\/code><\/p>\n<p>We can rid ourselves of \u00a0this behavior with defaults:<\/p>\n<p><code>defaults delete \/Library\/Preferences\/com.apple.dockfixup add-app<\/code><\/p>\n<p>However, if you try to use a loginhook to remove the icon, it will not take effect unitl the second login, sine the loginhook runs <em>before<\/em> Apple&#8217;s dockfixup is applied.<\/p>\n<p>The solution to a user never seeing it (and avoiding calls about it) is to use a daemon that runs at system startup and deletes the entry in the plist before it is ever used.<\/p>\n<p>Save as \/Library\/LaunchDaemon\/com.brunerd.dockfixer.plist (or whatever you wish):<\/p>\n<p><code> <\/code><\/p>\n<p><code> <\/code><\/p>\n<p><code><\/p>\n<p style=\"margin: 0.0px 0.0px 13.0px 0.0px; line-height: 19.0px; font: 13.0px Courier;\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;<br \/>\n&lt;!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\" \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\"&gt;<br \/>\n&lt;plist version=\"1.0\"&gt;<br \/>\n&lt;dict&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;key&gt;Label&lt;\/key&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;string&gt;com.sts.dockfixup&lt;\/string&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;key&gt;ProgramArguments&lt;\/key&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;array&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;string&gt;defaults&lt;\/string&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;string&gt;delete&lt;\/string&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;string&gt;\/Library\/Preferences\/com.apple.dockfixup&lt;\/string&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;string&gt;add-app&lt;\/string&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;\/array&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;key&gt;RunAtLoad&lt;\/key&gt;<br \/>\n<span style=\"white-space: pre;\"> <\/span>&lt;true\/&gt;<br \/>\n&lt;\/dict&gt;<br \/>\n&lt;\/plist&gt;<\/p>\n<p><\/code><\/p>\n<p>You could call another script, check for add-app&#8217;s presence, but having this run everytime, insures that despite OS updates and reversions of files your user will never have App Store added to their Docks.<\/p>\n<p>2. Suppressing App Store in new user accounts is affected by Dock.app&#8217;s default.plist:<br \/>\n<code><strong>\/System\/Library\/CoreServices\/Dock.app\/Contents\/Resources\/English.lproj\/default.plist<\/strong><\/code><\/p>\n<p>But just deleting this and not com.apple.fixup.plist will not do what you want since fixup will still run, <strong>you must delete both<\/strong>. Altering that is the perfect job for <a href=\"http:\/\/brunerd.com\/software\/RemoveItemFromDock\/RemoveItemFromDock.dmg\">removeitemfromdock<\/a>&#8230; if only it worked with a supplied path&#8230; now it does! So after installing and <a href=\"http:\/\/brunerd.com\/software\/RemoveItemFromDock\/RemoveItemFromDock.dmg\">downloading<\/a> you can run this command to alter the default dock:<\/p>\n<p><code>sudo \/sbin\/removeitemfromdock\u00a0-f \/System\/Library\/CoreServices\/Dock.app\/Contents\/Resources\/English.lproj\/default.plist \/Applications\/App\\ Store.app\/<\/code><\/p>\n<p>You could make this another Daemon or just have the daemon call an external script, your choice, I can&#8217;t do <em>all<\/em> the work for you :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Continuing the tech ramble about how to keep the App Store from your users&#8230; So, I figured out the two ways the App Store icon is added to the dock: 1. Existing users on an upgraded system are affected by this file: \/Library\/Preferences\/com.apple.dockfixup Looking at the add-app key inside contains the answer: &lt;key&gt;add-app&lt;\/key&gt; &lt;array&gt; &lt;dict&gt; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,12],"tags":[],"class_list":["post-268","post","type-post","status-publish","format-standard","hentry","category-apple","category-os-x","category-scripting"],"_links":{"self":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/comments?post=268"}],"version-history":[{"count":6,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":276,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/268\/revisions\/276"}],"wp:attachment":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/media?parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/categories?post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/tags?post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}