The @error
value from Run
only tells you whether the program was started correctly. The program is then started in the background and the script continues executing.
If you don't need to do any processing while the msi is installing, like mouse or keyboard automation, then using RunWait
will return the exit code from the program.
Alternatively, if you need to use Run, then after doing your background processing use the ProcessWaitClose
which returns the exit code of the program in @extended
.