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

scu*_*ffe 0 automation cygwin inno-setup

我尝试过这种变化,但除了能够启动cygwin窗口之外没有其他运气.(包裹;为清楚起见)

Filename: "c:\cygwin\bin\bash.exe";
  Parameters: "-c c:/scripts/step1.sh paramX";
  Flags: shellexec waituntilterminated;
  StatusMsg: "Running the script..."
Run Code Online (Sandbox Code Playgroud)

(这是用于内部安装,因此安装了cywin,并且所有路径,脚本都是已知的)

Jos*_*ton 5

你的问题是-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'
Run Code Online (Sandbox Code Playgroud)

您只需要:

c:\cygwin\bin\bash.exe "/scripts/step1.sh paramX"
Run Code Online (Sandbox Code Playgroud)

所以你的代码看起来像:

Filename: "c:\cygwin\bin\bash.exe";
  Parameters: "c:/scripts/step1.sh paramX";
  Flags: shellexec waituntilterminated;
  StatusMsg: "Running the script..."
Run Code Online (Sandbox Code Playgroud)

也许这对其他人有帮助:)