Navigation:  Program Reference > Files >

Installing Files

Previous pageReturn to chapter overviewNext page

The main functionality of a setup program is to install files. To install files is not a simple task, like to copy files to directory. Many other operations are done during this process, like the verification if you can overwrite an existent file, the registration of a shared file in the shared files' table, the registration of an ActiveX file in the Windows Registry, etc.

 

The first question you must do is: what are the files I need to distribute?

VisualSetup can help you to answer this question. VisualSetup can automatically determine the files your application needs to run, you just need to execute one of the Wizards available in the IDE to import your application's project file to the setup project. For more information about the available Wizard, read the Wizards topic.

 

Some files that you need to distribute with your application will not be automatically added to your setup project:

 

Your custom DLLs or components that you dynamically call/create from your application.
Third-party DLLs or components that you dynamically call/create from your application.
True-type font files you use.
Data files that you need to execute your program.
External resource files you use in your program, like bitmaps, sounds.
Help file, license agreement, PDF documentation.
Etc.

 

It is very important to plan your setup project, and the first step is to list the files you want to be installed. The second step is to determine where the files will be installed. Normally the files will be installed to a directory referred by a variable. The operational system directories are not fixed, it will depend where your end-user installed the operational system and the operational system's language. Also, the main directory of your application, where will be located the main executable file and the data files, named installation directory, is not fixed, you must let your end-user choose where the application will be installed. The main directories' variables are:

 

Variable

Path (supposed values)

%InstallDir%

C:\Program Files\%SofwareName%

 

This is the directory where your application files will be installed. The end-user must to be able to choose this location during the setup wizard.

%WinDrive%

C:

 
The drive that Windows is installed.

%MyDocumentsDir%

C:\My Documents

%ProgramFilesDir%

C:\Program Files

%ActiveSyncDir%

C:\Program Files\Microsoft ActiveSync

%CommonFilesDir%

C:\Program Files\Common Files

%HotSyncDir%

C:\Program Files\HotSync

%PalmInstallDir%

C:\Program Files\HotSync\%HotSyncUsers%\Install

%WinDir%

C:\Windows

%DesktopDir%

C:\Windows\Desktop

%FontsDir%

C:\Windows\Fonts

 

The directory where the font files are installed.

%HelpDir%

C:\Windows\Help

%StartMenuDir%

C:\Windows\Start Menu

%ProgramsDir%

C:\Windows\Start Menu\Programs

%ProgramGroupDir%

C:\Windows\Start Menu\Programs\%ProgramGroup%

%StartUpDir%

C:\Windows\Start Up

%SysDir%

C:\Windows\System

 

The directory where the system files are installed, like runtimes and the third-party components.