如何创建一个简单地将目录复制到 Program Files 的 MSI 文件? [英] How to create a MSI file which simply copies a directory to Program Files?
问题描述
我想创建一个 MSI 文件,它只是将一个目录复制到Program Files"目录中并在开始菜单中创建一个图标.
I want to create a MSI file, which simply copies a directory into the "Program Files" directory and creates an icon in the start menu.
仅此而已.对用户没有任何问题,没有依赖关系,没有注册表项等.只需复制目录并设置图标即可.
Nothing more. No questions to the user, no dependencies, no registry entries, etc. Just copy the directory and set the icon.
如果我们部署一个新版本的程序,那么 MSI 应该只是将新版本复制到旧版本上.没有卸载"过程.
And if we deploy a new version of our program, then the MSI should just copy the new one over the old one. No "uninstalling" procedure.
该任务使用哪种工具?
推荐答案
我想答案是任何通用工具,因为他们都可以做到这一点.这是一个(可以说是)最常用工具的列表.
I guess the answer is any common tool, since they can all do this. Here is a list of (arguably) the most common tools.
- Visual Studio 安装程序项目(2017) 使用起来非常简单 - 一开始 - 然后你会面临一些你可能不会遇到的限制和缺点易受 - 鉴于您的范围.据我所知,无法在构建过程中实现自动化!
- Advanced Installer 是一种商业产品,它具有
一些免费功能
,您可以使用它们来满足您的需求.你可以试一试.这是一个很好的网关
高级安装程序. - WiX 能够完成您想做的事情,而且完全免费.需要一段时间才能适应.WiX 你好世界(有点旧和过时,但您会看到图片 - 编译为 MSI 格式的 XML 标记).出于某种原因,我在 WiX 快速入门上的这个凌乱答案 的投票率比平时高(答案现在更新 - 很小).也许略读一下.
- The Visual Studio Installer Projects (2017) are pretty simple to use - at first - and then you face a number of limitations and shortcomings that you might not be susceptible to - given your scope. Can not be automated in a build process as far as I know!
- Advanced Installer is a commercial product and it has
some free features
that you can use for requirements such as yours. You could give it a test spin.Here is a great gateway
to all things Advanced Installer. - WiX is capable of what you want to do, and entirely free. Takes a while to get used to. The Hello World of WiX (a little old and dated, but you get the picture - XML markup that is compiled to MSI format). For some reason, this messy answer of mine on WiX Quick Start has been upvoted more than usual (answer updated now - was small). Maybe skim it.
有关直接下载链接,请参阅顶部的链接答案.
See linked answer on top for direct download links.
静默安装:任何 MSI 文件都可以通过标准的 msiexec.exe
静默运行(无需 GUI) 命令行:
Silent Install: Any MSI file can be run silently (without a GUI) by means of a standard msiexec.exe
command line:
msiexec.exe /I "C:\Your.msi" /QN /L*V "C:\msilog.log"
参数快速说明:
/I = run install sequence
/QN = run completely silently
/L*V "C:\msilog.log" = verbose logging at specified path
这篇关于如何创建一个简单地将目录复制到 Program Files 的 MSI 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!