[英]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文件(可能已经过期),但我不认为你需要的
shellexec
或waituntilterminated
标志。
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.