In the previous two blog posts we described how to run a program or show a document after an installation, when running a setup package created with Visual Installer. It is also possible to run a program or open a document via Visual Installer´s script language.
One benefit of using script for running a program or opening a document is that you can use a conditional check before you run/open the file. You can for example run different versions of a program depending on which operating system the installation is run in. For example:
// Run only in Windows 11
In the same way you can open and show a particular document based on a condition. For example:
// Open and show only in Windows 11
The RUN command above (example 1) is executed immediately and the SHOW_AFTER command above (example 2) is executed when the installation is completed. Read more below.
Script commands in Visual Installer that run programs
These three script commands can be used to run programs during an installation:
XRUN : Runs a program – with additional options.
RUN_AFTER : Runs a program – when the installation is completed.
Script commands in Visual Installer that open documents
These two script commands can be used to open documents during an installation:
SHOW_AFTER : Opens a document – when the installation is completed.
The RUN, XRUN and SHOW commands are executed immediately, when the script line is executed, but the RUN_AFTER and SHOW_AFTER commands delays it execution till the installation is completed and the last setup dialog box has been closed.
The RUN_AFTER and SHOW_AFTER commands are new commands that were included in version 12.0.10 of Visual Installer (read more).