如何设置PackageMaker安装后在桌面上创建图标?
我需要在安装后创建桌面图标,但我不知道如何做。我正在使用包生成器创建 Mac 安装包 (.pkg) 我知道在桌面上创建快捷方式不是最佳实践,但这是一个重要的要求。
I have a requirement to create desktop icon after installation, and I can't find out how. I am using package maker to create a Mac install package (.pkg) I am aware that it is not the best practice to create shortcuts on desktop, but this an important requirement.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此功能未内置于 PackageMaker 中,并且通常在任何 Mac 应用程序中都看不到。这并不意味着您可以通过编写将在安装完成后运行并将文件复制到桌面的 bash 脚本来手动执行此操作。只需包含一个组件并将其安装到
\tmp
,然后在该包的安装后脚本中mv
将文件复制到$USER
的桌面。前任。
mv /tmp/icon.sh /Users/$USER/Desktop/icon.sh
This functionality isn't built into PackageMaker and usually isn't seen with any Mac apps. That doesn't mean you can do this manually by writing a bash script that will run on completion of the installation and copy a file to the desktop. Just include a component and install it to
\tmp
then in the Postinstall script for that packagemv
the file to the$USER
's desktop.ex.
mv /tmp/icon.sh /Users/$USER/Desktop/icon.sh