WIX Installer保留配置文件在进行重大升级时及早进行调度 [英] WIX Installer Preserve config file On major upgrade early Scheduling

查看:91
本文介绍了WIX Installer保留配置文件在进行重大升级时及早进行调度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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应用程序,并且是 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:

  • Settings Preservation: Wix: Windows Service sometimes uninstalled when upgrading
  • web.config: Update and retain web.config file during upgrade in wix installer
  • "File Overwrite": Do not override the existing file when we install the .exe file

永久组件 :当尽早卸载并清除所有以前的文件时,唯一有效的选择是设置配置文件永久.它不适用于第一次更新,但对于将来的更新,文件将保留在磁盘上.

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 Tools更新使用旧的自定义操作.

下载设置 :我最喜欢的方法是更改​​设置文件,以从应用程序本身从数据库或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.

一些其他链接 :

Some Further Links:

  • Access Denied: System.UnauthorizedAccessException while running .exe under program files
  • Easy To Skim: Create folder and file on Current user profile, from Admin Profile
  • Handle Per-User Files: Create a .config folder in the user folder
  • PhilDW: Major Upgrade without uninstallation of Windows Service

这篇关于WIX Installer保留配置文件在进行重大升级时及早进行调度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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