如何使用Visual Studio Installer管理WPF应用程序的更新

时间:2022-08-25 07:02:18

I have WPF application who is possible to update when is have new version. For create installer I will use Visual Studio Installer. I understand how to auto update my app, but this is not exactly what I want.

我有WPF应用程序,可以在有新版本时更新。对于create installer,我将使用Visual Studio Installer。我了解如何自动更新我的应用,但这不是我想要的。

I want when user check is want to "Automatically check for updates" only then is check do is have new updates. Like in the picture

我希望当用户检查想要“自动检查更新”时才检查是否有新的更新。就像在图片中一样

如何使用Visual Studio Installer管理WPF应用程序的更新

My question is: Is it possible with Visual Studio Installer to manage update for application. When user is checked then if is possible to update to new version. If user not checked then the application is not check for new version.

我的问题是:Visual Studio Installer是否可以管理应用程序的更新。选中用户后,是否可以更新到新版本。如果用户未选中,则应用程序不检查新版本。

Im sorry for my bad English. Thanks in advice.

对不起,我的英语不好。谢谢你的建议。

1 个解决方案

#1


0  

It's not very clear whether you want that checkbox in the installer itself or in the app. All the instances I've seen are in the app. There's no point in putting the check in the installer because the user does that just once, and updates may be generated after the product has been installed. You cannot run the same install again! So this check is added to the app, and the implementations I've built do a web service call to the company web site (passing in the installed product's version, ProductCode, UpgradeCode) and if there is an update the app downloads it. The user may or may not be able to install the upgrade if it requires elevated privilege and the user has limited privileges.

您是否想在安装程序本身或应用程序中使用该复选框并不是很清楚。我见过的所有实例都在应用程序中。将检查放入安装程序是没有意义的,因为用户只执行一次,并且可能在安装产品后生成更新。您无法再次运行相同的安装!因此,此检查已添加到应用程序中,我构建的实现会对公司网站进行Web服务调用(传递已安装产品的版本,ProductCode,UpgradeCode),如果有更新,应用程序会下载它。如果用户需要提升的权限且用户具有有限的权限,则用户可能会或可能无法安装升级。

The supported upgrade mechanism with VS setups is to increment the setup project's version property, accept the requested changes, rebuild the entire MSI with incremented file versions for the files you need updating, and set RemovePreviousVersions to true to upgrade the entire product.

VS设置支持的升级机制是增加安装项目的版本属性,接受请求的更改,使用递增的文件版本重建整个MSI以获取需要更新的文件,并将RemovePreviousVersions设置为true以升级整个产品。

#1


0  

It's not very clear whether you want that checkbox in the installer itself or in the app. All the instances I've seen are in the app. There's no point in putting the check in the installer because the user does that just once, and updates may be generated after the product has been installed. You cannot run the same install again! So this check is added to the app, and the implementations I've built do a web service call to the company web site (passing in the installed product's version, ProductCode, UpgradeCode) and if there is an update the app downloads it. The user may or may not be able to install the upgrade if it requires elevated privilege and the user has limited privileges.

您是否想在安装程序本身或应用程序中使用该复选框并不是很清楚。我见过的所有实例都在应用程序中。将检查放入安装程序是没有意义的,因为用户只执行一次,并且可能在安装产品后生成更新。您无法再次运行相同的安装!因此,此检查已添加到应用程序中,我构建的实现会对公司网站进行Web服务调用(传递已安装产品的版本,ProductCode,UpgradeCode),如果有更新,应用程序会下载它。如果用户需要提升的权限且用户具有有限的权限,则用户可能会或可能无法安装升级。

The supported upgrade mechanism with VS setups is to increment the setup project's version property, accept the requested changes, rebuild the entire MSI with incremented file versions for the files you need updating, and set RemovePreviousVersions to true to upgrade the entire product.

VS设置支持的升级机制是增加安装项目的版本属性,接受请求的更改,使用递增的文件版本重建整个MSI以获取需要更新的文件,并将RemovePreviousVersions设置为true以升级整个产品。