How do I work with spaces in my wix source path?

做~自己de王妃 提交于 2019-12-04 06:56:01

Try upgrading to the latest stable wix release. I tested this with Wix 3.0.5419.0 and file paths with spaces are accepted without errors.

On a related note: File elements should not contain absolute paths like in your example, because you would only be able to build the setup on a single developer's PC. Use paths relative to the location of the wxs file instead, like this:

<File Source="..\bin\foo.exe" />

Or make use of a variable that contains the location of the files like this:

<File Source="$(var.BinFolder)foo.exe" />

You can then pass the location of the bin folder by invoking candle like this:

candle.exe -dBinFolder=c:\someFolder\bin\ foo.wxs

edit: as shown by Rob in his own answer, you can also use the light.exe -b switch to specify one or more base directories where the files to install can be found.

@wcoenen provides one mechanism. However, I prefer to use the light.exe -b switch. Then your code can look like:

<File Id="_uploads.UserImport.EDS_UserImport.xls" Name="EDS_UserImport.xls" Source="SourceDir\Published\EDSContainer\uploads\UserImport\EDS_UserImport.xls"></File>

and your command-line to light.exe would have:

-b "C:\Documents and Settings\kle\Desktop\OspreyMSIGenerator\OspreyMSIGenerator"

You can have multiple -b switches and greatly reduce the complexity of your Source attribute.

Also, the File/@Id and File/@Name can be left off if you are find with them defaulting to the file name (in this case, "EDS_UserImport.xls").

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!