[wix-users] File Path Issue in Light Command

Edwin Castro egcastr at gmail.com
Mon Dec 16 08:22:51 PST 2019


I expect the blogs / forums you've read are describing a specific scenario
and extrapolating general conclusions without proper evidence, but I can't
really say anything definitive about them because I don't know what they
are.

I personally do not consider the current behavior to be a bug. In fact, I
find it very consistent. In all scenarios candle and light use the current
working directory to resolve relative paths. I don't consider this behavior
to be odd since effectively all compilers and linkers follow this
convention. This allows you to specify paths on the command line relative
to the current directory as expected.

All Visual Studio projects I am aware of always construct full paths for
files and tools (compilers, linkers, etc.) are executed in the project
directory. All relative paths in the .wixproj file are actually resolved by
MSBuild to the project directory and tools are executed in the project
directory. To simulate this behavior manually, or with a non-msbuild
script, you'd need to ensure the current working directory when executing
candle and light is the project directory and give paths relative to the
project directory.

--
Edwin G. Castro


On Mon, Dec 16, 2019 at 5:22 AM Ven H <venh.123 at gmail.com> wrote:

> Thanks a lot for the prompt response, Edwin. Ideally, the path of a file
> referred in WXS should be relative to the WXS file and not the .wixproj
> file, right? This is what I read in many blogs / forums. So, is this a bug
> of the WiX Visual Studio template or target or something?
>
> On Mon, Dec 16, 2019 at 6:19 PM Edwin Castro <egcastr at gmail.com> wrote:
>
>> My guess is that candle/light are run from the project directory within
>> Visual Studio. When candle/light are run directly they must be run from the
>> Content directory. To replicate the behavior seen in Visual Studio try
>> running candle/light from the project directory instead of the Content
>> directory.
>>
>> --
>> Edwin G. Castro
>>
>> On Mon, Dec 16, 2019, 02:27 Ven H via wix-users <
>> wix-users at lists.wixtoolset.org> wrote:
>>
>>> I have a WiX Setup Project in Visual Studio. It has a folder called
>>> Content. This folder has all the WXS files, including the Product,
>>> LicenseAgreement etc. It also has the License.rtf file. The
>>> LicenseAgreement.wxs has a reference to License.rtf. Even though both are
>>> inside Content folder, Visual Studio throws error (in light command) if I
>>> don't give the path to License.rtf as Content\License.rtf. I am not able
>>> to
>>> understand this.
>>>
>>> If I run it directly (not from Visual Studio) using WiX Commands like
>>> Candle, Light etc, it works if the path is simply "License.rtf" and not
>>> "Content\License.rtf". This is weird.
>>>
>>> In short, LicenseAgreement.wxs is inside Content folder and so is
>>> License.rtf.
>>>
>>> But for this to work from Visual Studio, I need to specify
>>> "Content\License.rtf" as path in LicenseAgreement.wxs
>>>
>>> But using direct WiX command, I need to specify "License.rtf" as path in
>>> LicenseAgreement.wxs.
>>>
>>> Can anyone please help me with this?
>>>
>>> ____________________________________________________________________
>>> WiX Toolset Users Mailing List provided by FireGiant
>>> http://www.firegiant.com/
>>>
>>



More information about the wix-users mailing list