A scripting language for
In most cases you can create a complete setup package in Visual Installer without any programming. But if you are a programmer and want to fine-tune your installation there is a powerful scripting language included in the Professional version of Visual Installer that you can use for that purpose. Also if you are not a programmer you can use the scripting language in Visual Installer if you need; it is very intuitive and easy-to-use.
Before installation or after installation
You can choose to execute the script commands before the installation starts or after the installation has finished. If you for example want to backup some files before the installation starts you can use the script language for this purpose. And if you for example want to duplicate some files, rename files, create folders for specific Windows versions, or just run an external program file after the setup, you can execute script commands in Visual Installer to achieve this.
Script commands for various purposes
There are script commands included in Visual Installer for very various purposes. They can for example be used to copy or move files, to create, rename or delete folders, to add shortcuts to Windows Start menu, execute program files, execute Windows commands (via the command interpreter), show information boxes, handle errors etc.
Conditional execution of script commands is supported
It is possible to do conditional execution of script commands in Visual Installer. If you for example want to execute some script lines only in Windows 7, and not in other Windows versions, it is possible to achieve this by using a condition. The example below shows how such a condition can look like:
The first line checks if the setup program is running in Windows 7 or not. If the setup program is running in Windows 7 then the next line with script is executed; the MyWin7App.exe program is run. %DESTDIR is a variable that contains the destination folder for the installation. There are lots of other variables that can be used together with Visual Installer's scripting language.
Conditions can also be used to check which version of Microsoft .NET Framework that is installed in the end-user's computer. By using such a condition you can create script that is only run if a specific version of .NET is installed in the system. This is useful if you for example want to start a .NET application from the setup package that requires a specific version of .NET Framework.
More information about the scripting language in Visual Installer is available in Visual Installer's User's Guide (PDF, opens in a new window). See the Script commands - Overview section in the book to read more about the scripting language in Visual Installer. You can also read this tip in our Tips & Tricks section for more details.
< Go back