Sign In
Link to us
Home
1. Introduction
2. Introducing VB
3. Projects
4. Containers
5. Controls
6. Code
7. Forms
8. Debugging Code
9. Error Handling
10. Objects
11. User Controls
12. Data Projects
13. API
14. Distribution
 14.1 Distribution Files
 14.2 Installation Setup

Other Resources


Affiliated Links:
www.freefunfings.com


14. Distributing Your Application

Once you have completed the development and testing of your application, you are ready to create your distribution files. Visual Basic 6 includes a "Package and Deployment Wizard", which is used to create a unique "Setup" program for your application.

14.1 Distribution Files

The Distribution Files are those files that are generated by the "Package and Deployment Wizard". These are the actual files that you will copy onto the CD or floppy disks when you want to create an installable application.

During creation of your distribution files, the wizard will:

  • Verify compilation of the project (as required).
  • Prompt you for associated files that may not be part of the application, but need to be included e.g. A template database, or examples of files that your application generates.
  • Compress all of your application files (and other files included above) into one large file or several 1.4Mb files depending on your distribution media - CD or Floppy Disk.
  • Generate the "Setup.exe" installation file and gather information from you as to where to install the application and components.
  • Generate uninstall information files.
  • Generate a distribution script, which can be re-used to save you re-configuring the setup a second time.
Exercise:
  • Open the "Package and Deployment Wizard" by selecting Start -> Programs -> Visual Studio 6.0 -> Visual Studio 6.0 Tools -> Package & Deployment Wizard
  • In the dialogue window that appears, click the "Browse." button and navigate to the application we created in Exercise xxii.
  • Select the project file ("Project1.vbp") and click "Open".
  • Click the "Package" button. If you haven't yet made the project, you will be prompted to browse to the ".exe" file or compile the project. Click "Compile".
  • When asked what type of package you want, choose "Standard Setup Package" and click "Next".
  • Accept the default folder for the package to be assembled in - click "Next". You will be asked if you want to create the suggested folder - click "Yes".
  • A list of files will then appear. These are the files that the "Setup" program will install. You can add to this list of files using the "Add." button at the side. Click "Next".
  • You are then asked if you want to create a single cab or multiple cabs for use with Floppy Disks. A cab file (short for cabinet file) is a compressed data file; similar to a ZIP file. Leave the selection on single cab and click "Next".
  • Next, type in the Installation Title. This is the title that will appear on the target PC when the user installs your application. When complete, click "Next".
  • You can now decide where your application shortcuts should appear in the target PC's Start menu. These can be overridden by the user during installation. Leave the default option (Programs -> YourAppName) and click "Next".
  • The next screen is where you configure the install location of the files that you are distributing. Most of the files will probably be installed into the application's path - i.e. wherever the user has selected for the installation. Some of the files, however, you may want to be installed into the Windows or System folder. This can be setup here. Leave the default settings and click "Next".
  • You will then be asked if you want to mark any of the files as shared. During uninstallation, shared files may not be removed if the system believes that they can be used elsewhere. You may decide to make some DLL files or Controls shared, however, in this example, leave the checkbox unticked and click "Next".
  • The "Package and Deployment Wizard" then asks for a name to describe the script file. This script file will contain all of the selections that you have made within the wizard. It is not part of the distributed files, it is only for use by you should you decide to repeat the wizard. Click "Finish".
  • After a while, the wizard completes it's generation of the cab files and displays a report that you can save if you like. Click "Close". Also close the main wizard window.
  • In the Windows Explorer, navigate to the project that we created in Exercise xxii and open the "Package" folder that has appeared inside it.
Note:  Note that the wizard has created a "Support" folder. This is not necessary for the distribution, but contains the uncompressed versions of the files that the wizard used. It is only for backup purposes - you do not need to include this folder on your distribution media.

  • Run the "Setup.exe" program to install your application.

14.2 Installation Setup

The "Setup.exe" file is the actual program that installs your application onto a target PC. The "Setup.exe" program will perform several functions:

  • Determine where the user wants to install the application.
  • Verify system resources (e.g. Hard Disk space).
  • Unpack the compressed files and copy them onto the target PC at the location specified during creation of the setup or overridden above.
  • Register any controls and libraries used by the application
  • Create shortcuts in the Windows Start menu, as appropriate
Note:  Due to the uninstall information that the "Setup.exe" program stored, we can uninstall the application from the Windows Control Panels "Add and Remove Software" program.

Exercise:
  • Uninstall your application.

<<Page 13  :   Top  
©vbtraining.co.uk