WIX Installer Preserve config file On major upgrade early Scheduling [英] WIX Installer Preserve config file On major upgrade early Scheduling

查看:19
本文介绍了WIX Installer Preserve config file On major upgrade early Scheduling的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 WIX 设置项目中使用主要升级早期计划,如下所示.

I am using Major upgrade early scheduling in my WIX Setup projects as below.

我更喜欢在升级时清除所有文件.但是我需要保留一个配置文件并在升级时再次恢复.

I prefer to clear all files on upgrades. However I need to preserve a config file and restore again on upgrade.

我不想更改这个提前安排(Schedule="afterInstallInitialize"),因为我会遇到其他问题.是否有任何解决方法(自定义操作?)以保留上述早期计划中的配置文件?

I don't want to change this early scheduling (Schedule="afterInstallInitialize"), as I will be ended with other issues. Is there any work around (Custom Actions?) to preserve the config file in the above early scheduling?

推荐答案

保留设置:这是什么设置文件?它存储在哪里?在用户配置文件中还是在共享的每台机器位置?也许它是一个网络应用程序,它是 web.config 文件?

Preserving Settings: What kind of settings file is this? And where is it stored? In the user profile or maybe in a shared, per-machine location? Perhaps it is a web-application and it is the web.config file?

以前的答案:这个问题一直出现.以下是之前的一些直接或更模糊相关的答案:

Previous Answers: This question comes up all the time. Here are some answers from before that are directly or more vaguely related:

永久组件:当您提前卸载并清除所有以前的文件时,唯一真正有效的选项是设置配置文件永久 从现在"开始.它不适用于第一次更新,但对于以后的更新,该文件将保留在磁盘上.

Permanent Component: When you do early uninstall and wipe out all previous files, the only option that really works would be to set the config file permanent from "now on". It won't work for the first update, but for future updates the file will be preserved on disk.

次要升级:如果您使用次要升级而不是主要升级迁移到此新版本,则在升级过程中不会删除该文件,因为次要升级升级不会触发卸载,而是就地"升级产品.将来处理更新可能是一个挑战,因为有些人可能没有升级到次要升级版本,但会直接从版本 1 升级到 3.如果他们这样做,设置文件将被版本清除1 自行卸载.破坏演出的实际问题.

Minor Upgrade: If you migrate to this new version using a minor upgrade instead of a major upgrade, then the file will not be removed during the upgrade since the minor upgrade does not trigger uninstall but upgrades the product "in-place". It can be a challenge to deal with updates in the future since some people may not have upgraded to the minor upgrade version, but will seek to major upgrade directly from version 1 to 3. If they do the settings file will be wiped out by version 1 uninstalling itself. Practical issue that ruins the gig.

自定义操作:许多人尝试在新更新期间使用自定义操作备份设置文件,然后在升级完成后恢复文件.容易出错,但可行.在这里可以看到复杂性:Wix 工具更新使用旧的自定义操作.

下载设置:我最喜欢的方法是更改​​应用程序本身从数据库或 URL 下载的设置文件.云设置"我喜欢这样称呼它.这为可以跨计算机共享的设置生成了一个可靠的在线存储库(并不总是可取的).如果您从数据库中检索,您还可以提供版本控制/修订和设置回滚.

Download Settings: My favorite approach is to change the settings file to be downloaded from a database or an URL by the application itself. "Clouding settings" I like to call it. That yields a reliable, online repository for settings that can be shared across computers (not always desirable). If you retrieve from a database you can also provide version control / revisioning and rollback for settings.

更多链接:

这篇关于WIX Installer Preserve config file On major upgrade early Scheduling的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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