Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files specified with SourceDir as part of the Source attribute cannot be found if binder args are given #4439

Open
wixbot opened this issue Jun 4, 2014 · 5 comments
Milestone

Comments

@wixbot
Copy link

wixbot commented Jun 4, 2014

Given the following .wxs:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
   <Product Id='*' Name='Test app' Manufacturer='Test' Language='1033' Version='1.0.0' UpgradeCode='{9df3ce97-ff4a-4edf-9ea8-c6d4a071424e}'>
      <Package Description='Test Installer' InstallerVersion='200' Compressed='yes' />
      <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
      <Directory Id='TARGETDIR' Name='SourceDir'>
        <Directory Id='ProgramFilesFolder'>
          <Directory Id='INSTALLLOCATION' Name='AppDir'>
            <Component Id='file1' Guid='*'>
              <File Id='file1' Name='file1' DiskId='1' Source='SourceDir\file1.txt' />
            </Component>
          </Directory>
        </Directory>
      </Directory>
      <Feature Id='test_feature' Title='feature' Level='1'>
         <ComponentRef Id='file1' />
      </Feature>
   </Product>
</Wix>

running the commands

candle.exe test.wxs
light.exe test.wixobj

works fine, with no errors or warnings.

However, this:

candle.exe test.wxs
light.exe -sh test.wixobj

generates this error:

light.exe : error LGHT0103 : The system cannot find the file 'SourceDir\file1.txt' with type ''.

If SourceDir is removed from the File element, replacing the line with this:

 <File Id='file1' Name='file1' DiskId='1' Source='file1.txt' />

then light.exe -sh completes succesfully

The problem occurs for any binder argument, not just -sh

It seems like passing any parameter to the binder somehow trips up the file path resolution.

Originally opened by jalf

@wixbot
Copy link
Author

wixbot commented Jun 5, 2014

Release changed from v3.8 to v3.x

@wixbot
Copy link
Author

wixbot commented Jun 7, 2014

I tried Wix3.9 and cannot reproduce error LGHT0130 if I have a file file1.txt in the path of currnetWorkingDir\SourceDir.
Can you still get the error LGHT0103 if you have this path 'SourceDir\file1.txt' at your current working directory?

Originally posted by ybdesire

@wixbot
Copy link
Author

wixbot commented Jun 10, 2014

No, if I create a subdir named SourceDir and put file1.txt in that, the problem goes away.

But if file1.txt is in the current working dir, light.exe runs correctly without -sh, but fails with that flag.

The problem with this is that heat.exe generates paths containing SourceDir, and so it cannot be combined with the sh flag (or other binder parameters)

Originally posted by jalf

@wixbot
Copy link
Author

wixbot commented Jun 11, 2014

If -sh or -sf is specified, Binder.ResolveFields skips the call to BinderFileManager.ResolveFile, which is responsible for, among other things, stripping SourceDir[\\/] from source paths. Thus the object field still points to SourceDir\path. -sh or -sf means there's no file manager resolution. That seems wrong. This does not appear to be a regression.

Originally posted by barnson
Status changed from Open to Untriaged

@wixbot
Copy link
Author

wixbot commented Jun 17, 2014

Yeah, that sounds like it'd explain problem. I'm certainly not a WiX expert, but this behavior seems wrong.

Originally posted by jalf

@wixbot wixbot added this to the v3.x milestone Dec 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant