Mac .Pkg 文件在 Windows 中打开......奇怪的事情

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7799839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 18:17:08  来源:igfitidea点击:

Mac .Pkg File Opened In Windows...Strange Happenings

windowsmacosinstallerexplorer

提问by Erik

I am a windows developer and I had to port an app to Mac. I built it fine and have everything working except my installer. I built my Package file (.pkg) which installs fine and works great on a Mac.

我是一名 Windows 开发人员,我不得不将应用程序移植到 Mac。我构建得很好,除了我的安装程序外,一切正常。我构建了我的包文件 (.pkg),它在 Mac 上安装良好且运行良好。

However, I want to move the file to a windows OS over a network to upload it to an ftp server. My ftp client is on Windows. I have done this before without issues on previous .pkg files but I just created one that is acting strange. When I view most .pkg files in windows explorer, they are treated almost like an unknown file type. Windows lets me see the file but I can't really do anything with it. This is fine because I just want to move the file, not use it in any other way.

但是,我想通过网络将文件移动到 Windows 操作系统以将其上传到 ftp 服务器。我的 ftp 客户端在 Windows 上。我以前做过这个,对以前的 .pkg 文件没有问题,但我刚刚创建了一个表现得很奇怪的文件。当我在 Windows 资源管理器中查看大多数 .pkg 文件时,它们几乎被视为未知文件类型。Windows 允许我查看该文件,但我无法对其进行任何操作。这很好,因为我只想移动文件,而不是以任何其他方式使用它。

Unfortunately, I have a new .pkg file that windows strangely treats like a directory instead of just a single file. I can open it and see the "Contents" folder and some internal files/binaries/whatever that I don't want to see. While this is similar to the MacOS functionality, it causes problems because it is uploaded as a directory rather than a file. I just want to drag it to my server and let people download it. Why is this happening?

不幸的是,我有一个新的 .pkg 文件,windows 奇怪地将其视为一个目录,而不仅仅是一个文件。我可以打开它并查看“内容”文件夹和一些我不想看到的内部文件/二进制文件/任何内容。虽然这类似于 MacOS 功能,但它会导致问题,因为它是作为目录而不是文件上传的。我只是想把它拖到我的服务器上,让人们下载它。为什么会这样?

I have looked online a fair amount and nobody seems to have this issue. It does seem to be permissions related. I saw a good amount of people complaining about "Custom Access" and oddly enough, when I click "get info" on the file, it does say I have "custom access". .Pkg files that seem to display correctly in windows explorer do not have this set. Anyways I would really appreciate the help. I could probably just get an ftp client on the Mac but this does seem really strange and it may help others if there is a solution.

我在网上看了很多,似乎没有人有这个问题。它似乎与权限有关。我看到很多人抱怨“自定义访问”,奇怪的是,当我点击文件上的“获取信息”时,它确实说我有“自定义访问”。似乎在 Windows 资源管理器中正确显示的 .Pkg 文件没有此设置。无论如何,我真的很感激你的帮助。我可能只能在 Mac 上获得一个 ftp 客户端,但这看起来确实很奇怪,如果有解决方案,它可能会帮助其他人。

回答by ughoavgfhw

Historically, Mac OS X installer files have been built as bundles, or a directory that appears as a file in OS X. These types of installers will always appear as directories in Windows. However, Mac OS X 10.5 added support for a new format, which is simply the important parts of the installer compressed using xar. Since this format is an archive and not a bundle, it will show up as a single file in Windows.

历史上,Mac OS X 安装程序文件被构建为捆绑包,或在 OS X 中显示为文件的目录。这些类型的安装程序在 Windows 中将始终显示为目录。但是,Mac OS X 10.5 添加了对新格式的支持,这只是使用xar压缩的安装程序的重要部分。由于此格式是存档而不是捆绑包,因此它将在 Windows 中显示为单个文件。

PackageMaker can produce either format depending on the minimum target version you specified for the package. If you specify 10.5, it will create the new xar format, but if you specify an older version, it will create a bundled installer. If your application will only work for 10.5 and later, you can change the minimum version in PackageMaker by going to Project > Install Properties (Command+I) and changing the Minimum Target dropdown. If you want to support older versions of OS X, then your only choice is to create the bundle version and either compress it as a zip file, or create a disk image to hold it.

PackageMaker 可以根据您为包指定的最低目标版本生成任一格式。如果您指定 10.5,它将创建新的 xar 格式,但如果您指定旧版本,它将创建一个捆绑安装程序。如果您的应用程序仅适用于 10.5 及更高版本,您可以通过转到“项目”>“安装属性”( Command+ I) 并更改“最小目标”下拉列表来更改 PackageMaker 中的最低版本。如果您想支持旧版本的 OS X,那么您唯一的选择是创建捆绑版本并将其压缩为 zip 文件,或者创建一个磁盘映像来保存它。