WiX Relative Path to the Source File

You can use the relative path like so:

    <File Id="Bla.exe" Source="..\bin\Debug\Bla.exe" KeyPath="yes" Checksum="yes"/>

OR

You can add a configuration file to your project to define common variables. To do so, add a new “WiX Include” file to your project, call it config.wxi. Then in your include file, you can define a SourceDir variable like so:

<?xml version="1.0" encoding="utf-8"?>
<Include>
  <?define SourceDir = "D:\Projects\Bla\Bla\bin\Debug" ?>
</Include>

Now in your .wxs file, you can add a reference to the config file at the top, ex:

<?xml version="1.0" encoding="UTF-8"?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
 <?include "config.wxi"?>

Then just reference your SourceDir variable like so:

<File Id="Bla.exe" Source="$(var.SourceDir)\Bla.exe" KeyPath="yes" Checksum="yes"/>

Also, there are some built in WiX project variables that you may use.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)