How to create an INI file with settings in the main destination folder (Visual Installer)

With Visual Installer you can set initial settings for your application in different ways. One simple method is to store the settings in an INI file. INI files have existed since the first Windows version, and are still used today because they are simple to use and support all basic features for storage of settings that are needed.

In Visual Installer’s editor there is a dedicated tab that is used to handle data to INI files. The name of the tab is “INI files” and in the tab there are four buttons:

New file : Creates a new file.
Add section : Adds a section to the INI file.
Add value : Adds a value name and a value (for example a text string) to the INI file.
Variables : Shows a list of variables that can be inserted in the INI file.

To add/create a new INI file in your Visual Installer project, follow the steps below:

Step by step – How to add/create an INI file in your Visual Installer project

1. Open the “INI files” tab in Visual Installer’s editor.
2. Click the New file button in the “INI files” tab. The button is located in the bottom left.

The 'INI file' tab

3. Enter the filename of the INI file in the dialog box that is shown. E.g., “MySettings.ini“.

Create new INI file

4. Click OK.
5. A message box with a question is now shown, with the following text:
Do you want the INI file to be created in the main destination folder of the installation?
6. Answer Yes.
7. Now click the Add section button in the “INI files” tab.
8. Enter a section name. For example: “Directories“.

Add section to INI file

9. Click OK.
10. Now click the Add value button in the “INI files” tab.
11. Enter a value name and a value in the dialog box that is shown. For example:

Add value to INI file

12. Click OK.
13. The result, that is shown in the “INI files” tab, will look something like this:

INI file - Example

You have now created an INI file with some contents for your installation project. The INI file will be created in the main destination folder during the installation and the variables used in the INI file will be replaced with actual values when the INI file is created.

%DESTDIR that is used above is a variable that will be replaced with the installation’s main destination folder path during the installation. You can read more about %DESTDIR here.