{"id":27771,"date":"2020-01-03T14:43:22","date_gmt":"2020-01-03T19:43:22","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=27771"},"modified":"2020-01-03T18:16:09","modified_gmt":"2020-01-03T23:16:09","slug":"appmover-swift-library","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2020\/01\/03\/appmover-swift-library\/","title":{"rendered":"AppMover Swift Library"},"content":{"rendered":"<p><a href=\"https:\/\/christiantietze.de\/posts\/2020\/01\/appmover-swift\/\">Christian Tietze<\/a>:<\/p>\n<blockquote cite=\"https:\/\/christiantietze.de\/posts\/2020\/01\/appmover-swift\/\">\n<p>Oskar Groth published a modern iteration of the &ldquo;LetsMove&rdquo; framework where you can show a dialog at app launch, asking the user if she wants to move the app to <tt>\/Applications<\/tt> first. <\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/github.com\/potionfactory\/LetsMove\/\">LetsMove<\/a> uses <a href=\"https:\/\/developer.apple.com\/documentation\/security\/1540038-authorizationexecutewithprivileg\">AuthorizationExecuteWithPrivileges<\/a>, which has long been deprecated but doesn&rsquo;t have a good replacement.<\/p>\n\n<p><a href=\"https:\/\/github.com\/OskarGroth\/AppMover\">AppMover<\/a> uses <a href=\"https:\/\/developer.apple.com\/documentation\/foundation\/nsapplescript\">NSAppleScript<\/a>, without escaping the paths in the generated AppleScript string, to invoke <code>rm<\/code> and <code>cp<\/code> via <code>do shell script [&#8230;] with administrator privileges<\/code>.<\/p>\n\n<p>Neither works with sandboxed apps.<\/p>","protected":false},"excerpt":{"rendered":"<p>Christian Tietze: Oskar Groth published a modern iteration of the &ldquo;LetsMove&rdquo; framework where you can show a dialog at app launch, asking the user if she wants to move the app to \/Applications first. LetsMove uses AuthorizationExecuteWithPrivileges, which has long been deprecated but doesn&rsquo;t have a good replacement. AppMover uses NSAppleScript, without escaping the paths [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2020-01-03T19:43:26Z","apple_news_api_id":"3e671035-674e-4372-ab94-fd56e2b2416e","apple_news_api_modified_at":"2020-01-03T23:16:13Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/APmcQNWdOQ3KrlP1W4rJBbg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[159,30,1666,74,71,53,901],"class_list":["post-27771","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-applescript","tag-mac","tag-macos-10-15","tag-opensource","tag-programming","tag-sandboxing","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=27771"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27771\/revisions"}],"predecessor-version":[{"id":27781,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27771\/revisions\/27781"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=27771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=27771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=27771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}