What is the best way to update an MSI installation over the internet?

天大地大妈咪最大 提交于 2019-12-18 11:52:47

问题


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.


回答1:


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. :)




回答2:


You can use the msiexec utility. Here you can find an example.




回答3:


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.




回答4:


Here is what I would usually do (its just a concept of how I update my program):

  • Use Advanced Installer Or any other MSI installer/packer supports Command 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...




回答5:


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.



来源:https://stackoverflow.com/questions/9174515/what-is-the-best-way-to-update-an-msi-installation-over-the-internet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!