Hi Team,
I need to code in Advance Installer tool to fail the MSI when it find MSIError.log present in a specific path while the MSI is executing. Please let me know how to get this done from Advance installer.
Code: Select all
MSIERRORLOG_PROPHi Catalin,Catalin wrote:Hello,
In order to achieve what you want, you can firstly create a file search and use that search in a launch condition which will condition the execution of your setup based on the search result (if that search fails, it means MSIError.log was not found, thus your installation should continue, otherwise it will fail).
Here is a step-by-step you can follow in order to achieve this:
1) Go to "Search" page from the "Custom Behavior" group and create a new file search by clicking the "New File Search" from the toolbar.
2) Press the "..." button from the right side of the "Name" field to configure the search location. After doing so, you can rename the property which stores the result of your search by right clicking on the search --> "Rename". You can rename it to something more meaningful like:3) Now we have to create a custom lunch condition which will continue the installation only if the "MSIError.log" is not found. To do this, you can go to "Launch Conditions" page --> "Custom" tab --> press the "New..." button and enter the following parameters:Code: Select all
MSIERRORLOG_PROP
-Condition: NOT MSIERRORLOG_PROP
-Description: you can create any description which will detail the failure of your installation.
Hope this helps!
Regards,
Catalin
In this case, you can use a "Display error message" custom action. If the file is found, then the error message will be displayed, thus your installation will fail. In order to achieve this, you can go to "Custom Actions" page and add a "Display error message" custom action. In order for this to work, please make sure to add your "Display error message" custom action after the custom action that creates your "MSIErrorLog".Hi Catalin,
Thank you for your reply. "Launch Conditions" will work when the MSI start executing, but the MSIError.log will be created based on one of the custom action. From the custom action execution, the MSIError.log will be created. If the "MSIError.log" is found, then stop the installation of MSI.
FOLLOW US
Get the latest news in Application Packaging