I have created a Windows installer using Inno Setup for an app I have made. As part of the installer I have included the installation of some third party applications followed by a batch file, to execute a number of npm
command operable program or batch file.
Everything installs okay but when the batch file runs I get the message
'npm' is not recognized as an internal or external command
The commands don't run and so the app won't open. However, if I leave everything as it is and just rerun the batch file again after the installation, the commands execute and the app works fine. How can I get the batch file to run properly as part of the installation?
Inno Setup Run
Section
[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: shellexec postinstall skipifsilent
Batch File
cd C:/Users/%USERNAME%/Documents/myApp/api/
call npm install -g bower
call npm install -g grunt
call npm install -g grunt-cli
call npm config set msvs_version 2015 -global
call npm install bcrypt -save
call npm install
cd ../admin/
call npm install -g bower
call npm install -g grunt
call npm install -g grunt-cli
echo 1 | call gem install compass
call bower install
call npm install