更新时间:2022-11-03 14:21:40
好,这个问题不是100%明确的,但我会试一试。以这种方式(嵌入在MSI文件中)传递EXE文件并不理想。实际上,这是一个非常糟糕的主意-说实话。通常,不应仅将MSI文件用作包装程序来传递嵌入式setup.exe文件。 MSI的复杂性及其高级模拟,排序和条件处理,使得此错误非常容易发生,并且难以实施和测试。此外,如果您嵌入的二进制文件原来是包裹在setup.exe二进制文件中的MSI文件,则MSI将失败,因为它不允许两个并发安装序列-除非您从用户界面序列安装它们(否则将不会)
OK, the question isn't 100% clear, but I will give it a go. Delivering EXE files this way - embedded in MSI file - is not ideal. In fact it is a very bad idea - truth be told. MSI files should generally not be used just as wrappers to deliver embedded setup.exe files. The sheer complexity of MSI with its advanced impersonation, sequencing and conditioning makes this very error prone and hard to implement and test. Additionally, if the binary you embed turns out to be an MSI file wrapped in a setup.exe binary, then MSI will fail because it doesn't allow two concurrent installation sequences - unless you install them from the user interface sequence (which won't work when running silently).
MSI文件在静默模式下(无GUI)可靠运行的能力无法与旧式设置相提并论。但是,通常您可以找到旧版(或较新的) setup.exe 或安装二进制文件的开关,这些开关将允许以静默模式安装该开关,但不能以MSI提升的安装权限进行安装。您必须以实际的管理员权限运行。另外,您通常必须通过对话框记录运行并使用记录的响应来运行安装顺序-这容易出错,因为意外的对话框可能会显示没有记录的响应的地方。然后你被困住了。 MSI可靠的静默运行是MSI的主要企业优势之一。
The ability of MSI files to run reliably in silent mode (without GUI) can not be matched by legacy style setups. However, often you can find switches for a legacy (or modern) setup.exe or installation binary which will allow it to be installed in silent mode, but not with MSI elevated installation rights. You would have to run with real admin rights. And additionally you often have to "record" a run though the dialogs and use the recorded responses to run the installation sequence - this is error prone since an unexpected dialog could show up where there is no recorded "response". Then you are stuck. MSI's reliable silent running is one of the key corporate advantages of MSI.
您可以在我前一段时间写的这个答案中找到很多有关此的信息: 如何使用Powershell来运行安装程序? 强>。不要让问题标题使您感到困惑,问题仍然与您要问的问题非常相似-至少我是这样认为的。
You can find a lot of information on this in this answer that I wrote a while ago: How can I use powershell to run through an installer?. Don't let the question title confuse you, the issue is still quite similar to what you are asking - at least I think so. Please give it a quick skim at least.
答案还描述了 应用程序重新打包-转换旧式(或现代)设置的过程.exe安装程序转换为本地MSI格式。这是一项需要精通MSI的专业任务,但一旦正确完成就可以产生出色的结果,并且静默安装非常容易,因为您不必依赖于上述脆弱的静默响应文件。
The answer also describes "Application Repackaging" - the process of converting legacy (or modern) setup.exe installers to native MSI format. This is a specialist task requiring good understanding of MSI but yields excellent results once done right, and silent installation is a breeze since you don't rely on frail "silent response files" as described above.
尽管我不确定它们是否都允许您以静默方式安装,有可用的工具可让您从启动器EXE文件依次安装MSI文件和安装二进制文件。这里还有另一个讨论各种引导程序选项的答案: Wix和.NET Framework(先决条件) 。在本讨论中推荐的引导程序之一是 dotNetInstaller 。我从未使用过,所以无法告诉您它是否有用。它可能比WiX自己的称为 刻录 ,但是我不确定这是否符合功能。如果您进行测试,请报告您的发现。当然还有其他引导者,但这不是我的专业领域。诸如Installshield(至少在其高级版本中)之类的商业工具具有使用GUI构建此类引导程序的功能,我认为它们将其称为安装套件或类似的东西。本质上只是一堆安装程序和先决条件。我还没有尝试高级安装程序中的此引导程序功能。
Though I am not sure if they all allow you to install in silent mode, there are tools available that allow you to install MSI files and installation binaries in sequence from a launcher EXE file. There is another answer discussing various bootstrapper options here: Wix and .NET Framework (prerequisites). One of the bootstrappers recommended in the this discussion is dotNetInstaller. I have never used it, so I can't tell you if it is any good. It may be more GUI-based than WiX's own bootstrapper feature called Burn, however I am not sure if it is a match feature-wise. If you do test, please report your findings. There are certainly other bootstrappers out there, but it is not my area of expertise. Commercial tools such as Installshield (in their Premium version at least), have features to build such a bootstrapper using a GUI and I think they refer to them as "Install Suites" - or something like that. Just a bundle of installers and prerequisites essentially. I haven't tried this bootstrapper feature in Advanced Installer.
关于刻录: