[wix-users] Install initial config file but none after that unless version updated

Johnny Smith jsmith at cengentech.com
Mon Feb 20 13:56:22 PST 2017


I've set the Component Id NeverOverwrite and Permanent properties to Yes. In
the future, If I need to overwrite the file, I'll just change the
NeverOverwrite to No. That seems to have done the trick for me. Please let
me know if there are shortcomings to this approach.

<Component Id="EDI_Management.exe.config"
Guid="a69977a4-1a35-4aa7-a23d-a12bcc75ace1" NeverOverwrite="yes"
Permanent="yes">
  <File Id="EDI_Management.exe.config" Name="EDI Management.exe.config"
Source="$(var.EDI Management_TargetDir)EDI Management.exe.config"/>
</Component>

Regards,
Johnny

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Hoover, Jacob
Sent: Monday, February 20, 2017 3:43 PM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] Install initial config file but none after that
unless version updated

Config file is XML, so you should be able to use WiX CA's to update it via
XmlFile. I'm fairly certain it is safe as in it won't trigger Windows
Installer into thinking the user modified the files. 

Depending on when you schedule RemoveExistingProducts, you could read the
desired values before removal of the existing and then write the values
after install of the new.  It may be possible if REP is scheduled later that
the file would just stay, but I forget the rules behind a non-versioned
file. (IE, is it just the last modified time matching that lets WI skip the
file, or would it also hash.)

As for adding another parameter, I'd do that with a XmlFile CA as well.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Johnny Smith
Sent: Monday, February 20, 2017 2:15 PM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Install initial config file but none after that unless
version updated

I need to install the application.exe.config file when the application is
first installed; however, after the first installation, I want to manage the
updates to the config file based on the version number of the file. How do I
accomplish this?

 

I put connection string information in the config file. So, I don't want to
overwrite the user's connection string information each time an update is
installed but I would like the option to overwrite the file should another
parameter be added to the file during a later update.

 

Johnny Smith

President
CenGen Technologies, Inc.
P.O. Box 2037
Mansfield,TX 76063
Ph: (682) 518-9251

W: http:// <http://www.cengentech.com/> www.cengentech.com
<http://www.cengentech.com/> 

 


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant
http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant
http://www.firegiant.com/



More information about the wix-users mailing list