cabwiz.exe 的 NAnt 执行任务失败

发布于 2024-10-22 16:12:29 字数 1459 浏览 5 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坏尐絯 2024-10-29 16:12:29

我通过使用 NAnt 函数 directory::get-current-directory() 从 NAnt 构建脚本中指定 inf 文件的完整路径来使其工作。最终结果是:

<target name="build Cab Production">
        <exec program="C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" commandline="${directory::get-current-directory()}\ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf  /err cab_build_errors.err" />
</target>

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:

<target name="build Cab Production">
        <exec program="C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools\cabwiz.exe" commandline="${directory::get-current-directory()}\ACSreader2\ACSreader2Setup\Production\ACSreader2_Setup.inf  /err cab_build_errors.err" />
</target>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文