Where to Install Files on the User's Machine

See Also16WVDFO

Each Visual Basic application requires at least two files the .EXE file and the run-time file VBRUN300.DLL.  Your application probably requires additional files.  Before writing your setup program, you must determine where on the user's disk you want to install each file.  The files that your application requires can be divided into several classes:

         Program files

         Initialization files

         Operating-system components

         Shared application resources


Program Files

These files are essential for your application and are useful only in the context of your application.  For example, your application's .EXE file and data files are considered program files.  Program files should be installed in the application directory.  The user is prompted for this directory during setup (sample code for this is included in SETUP1.MAK).

Initialization Files

These files control options for the user of an application.  Initialization (.INI) files should be installed in the user's Microsoft Windows directory, which is the directory in which the WIN.INI file is located (usually in the \WINDOWS subdirectory).  You determine the name of this directory on the user's disk by calling the GetWindowsDirectory Windows APIDEFAPI function.  The code in SETUP1.MAK shows how to call this function.

Operating-System Components

These files are normally included with Microsoft Windows, but you may want to distribute them with your application to ensure that the user has a particular version of a DLLDEFDLL, such as OLECLIEN.DLL or SHELL.DLL.  You should install such files in the \SYSTEM subdirectory of the user's main Microsoft Windows directory.  You can determine the name of this directory by calling the GetSystemDirectory Windows API function.  The code in SETUP1.MAK shows how to call this function.

Shared Application Resources

Application resources can be shared by more than one application.  For example, several different vendors may ship applications that use the same custom control.  By installing .VBX files in the \WINDOWS\SYSTEM subdirectory, you can ensure that all applications use the most current .VBX file.