n the Product.wxs, I set Schedule="afterInstallInitialize" in the
MajorUpgrade so that if the installation fails, it will roll back to the
previous version.

Our Windows Service uses app.config that the installer copied to the
installed machine. We do this by including the below line in the
Product.wxs:

<Component Id="Config" Win64="yes">
        <File
Source="$(var.WixWindowsService2012.TargetDir)WixWindowsService2012.exe.config"
              Name="WixWindowsService2012.exe.config"
              Vital="yes" KeyPath="yes" />
</Component>
We only want to copy this app.config file on the first installation, and we
do NOT want to copy it in the subsequent installations.

When I comment out the above Component element in the Product.wxs, the
installation failed because during installation, it deletes the app.config
on the installed folder, and since the Windows Service requires it to run,
the installation fails.

Following
http://stackoverflow.com/questions/1912037/copy-if-not-exist-in-wix, I
thought if I set the File element to be like below, it will NOT copy the
file if the file already exists in the installed folder:
<File
Source="$(var.WixWindowsService2012.TargetDir)WixWindowsService2012.exe.config"/>
But, the above command still override the file.

How can I make the installation to not copy the app.config to the installed
folder if app.config already exists there ?

Thank you.



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-not-copy-a-file-in-subsequent-installations-tp7592929.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to