在旧版本上安装新版本的部署项目
我有一个部署项目,不允许我安装旧版本。 msi 文件表示首先从“添加/删除程序”中卸载该程序。这不是一个好的用户体验。我怎样才能让安装程序先删除软件然后安装新版本?
I have a deployment project which will not let me install over an older version. The msi file says to uninstall the program first from Add/Remove programs. This is not a good user experience. How can I do it so that the installer will simply remove the software first and then install the new version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这很棘手,您必须执行以下步骤,
如果您没有正确执行第三步,安装程序仍将安装并保留旧文件,如果您更改了内容,则每个文件的文件版本都必须是新的。
This is tricky, you have to do following steps,
If you do not do 3rd step correctly, installer will still install and keep the old file, your file version of every file must be new if you have changed your content.
我尝试了一些场景,也许这会帮助某人节省一些时间
如果程序集版本发生变化并且项目安装程序版本发生变化(ProductCode Guid 也发生变化)
->应用程序安装在现有应用程序的基础上
-> dll 和 exe 版本得到更新
->如果安装路径不同,现有的初始安装项目文件将从安装位置删除。 (以及此后保留的文件)
如果程序集版本更改并且项目安装程序版本更改(没有更改 ProductCode Guid)
->要求用户手动删除该应用程序
->如果他们继续并首先从控制面板中删除,则可以安装应用程序,并将 dll 和 exe 更新到新版本
如果仅程序集版本更改,或仅项目安装程序版本更改(不更改 ProductCode Guid)
->要求用户手动删除该应用程序
->如果他们继续并首先从控制面板中删除,则可以安装应用程序,并将 dll 和 exe 更新到新版本
如果仅项目安装程序版本发生变化(产品代码 Guid 也发生变化)
-> MSI 完成安装过程,但 dll 和 exe 不会更改版本 - 它们按照程序集版本,并被替换为相同程序集构建版本的文件
->如果安装路径不同,现有的初始安装项目文件将从安装位置删除。 (此后保留的任何文件)
如果项目安装程序版本发生变化(ProductCode Guid 也发生变化)并且程序集版本低于已安装版本
->安装将开始,最终用户被告知安装失败,因为旧版本。
I tried out a few scenarios, maybe this will help someone save some time
If Assembly Version changes AND project installer version changes (with ProductCode Guid changing also)
-> App installs over the top of existing one
-> dlls and exe versions get updated
-> IF path installed to is different, existing initially installed project files are deleted from where they were installed. (and files made since remain)
If Assembly Version changes AND project installer version changes (without ProductCode Guid changing)
-> User is asked to manually remove the application
-> if they go ahead and remove from control panel first, app can then be installed and the dlls and exes get updated to the new version
If ONLY Assembly Version changes, or only project installer version changes (without ProductCode Guid changing)
-> User is asked to manually remove the application
-> if they go ahead and remove from control panel first, app can then be installed and the dlls and exes get updated to the new version
If ONLY project installer version changes (with ProductCode Guid changing also)
-> MSI goes through install process, but dlls and exe do not change version -they are as per assembly version, and are replaced with files of same assembly build version
-> IF path installed to is different, existing initially installed project files are deleted from where they were installed. (any files made since remain)
If project installer version changes (with ProductCode Guid changing also) and assembly version is lower than installed version
-> Installation will commence, at the end user is informed install fails as old version.
设置安装项目属性 RemovePreviousVersions True
但您必须在两个安装应用程序中使用相同的 UpgradeCode
Set setup project property RemovePreviousVersions True
But you have to use same UpgradeCode in both setup applications
有时您可以在安装新版本后执行此操作,旧产品将保持不变。
您需要更改RemoveExistingProducts的序列号,它必须安排在
安装验证操作和 InstallInitialize 。您可以通过 ORCA
For Ex InstallValidate=1400 来 完成此操作
InstallInitialize =1500
然后删除ExistingProducts =1450
You can do this sometimes after installing new version the old product will remain same.
You need to change the sequence number of RemoveExistingProducts ,It must schedule between
Install Validate action and InstallInitialize . You can do this by ORCA
For Ex InstallValidate=1400
InstallInitialize =1500
Then RemoveExistingProducts =1450
如果您使用的是Visual Studio 2012或更高版本,
2.打开项目助手后,您会看到应用程序信息,在这里您可以输入要更改的版本。
If you are using visual studio 2012 or upper version ,
2.Once you open Project assistant you see the Application Information ,here you can enter the version you want to change it.