热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

从ClickOnce转移到MSI部署的策略-StrategyformovingfromClickOncetoMSIdeployment

WehaveaconsumerappinthemarketthatusesClickOncedeployment.Wevehadvariousissuesovert

We have a consumer app in the market that uses ClickOnce deployment. We've had various issues over time with ClickOnce, most of which have been resolved, but kind of always regretted not going with a straightforward MSI installer. In particular we'd like to be able to offer proper offline installs (from a boxed copy), and better multi-lingual installation options. We have just updated our beta to an AnyCPU build after finally getting shot of some old 32 bit dll dependencies (before you ask - yes, our app can really benefit from the increase in memory address space, we crunch a lot of data). Now of course we realise that going from x86 to AnyCPU doesn't work with ClickOnce, so it seems like the ideal time to make the switch away to another install technology.

我们在市场上有一个消费者应用使用ClickOnce部署。随着时间的推移,我们在ClickOnce上遇到了各种各样的问题,其中大多数问题已经得到解决,但总是有点后悔没有使用一个简单的MSI安装程序。我们特别希望能够提供适当的脱机安装(从盒装拷贝)和更好的多语言安装选项。我们刚刚更新了我们的测试版到一个AnyCPU构建后,终于得到了一些旧的32位dll依赖项(在你问之前——是的,我们的应用程序可以从内存地址空间的增加中获益,我们处理了很多数据)。当然,现在我们意识到从x86到任何cpu都不能使用ClickOnce,所以现在似乎是切换到另一种安装技术的理想时机。

SO here's the issue: we want to upgrade automatically to the new installer, from existing ClickOnce installations. We would also very much like to keep the user settings (.config) file. Not a total deal breaker if we can't, but it will irritate a lot of users if we don't.

因此,这里的问题是:我们想要自动升级到新的安装程序,从现有的ClickOnce安装。我们也非常希望保留用户设置(.config)文件。如果我们做不到,这也不是一件彻底的事情,但是如果我们不这样做,它将会激怒很多用户。

So the very rough gameplan is something like this:

所以大概的游戏计划是这样的:

Create a new version of the app and deploy via ClickOnce. This new version is basically a front-end for the MSI installer. It somehow grabs the existing user settings, sets off a download of the new installer and invokes it. Then it copies the existing settings to the new application directory. Then it uninstalls itself (itself being the previous, ClickOnce, installation of the app).

创建一个新版本的应用程序,并通过ClickOnce进行部署。这个新版本基本上是MSI安装程序的前端。它以某种方式获取现有的用户设置,启动新安装程序的下载并调用它。然后将现有的设置复制到新的应用程序目录。然后卸载自己(它本身就是先前的,点击一次,安装应用程序)。

In principle I think that could work, but am unsure about how to go about it. Particularly the moving of the user settings to the new application, and self-uninstalling at the end.

原则上我认为这是可行的,但我不确定该如何着手。特别是将用户设置移动到新应用程序,并在最后自动卸载。

If anyone has any tips, or has gone through a similar process, I'd be very keen to hear about it.

如果有人有什么建议,或者经历过类似的过程,我很想知道。

Application is c# targeting .NET 4.

应用程序是c#目标。net 4。

thanks, Matt

谢谢,马特

1 个解决方案

#1


1  

Create an msi version with the following features:

创建一个具有以下特性的msi版本:

  • Grab application settings etc from the ClickOnce installation. If it is the first start of the msi version for the current user, check if there is a ClickOnce version and copy/migrate the settings from there. I would not try to do the opposite way and push the settings from ClickOnce to msi because (1) there may be several ClickOnce installations with different settings and you may want to copy all of them and (2) You would have to put migration logic into the old version (which may be required to change for compatibility with future msi installed versions). The ideal approach, however, would be to just keep using the application settings as they were. If they are somewhere in the user profile (outside the ClickOnce installation), it should not matter how the application has been installed.
  • 从ClickOnce安装中获取应用程序设置等。如果它是当前用户的msi版本的第一个开始,检查是否有一个ClickOnce版本,并从那里复制/迁移设置。我不会尝试做相反的方向,推动ClickOnce msi,因为(1)的设置可能会有几个ClickOnce安装有不同的设置,你可能想要复制所有的他们,(2)你必须把迁移逻辑到旧版本(这可能需要改变兼容未来msi安装版本)。然而,理想的方法是继续使用应用程序设置。如果它们位于用户配置文件中的某个位置(在ClickOnce安装之外),则应用程序是如何安装的并不重要。
  • Detect the ClickOnce version, offer the user to uninstall it. The ClickOnce version is installed once per user while the msi version can be installed for all users. If you started the uninstallation from within the ClickOnce version, you would only ever uninstall one of potentially several ClickOnce installations. If you do it as described here, every user will be reminded to uninstall his ClickOnce version once he starts the application (in ClickOnce or msi version).
  • 检测ClickOnce版本,提供用户卸载它。ClickOnce版本为每个用户安装一次,msi版本为所有用户安装一次。如果从ClickOnce版本中开始卸载,那么您将永远只卸载几个ClickOnce安装中的一个。如果您按照这里描述的那样做,将提醒每个用户在启动应用程序后(以ClickOnce或msi版本)卸载他的ClickOnce版本。

Create a new ClickOnce version which detects the msi installed version.

创建一个新的ClickOnce版本,用于检测msi已安装的版本。

  • If no msi version is installed, tell the user about the new installer and offer him to download and run the new installer or do it later. I would not remove all other functionality. That could be a very evil surprise for a user. You should give the user the possibility to postpone the upgrade and use the existing version for some time. Remember that the user most likely did not need admin rights to update the ClickOnce-installed version but will need admin rights to install the msi.
  • 如果没有安装msi版本,请告诉用户新的安装程序,并请他下载并运行新的安装程序,或者稍后再做。我不会删除所有其他功能。这对用户来说可能是一个非常邪恶的惊喜。您应该为用户提供延迟升级和使用现有版本一段时间的可能性。请记住,用户很可能不需要管理员权限来更新点击安装版本,但是需要管理员权限来安装msi。
  • If it has been installed already, start the msi installed version and shutdown the ClickOnce version immediately. The less rigorous version would be to only inform the user. However, I would prefer to force the user to use the newer version once it is installed. Otherwise you may have compatibility issues in your working directory/application settings (depending on the exact structure of your application, of course).
  • 如果已经安装,请立即启动msi已安装版本并关闭ClickOnce版本。不那么严格的版本是只通知用户。但是,我更愿意强制用户在安装后使用更新的版本。否则,您可能会在工作目录/应用程序设置中遇到兼容性问题(当然,这取决于应用程序的确切结构)。

推荐阅读
  • 本文介绍了三种方法来实现在Win7系统中显示桌面的快捷方式,包括使用任务栏快速启动栏、运行命令和自己创建快捷方式的方法。具体操作步骤详细说明,并提供了保存图标的路径,方便以后使用。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • 本文讨论了在Windows 8上安装gvim中插件时出现的错误加载问题。作者将EasyMotion插件放在了正确的位置,但加载时却出现了错误。作者提供了下载链接和之前放置插件的位置,并列出了出现的错误信息。 ... [详细]
  • Android Studio Bumblebee | 2021.1.1(大黄蜂版本使用介绍)
    本文介绍了Android Studio Bumblebee | 2021.1.1(大黄蜂版本)的使用方法和相关知识,包括Gradle的介绍、设备管理器的配置、无线调试、新版本问题等内容。同时还提供了更新版本的下载地址和启动页面截图。 ... [详细]
  • C++字符字符串处理及字符集编码方案
    本文介绍了C++中字符字符串处理的问题,并详细解释了字符集编码方案,包括UNICODE、Windows apps采用的UTF-16编码、ASCII、SBCS和DBCS编码方案。同时说明了ANSI C标准和Windows中的字符/字符串数据类型实现。文章还提到了在编译时需要定义UNICODE宏以支持unicode编码,否则将使用windows code page编译。最后,给出了相关的头文件和数据类型定义。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • IjustinheritedsomewebpageswhichusesMooTools.IneverusedMooTools.NowIneedtoaddsomef ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • Java 11相对于Java 8,OptaPlanner性能提升有多大?
    本文通过基准测试比较了Java 11和Java 8对OptaPlanner的性能提升。测试结果表明,在相同的硬件环境下,Java 11相对于Java 8在垃圾回收方面表现更好,从而提升了OptaPlanner的性能。 ... [详细]
  • 本文详细介绍了Java中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
  • Android系统移植与调试之如何修改Android设备状态条上音量加减键在横竖屏切换的时候的显示于隐藏
    本文介绍了如何修改Android设备状态条上音量加减键在横竖屏切换时的显示与隐藏。通过修改系统文件system_bar.xml实现了该功能,并分享了解决思路和经验。 ... [详细]
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • CEPH LIO iSCSI Gateway及其使用参考文档
    本文介绍了CEPH LIO iSCSI Gateway以及使用该网关的参考文档,包括Ceph Block Device、CEPH ISCSI GATEWAY、USING AN ISCSI GATEWAY等。同时提供了多个参考链接,详细介绍了CEPH LIO iSCSI Gateway的配置和使用方法。 ... [详细]
  • Linux的uucico命令使用方法及工作模式介绍
    本文介绍了Linux的uucico命令的使用方法和工作模式,包括主动模式和附属模式。uucico是用来处理uucp或uux送到队列的文件传输工具,具有操作简单快捷、实用性强的特点。文章还介绍了uucico命令的参数及其说明,包括-c或--quiet、-C或--ifwork、-D或--nodetach、-e或--loop、-f或--force、-i或--stdin、-I--config、-l或--prompt等。通过本文的学习,读者可以更好地掌握Linux的uucico命令的使用方法。 ... [详细]
  • 本文介绍了使用哈夫曼树实现文件压缩和解压的方法。首先对数据结构课程设计中的代码进行了分析,包括使用时间调用、常量定义和统计文件中各个字符时相关的结构体。然后讨论了哈夫曼树的实现原理和算法。最后介绍了文件压缩和解压的具体步骤,包括字符统计、构建哈夫曼树、生成编码表、编码和解码过程。通过实例演示了文件压缩和解压的效果。本文的内容对于理解哈夫曼树的实现原理和应用具有一定的参考价值。 ... [详细]
author-avatar
徐國煇_457
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有