如何在命令行上将 MSM 文件转换为 MSI 文件?使用 Windows Installer SDK 或 COM 执行此操作 [英] How to convert an MSM file into an MSI file on the command line? Doing this with the Windows Installer SDK, or COM

查看:44
本文介绍了如何在命令行上将 MSM 文件转换为 MSI 文件?使用 Windows Installer SDK 或 COM 执行此操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个来自第三方工具的 MSM 文件.我们使用一个小脚本自定义 MSM,并且此工具已集成到我们的安装程序中并且运行良好.所有修改均使用 VBscript 使用 COM 和WindowsInstaller.Installer"完成

I have a MSM file from a third party tool. We customize the MSM with a small script and this tool is integrated into our installer and works fine. All modification is done with VBscript using COM and "WindowsInstaller.Installer"

但有时我们的支持人员只需要这个工具作为独立的安装程序包.

But sometimes our support needs just this tool as standalone installer package.

是否有一种简单的方法可以在命令行上将 MSM 文件转换为完整的安装程序 MSI 包?

Is there a simple way to convert a MSM file into and full installer MSI package on the command line?

使用 VBscript 或带有WindowsInstaller.Installer"的 COM 模块是可以的.知道如何转换它的方法,我还会编写一个小的 C++ 程序来执行更改并设置适当的信息和转换.

Using VBscript or the COM Module with the "WindowsInstaller.Installer" is OK. Knowing the way how to to convert it, I would also write a small C++ program doing performing the changes and setting the appropriate information and conversion.

我需要通过命令行将 MSM 转换集成到我们的构建过程中.

I need to command line to, to integrate the MSM conversion into our build process.

我搜索并发现的内容:

我在 SDK 中看到了一些工具,如 ORCA 和其他 MSI 工具,但没有一个能满足我的需求.ORCA 可以将 MSM 保存为 MSI 文件,但我在命令行上看不到执行此操作的选项.

I saw some tools like ORCA and other MSI tools in the SDK, but none of some are doing what I need. ORCA can save an MSM as a MSI file but I can't see options doing this on the command line.

注意:我找到了一个旧工具 msm2msi,但它不适用于我的 MSM 文件并崩溃,并且没有可用的源.

Note: I found an old tool msm2msi, but it doesn't work with my MSM file and crashes, and there is no source available.

编辑关于我们应用的更改:

改变的原因很简单.第三方模块有一个所谓的服务器模式",通常它只在一台机器上使用,但 MSM 为每台机器启用它.因此 wie 决定在更改属性时禁用它.还有一些变化.

The reasons for the change are simple. The thirdparty module has a "so called server mode" usually it is only used on 1 machine, but the MSM enables it for every machine. So wie decided to disable it, in changing a property. And some more changes.

所以更多的是关于主安装.当更新到来时,此设置永远不会被触及.

So it is more about the primary installation. When an update comes, this settings are never touched.

此外,MSM 还安装了我们不想要和不需要的自己的 UI.所有控制都是通过我们的软件完成的...所以我们安装了组件,但我们删除了开始文件夹中的菜单项.

Also the MSM installs its own UI, that we don't want and need. All controlling is done through our software... So we install the components but we remove that menu entries in the Start folder.

推荐答案

Transforms &msiexec.exe:根据您更新的信息,我想说您可以通过使用转换或什至通过安装命令行设置属性来解决所有这些问题.

Transforms & msiexec.exe: With your updated information I would say that you can solve all of this by using a transform, or possibly even by setting a property via the installation command line.

转换允许您更改 MSI/MSM 中的任何内容"(它们是在运行时应用于更改 MSI/MSM 的小数据库片段),设置 PUBLIC PROPERTY(始终大写)允许您影响该属性的设计影响.所以后者是供应商添加和支持的 MSI/MSM 的轻量级"定制,这在可用时很好,但根据我的经验很少足够(典型用途是添加许可证密钥或服务器 IP 或 URL 或安装只是 MSI 的一部分 - 一些功能 - 诸如此类的简单内容).

Transforms allow you to change "anything" in an MSI / MSM (they are little database fragments applied at runtime to change the MSI / MSM), setting a PUBLIC PROPERTY (always uppercase) allows you to affect whatever that property is designed to affect. So the latter is a "light weight" customization of the MSI / MSM added and supported by the vendor, that is great when available but in my experience rarely sufficient (typical use is to add a license key or a server IP or URL or install only part of the MSI - a few features - simple stuff like that).

描述如何使用 transformsmsiexec.exe 命令行来自定义 可以在此处找到 MSI 安装:

Descriptions of how to use transforms or the msiexec.exe command line to customize an MSI installation can be found here:

  • How to make better use of MSI files (elaborate)
  • How to run an installation in /silent mode with adjusted settings (short form - section "MSI - Customize Standard Package")

GUI:当 MSM安装在自己的 GUI 中"时,我真的不明白您指的是什么?希望这只是从开始菜单启动可执行文件的快捷方式?如果是这样,您可以使用转换轻松删除它.

GUI: I really don't understand what you refer to when the MSM "installs in its own GUI"? Hopefully this is just a shortcut to launch an executable from the start menu? If so you can easily remove it using a transform.

创建转换:您可以使用 Orca(MS SDK 工具)或任何其他 MSI 部署工具,或者您可以使用 MSI API (Win32、COM、.NET).

Create Transform: You can create transforms using Orca (MS SDK tool) or any other MSI Deployment Tool, or you can create it programatically using the MSI API (Win32, COM, .NET).

  • COM Automation: The Microsoft MSI SDK contains a VBScript called WiGenXfm.vbs. You will have it installed if you got Visual Studio installed. You could also find it on github.com (but get it from your own disk to be sure).

DTF/.NET 是 WiX 的一个组件,它允许您通过托管代码访问 MSI API.互操作已为您完成.此处示例.

DTF / .NET is a component of WiX which allows you to access the MSI API via managed code. The interop is done for you. Sample here.

C++/Win32:和深入到金属的 Win32(不接受替代 - 层已经消失:-)).

C++ / Win32: And down-to-the-metal Win32 (accept no substitute - layers be gone :-)).

注意:DTF 是作为 WiX 工具包 的一部分安装的.能够构建 MSI 文件的开源工具包(快速入门建议).安装后,在 %ProgramFiles (x86)% 下的 WiX 安装文件夹中找到 dll.子文件夹bin".此处为文件说明.最后,我将DTF 的快速示例从 MSI 文件中获取一些属性.

Note: DTF is installed as part of the WiX toolkit. The open source toolkit capable of building MSI files (quick start suggestions). After installation find the dll's in the WiX installation folder under %ProgramFiles (x86)%. Sub folder "bin". File descriptions here. And I will end with a quick sample of DTF in action getting some properties from an MSI file.

这篇关于如何在命令行上将 MSM 文件转换为 MSI 文件?使用 Windows Installer SDK 或 COM 执行此操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆