WiX 在安装过程中会覆盖配置文件.我怎样才能避免这种情况? [英] WiX overwrites config files during setup. How can I avoid this?

查看:12
本文介绍了WiX 在安装过程中会覆盖配置文件.我怎样才能避免这种情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 WiX 创建 Windows 安装程序.不幸的是,我的安装程序在每次更新时都会覆盖一个配置文件.我真正想要的是,安装程序仅在找不到文件时才创建文件.

I'm using WiX to create a windows installer. Unfortunately my installer overwrites a config file on every update. What I really want is, that the installer only creates the file if it is not found.

感谢和问候,叉子

推荐答案

我相信有人会想出一个正确的答案,但作为备份:

I sure someone will come up with a proper answer, but as a backup:

如果正常配置文件不存在,您可以让安装程序创建一个默认配置文件,然后让您的应用程序将默认文件复制到正常配置文件中.这也提供了一种将应用程序重置为出厂默认设置的简单方法(只需删除配置文件).

You could have the installer create a default configuration file, and then have your application copy the default file to the normal configuration file, if the normal configuration file is not present. This also provides an easy way to reset the application to factory default (just delete the configuration file).

这篇关于WiX 在安装过程中会覆盖配置文件.我怎样才能避免这种情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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