问题描述
如果我要进行静默安装,是否有任何简单的方法可以运行安装程序,选择所需的选项,然后确定等效安装所必需的msiexec选项/开关? (最好不要实际安装任何东西-不要单击完成")
If I want a silent install, is there any simple way of running the installer, selecting the desired options and then determining the msiexec options/switches necessary for an equivalent installation? (Preferably without actually installing anything - not clicking finish)
还是正在挖掘MSI数据库以找到所需的属性?
Or is digging through the MSI database all you can do to find the desired properties?
推荐答案
日志文件命令行 :只是想到了另一个选项.如果您记录了MSI安装,则可以搜索 条目CommandLine
的结果日志文件,并查看 运行安装程序的命令行实际上是(链接相关 便于检索的答案). 记录您的安装:msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log
(记录详细信息).日志 文件还应枚举在安装过程中在设置中设置的所有属性值 安装-但这在日志中的其他位置(CommandLine
条目仅显示指定的命令行).不能保证此命令行始终正确,但可以旋转一下吗?
Log File CommandLine: Just thought of another option. If you log your MSI install, then you can search the resultant log file for the entry CommandLine
and see what the command line the setup is running with actually is (linking a related answer for easy retrieval). Log your install: msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log
(logging details). The log file should also enumerate all property values set in the setup during installation - but that is elsewhere in the log (the CommandLine
entry shows only the command line specified). No guarantees that this command line is always correct, but give it a spin?
转换生成工具 :几种商业工具提供了一些小的组件,这些组件允许在运行期间捕获MSI GUI设置. 空转"-这似乎是您要问的内容(我 尝试使答案对其他人也通用并且有用-如果抱歉 这使事情变得混乱).请查看此答案以获取详细信息: 生成Mst响应工具 . 我不认为这些是可再分配的,所以您不能将它们交付给 您的客户.您可以询问供应商是否允许重新分配 尽管?如果您愿意-请告诉我们?我没有示例代码 不幸的是,您可以使用自己的工具.可能有 在github上的东西.不是火箭科学,但一切都需要时间.
Transform Generation Tools: Several commercial tools provide small components that allow the capture of MSI GUI settings during "dry runs" - which seems to be the core of what you ask (I try to make answers generic and useful for others as well - sorry if that confuses things). Please see this answer for details: Generate Mst response tool. I don't think these are re-distributable, so you can't deliver them to your customer. You could ask the vendors if they allow re-distribution though? If you do - let us know? I do not have sample code to allow you to roll your own tool - unfortunately. There could be something on github. Not rocket science, but everything takes time.
自定义静默安装
似乎您只是想在多台计算机上复制同一安装? (合并由专业人士完成的大规模部署).还是要允许用户使用通用工具或方法来帮助配置安装? (通常针对任何最终用户进行设置自定义).我将编写一个通用概述,希望能同时回答这两个问题.部署专家通常知道该怎么做,他们需要知道该做什么不-您的设置有何不寻常之处-如果有的话.
Customizing Silent Install
It seems you simply want to replicate the same install on many computers? (corporate large scale deployment done by pros). Or do you want to allow your users a generic tool or approach to help configure your install? (setup customization in general for any end user). I'll write up a generic overview hoping to answer both. The deployment pros generally know what to do, they need to know what not to do - what is unusual about your setup - if anything at all.
您可以通过多种方式自定义MSI安装,但是最常见的方式是使用批处理文件/命令行参数或转换文件-通常将两者结合使用.以下答案更详细地描述了这两种方法: .从理论上讲,您也可以通过编程方式调用安装程序-例如,使用 MSI API ( COM自动化)-很少这样做. MSI API和Win32,COM和DTF/.NET .
You can customize an MSI installation in several ways, but the most common ways are to use batch files / command line paramenters or transform files - often combining both. The following answer describes these two approaches in more detail: How to make better use of MSI files. In theory you could invoke the install programmatically as well - for example using MSI API (COM automation) - which is rarely done. MSI API and Win32, COM and DTF / .NET.
基于以上两种主要方法或机制,我想我们可以列出一些最终用户进行设置自定义的实际选项-是否部署专家.
Based on the above two main approaches or mechanism, I suppose we can list a few real-world options for setup customization by end users - deployment pros or not.
以下几种方法可以成功结合使用-因此,您已设置了默认的批处理文件以安装默认的转换文件,并且拥有了一个PDF文档,其中解释了正常的安装参数和其他选项-以及其他内容那不应该做.最终用户会调整默认的转换文件(许可证密钥,连接字符串,URL,快捷方式位置,要安装和不安装的功能等)...
Several of the below approaches can be combined with success - so you have a default batch file set to install a default transform file and you have a PDF document explaining normal installation parameters and further options - and things that should not be done. The default transform file is tweaked by the end user (license key, connection strings, URLs, shortcut locations, what features to install and not, etc...)
标准转换 :我想您可以提供一个包含默认设置的标准转换文件*.mst
?但是,为什么不将这些设置作为直接安装的默认设置呢?也许您想要针对不同区域的不同设置?您可以针对不同目的提供几种标准转换.
Standard Transform: I suppose you could deliver a standard transform file *.mst
which contains your default settings? But why not make those settings the default for the install outright? Perhaps you want different settings for different regions? You could deliver several standard transforms for different purposes.
批处理文件 :您可以创建一堆具有不同默认"设置的批处理文件,并让用户使用所需的批处理文件吗?具有有关设置内容的内联信息(例如许可证密钥等),您可以使用仅设置PUBLIC属性值的批处理文件,也可以将批处理文件与上述标准转换一起使用.转换是重量级的自定义,属性是轻量级的自定义.
Batch Files: You could create a bunch of batch files with different "default" settings and let the user use the one they need? With inline information on what to set - for example license keys, etc... You can use a batch file that sets only PUBLIC property values, or you could use a batch file along with the standard transform mentioned above. Transforms are heavy-weight customizations, properties are light way customizations.
:我从未见过完成,但是我想您可以在管理安装序列中执行自定义操作,该操作将生成具有您所拥有参数的批处理文件设置,甚至生成具有相同设置的转换文件?管理员安装不会显示您的常规MSI GUI,因此,您必须为管理安装GUI序列创建一个设置生成器GUI"(常规安装,管理安装有单独的GUI序列),这使得您的工作量倍增.和广告安装).还提到了 AdminProperties属性概念-坦率地说,我不确定它是如何工作的.我没用过.
Administrative Installation: I have never seen it done, but I suppose you could have a custom action in the administrative install sequence that would generate a batch file with the parameters you have set, or even generate a transform file with the same settings? The administrative installation does not show your regular MSI GUI though - so this sort of makes it a double effort as you have to create a "settings generator GUI" for your administative installation GUI sequence (there are separate GUI sequences for regular install, admin install and advertised install). also mentioning the AdminProperties property concept - I am frankly unsure how it works. I have never used it.
一页PDF :我的首选方法是提供称为Large Scale Deployment Guide.pdf
(或静默部署"或类似内容)的一页PDF文档.它最大程度地描述了可用的不同安装选项及其含义.还有什么不该做.显示了几个示例命令行.专业人士会在几秒钟内知道该怎么办. 列出完整的运行时要求!(先决条件,运行时).解释不做什么(" ...不要禁用这些自定义操作,这就是为什么... ").
One Page PDF: My preferred approach is to provide a one-page PDF document called Large Scale Deployment Guide.pdf
(or "Silent Deployment" or similar). It describes with maximum minimalness the different installation options available and what they mean. And what not to do. Several sample command lines are shown. Pros will understand what to do in seconds. List full runtime requirements! (prerequisities, runtimes). Explain what not to do ("...don't disable these custom actions, and here is why...").
某些链接 :
Some Links:
这篇关于运行.msi安装程序后能否确定结果命令行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!