Skip to content
⌘ NSIS Forum Archive

Getting the msiexec return code

3 posts

SB17#

Getting the msiexec return code

Hello everyone!

I have built an installer(using NSIS) which has couple of MSIs embedded inside it. I execute these constituent MSIs by invoking "msiexec" thru ExecWait.
(For example --> ExecWait 'msiexec.exe /qn /i embedded.msi TARGETDIR="$INSTDIR"' $0)

Can anyone tell me a way to get the error code for the above msiexec call in my nsi script?

Neither the System::Call "Kernel32::GetLastError() nor the ExecWait return value seems to do the trick!!!

Any help will be appreciated!

Thanks,
SB
kichik#
The return value of msiexec.exe is in $0.

GetLastError() is only for the current process, so it won't help you anyway.
SB17#
Thanks kichik, but that doesnt seem to work for me. I always seem to get "0" in $0 as the return value (even when msiexec.exe fails to install the msi as a result of some error thrown by the msi).


Thanks,
SB.