Lesson 36: Compiling & Distributing VB Applications

Package and distribute your VB6 applications professionally

Key Takeaway

Proper compilation and distribution ensure your VB6 applications run smoothly on users' machines without requiring the VB development environment.

Welcome to Lesson 36 of our Visual Basic 6 Tutorial! In this lesson, you'll learn how to compile your VB6 applications into standalone executables and create professional installation packages for distribution.

36.1 Compiling Your Visual Basic Program

Once you've completed and tested your VB program, you can compile it to run as a standalone Windows application without needing the Visual Basic IDE. Before compiling:

Debug Thoroughly

Ensure your program is error-free before compiling

Create EXE

Generate a standalone executable file

Protect Code

Compiled code cannot be modified or debugged

Compilation Steps:

1 Access the Compile Menu

Click on File and select Make Project1.exe to begin the compilation process.

2 Configure Output

In the Make Project dialog, assign a filename and select a save location for your executable.

3 Set Project Properties

Customize your program details including title, version, and company name.

4 Choose Compilation Type

Select Native Code for best performance and click OK to compile.

Compile Menu
Figure 36.1: Accessing the compile option
Save EXE Dialog
Figure 36.2: Saving the executable
Project Properties
Figure 36.3: Project properties configuration
Compilation Options
Figure 36.4: Compilation options

Important

Always choose Native Code compilation for optimal performance. Once compiled, you cannot debug the application - you must debug in the IDE before compiling.

36.2 Distributing Your Programs

After compiling your application, you'll need to create a professional distribution package for users to install your program on their computers. VB6 includes the Package and Deployment Wizard to create installation packages for CD/DVD or online distribution.

Distribution Steps:

1 Launch the Wizard

Start the Package and Deployment Wizard from the Visual Basic tools menu.

2 Select Project

Choose the VB project you want to package for distribution.

3 Choose Packaging Type

Select Standard Setup Package for typical installations.

4 Configure Package

Set the package destination folder and include all required files.

Package Wizard
Figure 36.5: Package and Deployment Wizard
Packaging Script
Figure 36.6: Choosing a packaging script
Package Type
Figure 36.7: Selecting package type
Package Location
Figure 36.8: Setting package destination

Best Practice

The Package and Deployment Wizard automatically includes all necessary runtime files and dependencies. Always test your installation package on a clean machine to ensure all dependencies are included.

Sample Distribution Files

Lesson Summary

In this lesson, you've learned the complete process for compiling and distributing VB6 applications:

Compilation Process

Convert your VB project into a standalone executable file

Distribution Packaging

Create professional installation packages for end users

Package Wizard

Use VB6's built-in tool to create complete installation packages

Testing & Validation

Ensure your application installs and runs correctly on target systems

Pro Tip

Always test your installation package on a clean Windows installation to ensure you've included all necessary dependencies and runtime files.

Next Lesson

Continue your VB6 journey with Lesson 37: Creating Professional Menus.

Related Resources

VB6 Deployment Guide

Official Microsoft documentation for VB6 deployment

View Resource

Advanced Packaging

Learn custom installation package techniques

View Resource

Dependency Checker

Ensure all required files are included in your package

View Resource

Digital Signing

Learn to sign your executables for security

View Guide