cabwiz.exe 的 NAnt 执行任务失败
我在 Windows 7 Professional 上使用 NAnt 0.90。
我正在尝试使用 NAnt 构建 CAB 文件。 NAnt 正在使用执行任务让 CabWiz 使用 inf 文件构建 CAB 文件。构建失败,但如果我从命令行使用 CabWiz 而不是 NAnt,我可以构建 CAB 文件。
以下是我的 NAnt 构建文件的相关部分:
<target name="build Cab Production">
<exec program="C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" commandline="ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf /err cab_build_errors.err"/>
</target>
CabWiz 生成的 cab_build_errors.err 文件包含 2 个警告和一条非常一般的错误消息:
Warning: Section [RegKeys] has no data
Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process
Error: CAB file "ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.CAB" could not be created
当我从命令行构建 CAB 时,我收到相同的 2 个警告,但没有错误。这是我用来从命令行构建它的内容:
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" "C:\programming\ACSreader2\ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf" /err cab_build_errors.err
更新:
我能够使用以下命令从命令行重现错误:
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" "ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf" /err cab_build_errors.err
区别在于我没有指定完整路径inf 文件。是否有一个变量或其他东西可以让 NAnt 传递完整路径,而无需在构建脚本中显式拥有完整路径?只包含构建文件目录的东西就可以工作。
I am using NAnt 0.90 on Windows 7 Professional.
I am trying to build a CAB file using NAnt. NAnt is using an execute task to have CabWiz build the CAB file using an inf file. The build fails, but if I use CabWiz from the command line instead of NAnt, I can build the CAB file.
Here is the relevant part of my NAnt build file:
<target name="build Cab Production">
<exec program="C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" commandline="ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf /err cab_build_errors.err"/>
</target>
The cab_build_errors.err file generated by CabWiz contains 2 warnings and a very general error message:
Warning: Section [RegKeys] has no data
Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process
Error: CAB file "ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.CAB" could not be created
When I build the CAB from the command line, I get the same 2 warnings, but no error. Here is what I use to build it from the command line:
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" "C:\programming\ACSreader2\ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf" /err cab_build_errors.err
UPDATE:
I was able to reproduce the error from the command line using the following command:
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" "ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf" /err cab_build_errors.err
The difference is that I am not specifying the full path to the inf file. Is there a variable or something I can use to make NAnt pass the full path without explicitly having the full path in the build script? Something that would just have the directory of the build file would work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过使用 NAnt 函数 directory::get-current-directory() 从 NAnt 构建脚本中指定 inf 文件的完整路径来使其工作。最终结果是:
I got it to work by specifying the complete path to the inf file from within the NAnt build script with the use of the NAnt function directory::get-current-directory(). The final result is: