![](/img/trans.png)
[英]How to execute “net use” command from Inno Setup installer on Windows 7?
[英]How to execute a command from a certain directory in Inno Setup script
我有多個關於安裝npm
組件的cmd
命令。 我不想為此使用批處理文件。 如何通過 Inno Sectum 腳本中的Exec
函數執行這些命令,並且我希望安裝程序等到這些命令被執行?
以下是我希望執行的一些示例命令,它們也需要在指定目錄上執行:
npm install forever-monitor
npm install ip
Inno Setup Exec
函數將WorkingDir
作為第三個參數。
所以你可以做
Exec('npm', 'install forever-monitor', ExpandConstant('{pf}\nodejs'),
SW_HIDE, ewWaitUntilTerminated, ResultCode);
雖然在這種情況下,我會質疑, npm
是否真的需要從其目錄中執行。 很可能,您實際需要的只是使用完整路徑執行npm
:
Exec(ExpandConstant('{pf}\nodejs\npm'), 'install forever-monitor', '',
SW_HIDE, ewWaitUntilTerminated, ResultCode);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.