assafka
Posts: 9
Joined: Tue Oct 25, 2016 9:02 am

Get the msi error code in custom action

Hi,
I'm looking for a way to get the MSI error code (in case of an error) in custom action for error reporting.
I tried to look for it in "Installation Status" properties, but i wasn't able to find it.
Any way I can get it ?

Thanks
Catalin
Posts: 6584
Joined: Wed Jun 13, 2018 7:49 am

Re: Get the msi error code in custom action

Hello,

I am not quite sure there is a property which stores the value of the MSI return code.

However, in order to achieve what you want, you can make use of the "MsiExec.exe" return codes.

Basically, here, we can get the return code of the whole msiexec process. For instance, we can do this using the %errorlevel% variable, in a batch file, as it follows:

Code: Select all

msiexec.exe /i <path_to_your_msi>
echo %errorlevel%
pause
Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”