Get errors list from custom action on exit #8655
-
Hello, community, I faced with the problem to get errors if call custom action OnExit="error" from msi, is it possible to get errors codes and errors messages from c++ code for example to report the reason why installation failed? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Are you looking in the install logs?
Then you should get a log file with all the available log messages for the issue. If you have a particular WiX Extension Custom Action that is giving you issues, then you'd probably want to mention that specifically, and provide your authoring, and the full log file. It's possible that there's some benefit to be found in adding more logging to something, but you likely need to take this up yourself, and raise a Pull Request to add the extra log information. |
Beta Was this translation helpful? Give feedback.
-
@bevanweiss hi, thank you, I would like to run custom action implemented in c++ code and get errors list if installation ended with errors and report to any service to understand if any problems with installer |
Beta Was this translation helpful? Give feedback.
-
@bevanweiss thanks, can I get errors for example from Wix4RemoveFoldersEx custom action if any errors I am trying to say that I have custom action which run OnExit="error" from msi, in this custom action implementation(c++ part) I would like to read all errors which happened during installation and send them for example on crashlitics service, the main question how to get a reason(error and error message) why installation failed, for example |
Beta Was this translation helpful? Give feedback.
Wix4RemoveFoldersEx is an existing WiX custom action. So you can look at the code to see exactly what it will give you.
https://github.com/wixtoolset/wix/blob/ce73352b1fa1d4f9cded10a0ee410f2e786bd326/src/ext/Util/ca/RemoveFoldersEx.cpp#L131-L261
For almost all of the WiX C++ custom actions there will only be one actual error.
The first error that occurs will generally log that code to the log file, and then exit that function with an error.
Which will be seen by the calling function, which will exit.. and this will continue back until it's at the root of the CA, which will exit with a failure.
That will then potentially cause a rollback to occur.
Again, various WIN32APIs provide bad error…