Difference between MsiInstallProduct and Installer.InstallProduct?
-
16-10-2019 - |
Question
What's the difference between these two?
MsiInstallProduct and Installer.InstallProduct. From what I've read, the only difference is that the first returns an int that will dictate if the installation succeeded or not.
I am currently using DTF (WiX) to call Installer.InstallProduct
. The problem is, this function has a return type of void.
Question:
How can I determine if the installation succeeded or not when calling Installer.InstallProduct
via DTF?
Solution
As you noticed, MsiInstallProduct simply returns error or success with no further information. Installer.InstallProduct returns nothing. DTF returns nothing.
Why the difference? MsiInstallProduct is old school C/C++ where you return error codes. The others are new school where instead you raise exceptions. Your code then catches the exception to know that there was a problem.