Often it is nice to open a ReadMe file automatically at the end of an installation. In a script-based installation such as InstallScript MSI or InstallScript, this is an easy affair. But, how do you accomplish it in a Basic MSI installation?
It’s actually not that difficult. Let’s say we want to open the ReadMe file automatically when the user clicks the OK button in the Finish dialog at the end of the installation. To do this, we need an InstallScript function, a Custom Action, and a Behavior.
Let’s first create an InstallScript function that opens the ReadMe file.
The screenshot above shows the simple InstallScript function that opens Readme.rtf.
Next, we need a custom action that calls the InstallScript function.
This screenshot above shows the InstallScript custom action that executes the InstallScript function.
Now, all we need to do is create a Behavior for the OK button in the final dialog.
Here, we added a Behavior to the OK button of the SetupCompleteSuccess dialog. Remember, the behavior that executes a custom action is DoAction. Here, the Condition is set to 1 to always execute the custom action. Also notice that I have placed the behavior after all of the existing behaviors to ensure that it is executed last.