我如何在wix源路径中使用空格? [英] How do I work with spaces in my wix source path?

查看:132
本文介绍了我如何在wix源路径中使用空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

wxs文件的File标签Source属性;路径中有空格.

<File Id="_uploads.UserImport.EDS_UserImport.xls" Name="EDS_UserImport.xls" Source="C:\Documents and Settings\kle\Desktop\OspreyMSIGenerator\OspreyMSIGenerator\Published\EDSContainer\uploads\UserImport\EDS_UserImport.xls"></File>

我收到此错误

candle.exe:错误CNDL0103:系统找不到类型为源"的文件和".

我不确定我的路径中是否包含空格.如何在Source路径中支持空格?

解决方案

尝试升级到最新的稳定版威克斯发布.我使用Wix 3.0.5419.0对此进行了测试,并接受带有空格的文件路径,而不会出现错误.

相关说明:文件元素不应像示例中那样包含绝对路径,因为您只能在单个开发人员的PC上构建设置.改用相对于wxs文件位置的路径,如下所示:

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

或使用包含如下文件位置的变量:

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

然后您可以像下面这样调用Candle来传递bin文件夹的位置:

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

编辑:如Rob在他自己的答案中所示,您还可以使用light.exe -b开关指定一个或多个基本目录,可以在其中找到要安装的文件.

wxs file the File tag Source attribute; the path has a space in it.

<File Id="_uploads.UserImport.EDS_UserImport.xls" Name="EDS_UserImport.xls" Source="C:\Documents and Settings\kle\Desktop\OspreyMSIGenerator\OspreyMSIGenerator\Published\EDSContainer\uploads\UserImport\EDS_UserImport.xls"></File>

I get this error

candle.exe : error CNDL0103 : The system cannot find the file 'and' with type 'Source'.

I can't be sure that my paths won't have spaces in it. How do I support spaces in the Source path?

解决方案

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.

这篇关于我如何在wix源路径中使用空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆