Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy app.config using wix project

Tags:

xml

wix

I need to create setup project using WIX and also i need to deploy app.config file with my windows application.therefore i have added my app.config as a component in product.wxs as follows :

<Component Id="App.config" Guid="my guid">
    <File Source="Source-path" Name="App.config"
          Id="myid" KeyPath="yes"/>
  </Component>

Once i run msi application installs successfully but app.config xml file becomes unreadable and application fails run due to this problem.how to fix this issue ?. I'm newbie to WIX

like image 472
pubudut Avatar asked Mar 18 '23 22:03

pubudut


1 Answers

When you build your code, the app.config gets renamed to [ApplicationName].exe.config and will be in your build output directory. This is the file you should harvest as it may have been transformed as part of your build process.

If you are using Votive (wixproj) in your solution then you can reference your application. This will then allow you to use some built in variable names.

<Component Id="[ApplicationName].exe.config" Guid="my guid">
     <File Source="var.[ApplicationName].TargetDir\[ApplicationName].exe.config" Name="[ApplicationName].exe.config" Id="myid" KeyPath="yes"/>
</Component>

Note that the [] symbols are only used to identify the code that is specific to your implementation. You should not have these in your wix

like image 154
James Reed Avatar answered Mar 28 '23 09:03

James Reed