如何使用setup for instalation更新c#应用程序 [英] how to update c# application using setup for instalation

查看:97
本文介绍了如何使用setup for instalation更新c#应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人

我有项目,我想在我的客户机器上更新它的形式和数据库发生了某种变化。我怎样才能做到这一点 ?用于制作安装文件我使用vs安装和部署

解决方案

问题太笼统了。但是,在大多数情况下,最好使用不同的MSI包创建新版本的软件。应该卸载旧版本(旧的MSI包的副本总是存储并从安装数据库中引用),然后安装新版本。



问题是要决定如何处理应用程序数据。保留旧安装中的所有数据变得流行:在每个用户帐户和/或所有用户配置的一个或多个目录中。但是,我认为安装得非常好应该允许用户在卸载过程中选择完全删除这些数据。现在的安装程序已经太晚了,但是在开发新的安装版本时你可以考虑一下。



此外,技术细节完全取决于安装工具包你使用。







如果这个简单的方法不能满足你的一个或另一个原因,一种替代方案是合并模块。请阅读它们:

http://en.wikipedia.org/wiki/Merge_Module [ ^ ],

http://msdn.microsoft.com/en-us/library /windows/desktop/aa369820%28v=vs.85%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/aa369820%28v=vs.85%29.aspx [ ^ ]。



参见: http://msdn.microsoft.com/en-us/library/y0w2est5%28v=vs。 80%29.aspx [ ^ ]。



我提到具体的技术细节取决于您为安装项目使用的工具包。我想强调:它应该更好地基于Windows Installer API,而不是其他任何东西。您可以学习原始Windows Installer以便更好地理解:

http://en.wikipedia.org/ wiki / Windows_Installer [ ^ ],

http://msdn.microsoft.com/en-us/ library / cc185688%28VS.85%29.aspx [ ^ ]。



-SA


< blockquote>

george4986问:

嗨SA

我在客户端机器上开发了类似的更新exe版本的应用程序。我们正在使用Windows窗体和Web服务来连接实时(数据库)数据库。

。每次安装时我都会将版本与msi文件一起保存在客户端机器中。当新版本发布时,我们会更新在实时数据库的表中的版本值,并在主机上放置新的msi文件(3层应用程序)。每个登录时间应用程序exe检查带有客户端版本的实时表版本,并向用户提供有关新版本的信息消息。用户需要运行updater exe用于更新。在运行updater应用程序时,它使用存储在客户机中的旧msi版本卸载以前的版本(字符串arg =/ x \C:\\OldApplication.msi \/ qn;),下载&安装新的exe(字符串arg1 =/ i \C:\\ Application \\ msi \/ qn;)。updator应用程序正在运行。感谢SA在阅读此邮件时的耐心等待。是否有可能使它成为单个应用程序,而不是在我的情况下使用两个exe(更新程序,应用程序)?。如果我以错误的方式完成它,请启发我。等待您的宝贵建议。谢谢提前
------------------乔治--------------

我不推荐它。



让我们看看。原则上,这是可能的。但是......



首先,updater将取代一些PE文件。但是在加载执行时不可能删除PE文件。因此,您需要保存一些临时更新的应用程序,终止您的应用程序,运行该临时更新程序,然后重新启动您的应用程序。然后,您将需要删除该临时更新程序。



更糟糕的是:通常安装过程需要权限提升,而应用程序通常在没有提升的情况下运行。因此,在这种情况下,您需要终止应用程序,以管理员身份重新启动它,执行更新,然后再次启动应用程序。如你所见,它会破坏合并应用程序和安装程序/更新程序的目的。



另外,你不打破系统安装数据库的完整性吗?修改一些没有反映在这个数据库中的东西很容易,但它会破坏用户回溯步骤的能力。



真的,保持这个更好应用程序及其安装程序/更新程序单独使用。



考虑不同的事情:根本不使用安装。这些被称为应用程序的便携式版本。最后,甚至微软也开始鼓励这样的事情。如果您只是将应用程序复制到某个目录,则可以立即使用它。当然,如果您需要更新注册表或类似的东西,您仍然需要安装。另一种选择是让用户在便携式和安装版本之间进行选择。这只是批评性的评论。



-SA


Hi every one
i have project that i want to update it on my customer machine some sort of changes in forms and database happened . how can i do that ? for making install file i use vs setup and deployment

解决方案

The question is too general. But, in most cases, it's the best to create a new version of software with different MSI package. Old version should be uninstalled (a copy of old MSI package is always stored and referenced from the installation database), and then new version installed.

The problem is to decide what to do with application data. It became popular to preserve all that data from old installation where it was: in one or more of the directories configured per each user account and/or all user. However, I think that a really good installed should allow the user to choose complete wipe-out of this data during uninstallation. It's too late to do to your existing installer, but you can think about it when you develop the new installation version.

Further, technical detail totally depend on what installation toolkit you use.

[EDIT]

If this simple approach cannot satisfy you by one or another reason, one alternative would be Merge Modules. Please read about them:
http://en.wikipedia.org/wiki/Merge_Module[^],
http://msdn.microsoft.com/en-us/library/windows/desktop/aa369820%28v=vs.85%29.aspx[^],
http://msdn.microsoft.com/en-us/library/aa369820%28v=vs.85%29.aspx[^].

See also: http://msdn.microsoft.com/en-us/library/y0w2est5%28v=vs.80%29.aspx[^].

I mentioned that concrete technical detail depends on what toolkit do you use for your setup project. I would like to emphasize: it should better be based on Windows Installer API, not anything else. You can learn "raw" Windows Installer for better understanding:
http://en.wikipedia.org/wiki/Windows_Installer[^],
http://msdn.microsoft.com/en-us/library/cc185688%28VS.85%29.aspx[^].

—SA


george4986 asked:

hi SA
I have developed a similar application for update exe versions in client machines.we are using windows forms along with web service for connecting live (Database)DB.
.On each installation i save the version in client machine along with msi file.when a new version is released ,we update the version value in a table on live DB and place new msi file on hosting machine(3 tier application).each login time application exe check the live table version with clients version and give user an info msg about new version .User needs to run updater exe for updation.while running updater application it uninstalls previous version using the old msi version stored in client machine ( string arg = "/x \"C:\\OldApplication.msi\"/qn";) , download & installs new exe( string arg1 = "/i \"C:\\Application.msi\"/qn";).updator application is working. Thanks SA for ur patience in reading this message . Is it possible to make it a single application instead of using Two exe's (updator, application) in my case?.If i have done it in a wrong way , plz enlighten me.Waiting for ur valuable suggestions.Thanks in Advance
------------------George--------------

I would not recommend it.

Let's see. In principle, this is possible. But…

First of all, updater will replace some PE files. But it is impossible to remove a PE file when it is loaded for execution. Therefore, you would need to save some temporary updated application, terminate your application, run that temporary updater, and then restart your application. Then you will need to remove that temporary updater.

Worse thing is: it is typical that installation process needs privilege elevation, while the application is typically run without elevation. So, in this case you would need to terminate the application, restart it "As Administrator", do the update and then start application again. As you see, it would defeat the purpose of merging of application and installer/updater.

Also, don't you break the integrity of your system's installation database? It's easy to modify something which is not reflected in this database, but it would break the users' ability to retrace their steps.

Really, it's much better to keep the application and its installer/updater separately.

Consider different thing: not using installation at all. This is called "portable" version of the application these days. At last, even Microsoft started to encourage such things. If you just copy your application to some directory, it can be used immediately. Of course, you if need to update the registry or something like that, you will still need the installation. Another option is to give the user the choice between "portable" and "installation" versions. This is just something to review critically.

—SA


这篇关于如何使用setup for instalation更新c#应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆