如何制作一个以静默方式下载并安装先决条件的安装程序?
我必须为 Word 的 C# 插件制作一个相当复杂的安装程序。我已经研究了近两天了,但我仍然没有找到可以完成所需的一切的东西。
这里的主要问题是由于先决条件的限制。它们不得包含在主安装程序中,以使其较小,因此必须下载它们。 此外,它们必须以静默方式安装,而不打扰用户。显示进度条或类似的东西是可以的,但不需要用户输入。
在阅读了 Windows Installer、Inno、引导程序包和 dotNetInstaller 后,我终于得出结论:后者最适合此范围。然而,有一个令人讨厌的缺点我尚未解决:先决条件检查。
是否有标准方法来检查是否安装了 Microsoft 可再发行组件?该加载项需要以下组件:
- Windows Installer 3.1
- .Net Framework 3.5
- PIA
- VSTO
此外,我无法找到这些组件的直接 URL。我想知道 VS 中的 Windows 设置如何获取它们。
作为最后的手段,我可以将他们安置在某个已知的位置,但我想避免这种情况。
I have to make a rather complex installer for a C# add-in for Word. I've been researching this for almost two days now and I still haven't found something that can do everything needed.
The main issue here is due to the constraints regarding prerequisites. They mustn't be included in the main installer to keep it small so they'll have to be downloaded.
Additionally, they have to be installed silently without bothering the user. It is ok to show a progress bar or something similar but nothing that requires user input.
After reading about the Windows Installer, Inno, bootstrapper packages and dotNetInstaller I have finally reached the conclusion that the later would be best suited for this scope. However, there's a nasty downside which I have yet to resolve: prerequisites checking.
Is there a standard way to check whether a Microsoft redistributable is installed? The add-in needs the following components:
- Windows Installer 3.1
- .Net Framework 3.5
- PIA
- VSTO
Furthermore, I haven't been able to find the direct URLs for these components. I'm wondering how Windows Setups in VS get them.
As a last resort I could host them somewhere to have them at a known location but I'd like to avoid that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用 Visual Studio 安装项目,则可以将它们嵌入到安装程序中,并使它们成为安装应用程序所必需的。
至少对于 Windows Installer 3.1 和 .NET Framework 3.5 SP1 而言
检查注册表是一种快速方法。
If your using the Visual Studio Setup Project, you can embed them into the setup, and make them required for your application to be installed.
At least for the case of Windows Installer 3.1 and .NET Framework 3.5 SP1
Checking the registry is a quick way.
我会首先提示用户有关下载的信息,因为如果未经用户同意而秘密下载文件,将会引起轩然大波。如果不安全,它也可能被用于恶意目的。
I would first prompt the user about the downloads first because there would be an uproar if it secretly downloaded files without the users consent. It could also be used for malicious reasons if it were unsecure.
使用此工具 http://www.advancedinstaller.com/ 创建安装程序项目,它具有简单的 ui 界面您可以轻松处理许多复杂的场景。您可以购买该工具或可以使用免费软件版本
use this tool http://www.advancedinstaller.com/ for creating installer project it has the simple ui interface using which u can handel many comple scenarios in an easy way. U can purchase the tool or can use freeware edition