Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
599 views
in Technique[技术] by (71.8m points)

installation - WIX Installer Preserve config file On major upgrade early Scheduling

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The way I deal with this problem is to have two files. You'll notice that app.config/web.config files appSettings element has a file attribute. If you store your user data there the installer will never know about it and will never remove it or otherwise harm it.

web.config ... never modify this... always let the installer overwrite it / remove it. Think of it as stock | virgin file data that the installer owns.

appsettings (connection strings to) override... put your data there and you'll never have to do gymnastics to preserve the data.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...