Tag: inno setup

如何从Inno Setup调用“npm install”?

我在安装Node.js的Inno Setup中编写一个安装程序,提取一个包含所有节点项目文件的zip文件,然后需要使用npm install来安装节点应用npm install 。 手动过程包括打开命令提示符,浏览到这些文件所在的目录(在我的案例中解压缩到与其{app}文件夹设置对应的Program Files文件夹中),然后运行该命令行npm install –quiet 。 但是,在Inno安装程序中执行此操作时,它将失败… function InstallNodeApp: Integer; var C: String; begin C:= 'npm install –quiet'; if not Exec(C, '', ExpandConstant('{app}'), SW_SHOWNORMAL, ewWaitUntilTerminated, Result) then begin Result:= -1; end; end; 我已经尝试把–quiet参数以及调用这个命令行的cmd.exe作为参数,以及其他许多尝试的组合,但没有任何工作 – 执行失败。 我得到的错误总是The system cannot find the file specified. 。 如何在接收结果/退出代码时执行此节点安装?

Inno Setup – 由安装程序添加到PATH中的npm程序无法在从安装程序执行的batch file中识别

我已经创build了一个Windows安装程序使用Inno安装程序为我所做的应用程序。 作为安装程序的一部分,我已经安装了一些第三方应用程序,后面跟着一个batch file,执行一些npm命令可操作的程序或batch file。 一切安装好,但batch file运行时,我得到的消息 “npm”不被识别为内部或外部命令 命令不运行,所以应用程序不会打开。 但是,如果我保持原样,只需在安装后重新运行batch file,命令就会执行并且应用程序正常工作。 如何让batch file作为安装的一部分正确运行? Inno Setup Run部分 [Run] Filename: "{tmp}\Git-2.15.0-64-bit.exe"; Flags: waituntilterminated Filename: "{tmp}\rubyinstaller-2.3.3-x64.exe"; Flags: waituntilterminated Filename: "{tmp}\visualcppbuildtools_full.exe"; Flags: waituntilterminated Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\mongodb-win32-x86_64-2008plus-ssl-3.4.10-signed.msi"; WorkingDir: {tmp}; Flags: waituntilterminated Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\node-v6.11.0-x64.msi"; WorkingDir: {tmp}; Flags: waituntilterminated Filename: "{tmp}\setup.bat"; Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: […]