Hi everyone, I'm trying to execute a cmd file on my NSIS script.
The cmd file contains only the following instructions to setup NodeJS:
To further explain:
- I have the ExecWait in a separate section.
- If I run the installer for the first time and choose the section, the cmd does not execute (cmd window just blinks and error code is 1). If I run the installer a second time and choose the section, the instructions will execute without any issue (cmd window opens and executes everything like expected).
- If I don't choose the section on the first time the installer is ran, obviously it won't execute my cmd. However, if I reopen the installer and then select the section, it will execute the cmd correctly.
So, to resume, I need to open and reopen my installer in order for the cmd instructions to be executed correctly.
What could be causing this behaviour? How can I debug the issue?
The cmd file contains only the following instructions to setup NodeJS:
In order to run the script, I've tried to use ExecWait, nsExec::Exec and Exec. Currently I'm using ExecWait, since every command is behaving the same way. Here is the way I'm calling the script:code:
call npm install -g appium
call npm install -g appium-doctor
The problem is, the instructions in the cmd file will only be executed the second time I run the installer.code:
ExecWait '"$sysdir\cmd.exe" /C if 1==1 "$INSTDIR\npm_config.cmd"'
To further explain:
- I have the ExecWait in a separate section.
- If I run the installer for the first time and choose the section, the cmd does not execute (cmd window just blinks and error code is 1). If I run the installer a second time and choose the section, the instructions will execute without any issue (cmd window opens and executes everything like expected).
- If I don't choose the section on the first time the installer is ran, obviously it won't execute my cmd. However, if I reopen the installer and then select the section, it will execute the cmd correctly.
So, to resume, I need to open and reopen my installer in order for the cmd instructions to be executed correctly.
What could be causing this behaviour? How can I debug the issue?
Comment