简体   繁体   English

WINEPREFIX的ANT执行任务

[英]ANT exec task with WINEPREFIX

I need to execute a wine program (on Linux) within an ANT script (build.xml) from eclipse. 我需要在eclipse的ANT脚本(build.xml)中执行wine程序(在Linux上)。

Supposing the wine program is in default WINEPREFIX, the following would work flawless: 假设wine程序在默认的WINEPREFIX中,则可以正常工作:

<exec dir="${dist}" executable="wine" os="Linux">
    <arg line="'C:\\Program Files\\Inno Setup 5\\Compil32.exe'" />
    <arg line="/cc 'setup.iss'" />
</exec>

Unfortunatelly, due to compatibility issues with other wine programs, I had install that program to another WINEPREFIX. 不幸的是,由于与其他wine程序的兼容性问题,我将该程序安装到了另一个WINEPREFIX。 I can successfully run it from terminal by typing WINEPREFIX=~/.wine_innosetup wine "C:\\\\Program Files\\\\Inno Setup 5\\\\Compil32.exe" The problem now is how to add WINEPREFIX=~/.wine_innosetup env variable while executing my ANT exec task? 我可以通过输入WINEPREFIX=~/.wine_innosetup wine "C:\\\\Program Files\\\\Inno Setup 5\\\\Compil32.exe"从终端成功运行它。现在的问题是如何在同时添加WINEPREFIX=~/.wine_innosetup env变量执行我的ant exec任务?

This doesnt work: 这不起作用:

<exec dir="${dist}" executable="WINEPREFIX=~/.wine_innosetup wine" os="Linux">

...ok found it... ...好找到了...

<exec dir="${dist}" executable="wine" os="Linux">
    <arg line="'C:\\Program Files\\Inno Setup 5\\Compil32.exe'" />
    <arg line="/cc 'setup.iss'" />
    <env key="WINEPREFIX" value="${user.home}/.wine_innosetup"/>
</exec>

the <env> tag did the trick! <env>标签起到了作用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM