I have an installer that installs a configuration file, like so:

<Feature Id="AppName.Feature" Title="Application Name" Level="1">
  <Feature Id="AppConfig.Feature" Level="1" Display="hidden">
    <Component Id="AppConfig.Component" 
Guid="{E56D54A5-0646-4D0C-9F95-73F82E293705}" Directory="INSTALLLOCATION">
      <File Source="$(var.AppName.TargetPath).config" />
    </Component>
    <Condition Level="0">KEEP_EXISTING_CONFIG = 1 AND 
APPCONFIGEXISTS</Condition>
</Feature>
...
</Feature>

The APPCONFIGEXISTS is brought out like so:



<!-- Check for existing application configuration file -->

<Property Id="APPCONFIGEXISTS" >

  <DirectorySearch Id="CheckAppConfigDir" Path="INSTALLDIR" Depth="0">

    <FileSearch Id="CheckAppConfigFile" 
Name="$(var.AppName.TargetFileName).config" />

  </DirectorySearch>

</Property>

The KEEP_EXISTING_CONFIG is a command-line variable, sent in to msiexec.exe.

This configuration alone does not do the trick (obviously, since I'm asking 
here) as the configuration file is removed by the next version of the MSI 
before it starts its installation. The Component element has a "Permanent" 
property, but with that one enabled, it certainly does not behave as expected 
(does not get removed on uninstall, never gets replaced on upgrade, regardless 
of what the value of KEEP_EXISTING_CONFIG is).

Any ideas?
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to