macOS Mojave 10.14上安装iTunes12.6

将一下内容保存为iTunes.scpt,并运行

set question to display dialog "确定是否删除 iTunes ?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
    do shell script "rm -rf /Applications/iTunes.app" with administrator privileges
    display dialog "iTunes 已删除" buttons {"OK"}
    set theDMG to choose file with prompt "请选择 iTunes 12.6 dmg 安装文件:" of type {"dmg"}
    do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
    do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
    do shell script "sed -i '' 's/18A1/14F2511/g' ~/tmp/Distribution"
    do shell script "sed -i '' 's/gt/lt/g' ~/tmp/Distribution"
    do shell script "pkgutil --flatten ~/tmp ~/Desktop/iTunes.pkg"
    do shell script "hdiutil unmount /Volumes/iTunes/"
    do shell script "rm -rf ~/tmp"
end if
if answer is equal to "No" then
    display dialog "iTunes 未删除" buttons {"OK"}
    return
end if

set question to display dialog "确定是否安装 iTtunes 12.6 ?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
    do shell script "open ~/Desktop/iTunes.pkg"
    return
end if
if answer is equal to "No" then
    display dialog "已修改的 iTunes.pkg 文件保存在桌面" buttons {"OK"}
    return
end if
参考资料:https://tinyurl.com/y33j2pwt https://forums.macrumors.com/threads/apples-special-version-of-itunes-that-still-has-an-app-store-currently-incompatible-with-macos-mojave.2143244/page-4#post-26592234

转载于:https://www.cnblogs.com/zhuxiaoxi/p/10840285.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值