简体   繁体   English

如何使用Inno Setup将命令传递到Windows中的Cygwin控制台

[英]How do you pass commands to a Cygwin console in Windows using Inno Setup

I've tried variations of this, but had no luck other than the ability to start a cygwin window. 我尝试过这种方法的变种,但是除了能够启动“ cygwin”窗口之外,没有其他运气。 (wrapped on ; for clarity) (包装上为清楚起见)

Filename: "c:\cygwin\bin\bash.exe";
  Parameters: "-c c:/scripts/step1.sh paramX";
  Flags: shellexec waituntilterminated;
  StatusMsg: "Running the script..."

(this is for an internal install, thus cywin is installed, and all paths, scripts are known) (这是内部安装,因此安装了cywin,并且所有路径,脚本都是已知的)

Your problem is that -c tells bash to read instructions from the next parameter: eg 您的问题是-c告诉bash从下一个参数读取指令:例如

c:\cygwin\bin\bash.exe -c 'for NUM in 1 2 3 4 5 6 7 8 9 10; do echo $NUM; done'

you just need: 您只需要:

c:\cygwin\bin\bash.exe "/scripts/step1.sh paramX"

So your code would look like: 因此您的代码如下所示:

Filename: "c:\cygwin\bin\bash.exe";
  Parameters: "c:/scripts/step1.sh paramX";
  Flags: shellexec waituntilterminated;
  StatusMsg: "Running the script..."

Maybe this will be helpful for somebody else :) 也许这对其他人会有帮助:)

I think you're going to need to make the whole thing part of a cmd.exe invocation, and then I'm not sure it will do exactly what you want/need. 我认为您将需要使整个事情成为cmd.exe调用的一部分,然后我不确定它是否可以完全满足您的需求。

I'm looking at Inno-Setup 5 documentation (may be out-of-date), but I don't think you need the shellexec or waituntilterminated flags. 我在看的Inno-设置5文件(可能已经过期),但我不认为你需要的shellexecwaituntilterminated标志。

Try something like 尝试类似

Filename: "cmd.exe"; Parameters: "/c c:\cygwin\bin\bash -c 'c:/scripts/step1.sh paramx'"

Untested, caveat emptor. 未经测试的警告购买者。

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

相关问题 如何在 Cygwin 上自动执行命令 - How to automate commands on Cygwin 如何在不通过telnet使用管道的情况下串行传递命令 - How do I pass commands serially without using pipe through telnet Inno Setup可以发送按键和鼠标按下的信息吗(如果没有),如何使用安装程序来完成? - Can Inno Setup send key and mouse presses, if not, how can this be done using an Installer? Inno Setup:如何在/verysilent 安装后自动运行程序? - Inno Setup: How to automatically run program after /verysilent install? 如何在Windows上通过eggPlant执行shell命令? - How do I execute shell commands through eggPlant on Windows? 如何使用 Python 在 Windows 命令提示符中终止正在运行的文件? - How do you terminate a running file in a Windows command prompt using Python? 如何使用Java类程序在git-bash中运行grunt命令并在控制台中显示 - How to run grunt commands in git-bash using java class program and display in console 如何使用 selenium 在浏览器中执行控制台命令 - How to execute console commands in browser with selenium 如何设置 ADB 以向多个 Android 设备 WINDOWS 发送命令 - How do I set up ADB to send commands to mulitple Android devices WINDOWS 如何在Windows 7中关闭之前(以及在杀死所有正在运行的程序之前)执行命令? - How do I execute commands before shutdown in Windows 7 (and before it kills all running programs?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM