通过 Internet 更新 MSI 安装的最佳方式是什么?
通过 Internet 更新 MSI 安装的最佳方式是什么?
ClickOnce 不支持 MSI。
我需要通过 Internet 自动进行更新,就像 Windows 更新一样。
理想情况下,我希望我的应用程序能够自动检测是否有可用更新并下载并安装。
答案应该只涉及 MSI 安装。我不介意是否需要安装 Windows 服务来监视更新。
What is the best way to update an MSI installation over the internet?
ClickOnce doesn't support MSIs.
I need the update to occur automatically over the internet, in the same manner as Windows updates occur.
Ideally, I would want my application to automatically detect that an update is available and download it and install it.
Answers should only deal with MSIs installations. I don't mind if there needs to be a Windows Service installed to monitor for updates.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
以下是我最近为客户所做的事情:
UI 以登录用户身份运行。
该服务作为系统运行。该服务检查内容并将其下载到临时目录。然后它使用 /JM 命令通告 MSI。现在,非特权用户可以安装安装程序。
该服务向应用程序发送 IPC 消息,表示安装时间到了。应用程序启动安装程序,并向其传递一个指示重新启动应用程序的标志。应用程序退出释放锁定的文件。
在安装程序结束时,该标志会导致安装程序重新启动应用程序。
另请查看 wuw4 库。它有助于创建很多此解决方案。
这是一个复杂的模式,但效果很好。我拥有一家可以帮助您制定此解决方案的公司。 :)
Here's what I've done for a customer recently:
The UI is running as the logged on User.
The service is running as System. The service checks for content and downloads it to a temp directory. It then advertises the MSI using the /JM command. The installer can now be installed by the non-priviledged user.
The service sends an IPC message to the application saying that it's time to install. The application kicks off the installer passing it a flag that indicates to restart the application. The application the quits releasing the locked files.
At the end of the installer the flag causes the installer to relaunch the application.
Also take a look at the wuw4 library. It helps in creating a lot of this solution.
This is a complex pattern but works very well. I own a company that can assist you in making this solution. :)
您可以使用 msiexec 实用程序。 在这里您可以找个例子。
You can use the msiexec utility. Here you can find an example.
Windows Installer 不支持自动更新,也不会处理更新的交付。我工作的公司销售一款针对更新及更多内容的产品。
Windows Installer does not support automatic updates, nor will it handle their delivery. The company for which I work sells a product targeting updates and more.
这是我通常会做的事情(这只是我如何更新程序的概念):
使用
高级安装程序
或任何其他MSI安装程序/打包程序
支持命令行
来打包更新程序的文件。您需要正确设置参数并进行测试,然后才能继续下一步。转到
Visual Studio
->选择您的项目然后 ->属性->构建事件。在“
构建后事件命令行
”文本框中输入您之前创建的命令行参数,然后单击“确定”。现在,每当您构建项目时,Visual Studio 都会自动使用 MSI 安装程序/打包程序打包您的文件。
最后一步是寻找也可以从命令行运行的
FTP 客户端
。设置正确的参数并将其添加到上一个参数之后的“构建后事件”中。
现在,如果您再次使用 Visual Studio 构建项目。您的文件将自动打包然后上传到您的服务器。
现在您的文件应该在服务器上完全更新,您无需再担心这一点。这是我找到的最好的解决方案,我正在使用它,它的工作方式就像一个魅力...
编辑:还有一件事,您还可以添加一个简单的例程来在服务器上查找更新在你的程序里面。例如检查文件的 MD5 哈希值或文件版本等。一旦例程发现新的更新,它应该提示用户,然后您可以告诉用户下载最新的更新等...
Here is what I would usually do (its just a concept of how I update my program):
Use
Advanced Installer
Or any otherMSI installer/packer
supportsCommand Line
to pack the files of your updated program. You need to set the parameters correctly and test it before you proceed to next step.Go to
Visual Studio
-> select your project then -> properties -> Build Events.In "
Post-Build event command line
" textbox enter the command line parameters you created earlier then click ok.Now whenever you build your project, visual studio will automatically pack your files with MSI installer/packer.
Last step is to look for
FTP Client
works from command line also.Set the correct parameters and add it to "Post-Build event" after the previous one.
Now if you build your project with visual studio again. Your files will be automatically packed then uploaded to your server.
Now your files should be fully updated on the server and you don't need to worry about that anymore. That's the best solution I've found, I'm using it and it works like a charm...
EDIT: one more thing, you can also add a simple routine to look for newer updates on server inside your program. something like checking the MD5 hash of the files or the files versions etc. once the routine finds a new update it should prompt that to the user and then you can tell the user to download the latest update etc...
您检查了应用程序虚拟化吗?
http://www.microsoft.com /en-us/windows/enterprise/products-and-technologies/virtualization/default.aspx
这是将可执行文件/msi 流式传输到客户端的好方法,同时确保它始终运行最新版本微星。
Did you check App-Virtualization?
http://www.microsoft.com/en-us/windows/enterprise/products-and-technologies/virtualization/default.aspx
This is a great way to stream your executables/msi to the clients while ensuring it always runs the latest msi.