英文:
WixSharp: how to package a large folder into a single MSI file without getting 'The system cannot open the device or specified file' error
问题
我正在使用 WixSharp v1.9.2 创建一个 MSI 文件。由于我需要打包一个非常大的文件夹,我像这样创建了项目:
var project = new Project(
ProjectName,
...
new MediaTemplate {
CompressionLevel = CompressionLevel.mszip,
EmbedCab = true,
MaximumUncompressedMediaSize = 1000,
MaximumCabinetSizeForLargeFileSplitting = 2048,
},
...
);
这将生成一个大小正确约为3GB的 MSI 文件。然而,当我尝试执行它时,我遇到了错误“系统无法打开设备或指定的文件”。
为了修复这个问题,我尝试将 EmbedCab 属性设置为 false。这似乎能够正常工作,但这次除了 MSI 文件外,还生成了 CAB 文件。
是否有一种方法可以将所有内容打包到单个 MSI 文件中?
英文:
I'm using WixSharp v1.9.2 to create an MSI file. Since I need to package a very large folder, I create the project like this:
var project = new Project(
ProjectName,
...
new MediaTemplate {
CompressionLevel = CompressionLevel.mszip,
EmbedCab = true,
MaximumUncompressedMediaSize = 1000,
MaximumCabinetSizeForLargeFileSplitting = 2048,
},
...
);
This produces an MSI file correctly sized at almost 3GB. However, when I try to execute it, I get the error The system cannot open the device or specified file
.
To fix this, I tried setting the EmbedCab property to false. This seems to work correctly, but this time, in addition to the MSI file, CAB files are also generated.
Is there a way to package everything into a single MSI file?
答案1
得分: 1
很遗憾,没有这样的方法。MSI 文件的最大尺寸为2GB(不完全准确,还有一些细节,但总体情况并未改变)。可以在此处找到更多附加细节:https://sqa.stackexchange.com/questions/2672/what-is-the-maximum-size-that-a-msi-windows-installer-file-can-be(请参见答案下的评论),以及在这里:https://stackoverflow.com/questions/9373988/what-is-the-largest-size-that-a-single-msi-windows-package-installer-file-can-b。对于自解压的 MSI,可以在这里找到信息:https://stackoverflow.com/questions/55295201/wix-toolset-bundle-with-total-content-size-2gb。
我所知道的唯一解决方法是使用外部 CAB 文件(正如您已经尝试过的)。
如果您不仅限于原始的 MSI 文件,您可以尝试将该包(MSI 和 CAB 文件)打包到任何自解压缩的存档中,比如 WinRar。它可以配置为在解压缩后自动运行 MSI 文件,还可以进行一些有限的自解压存档界面定制。
英文:
Sadly there is no such a way, . The maximum size of msi is 2Gb (not exactly, there are some details, but it does not change the situation as a whole). A lot of additional details may be found here https://sqa.stackexchange.com/questions/2672/what-is-the-maximum-size-that-a-msi-windows-installer-file-can-be (see comments under the answer) and here https://stackoverflow.com/questions/9373988/what-is-the-largest-size-that-a-single-msi-windows-package-installer-file-can-b. And here for bootstrapped msi https://stackoverflow.com/questions/55295201/wix-toolset-bundle-with-total-content-size-2gb
The only workaround I know is to use external cabs (as you already tried to do).
In case you are not limited to the raw msi, you can try to wrap the package (msi+cab's) with any self-extracting archive, such as WinRar. It can be configured to to automatically run msi after the extraction + some (limited) UI customization of the self-extract archive is possible.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论