VB6 + OCXs
Previous Top Next

clip0153

Visual Basic Developers can use Thinstall to link needed parts of the Visual Basic Runtime and 3rd Party OCX files directly into their EXE.

The new EXE:

· Runs without extraction of DLLs, OCXs, or data files on "fresh" installs of Windows 95 & 98 and up.
· Runs with zero installation process.
· Runs without "registering" OCX & ActiveX controls.
· Can be run directly from CDROM.
· Can be run from any user account, even if system registry access is denied.
· Runs even if VB Runtime files are deleted or corrupted.
· Runs even if ActiveX Controls are unregistered, deleted, or corrupted.
· This demo uses VB5, VB6, and C runtimes all in one EXE


An Example Application

Below is a screenshot of a sample VB Application created by Thinstall, this program can be run directly from the download link with no installation. Download here: http://thinstall.com/examples/vb6_demo.exe
(4.5MB)

Screenshot:

clip0225
How to package your application using Thinstall

1. Download the Files you need


1. Download & Install Thinstall Studio, there is a free 14 day trial located at:
http://thinstall.com/downloads


2. Download & Unzip this sample VB6 Application that was packaged with Thinstall, it contains all the VB Runtime Files your application needs to run.
http://thinstall.com/examples/vb6_demo.zip
(4.9MB)

Inside the ZIP file are the following files:

1,871,613 codo.ogg Ogg Vorbis Music File, loaded transparently from
archive by Vorbis DLL
104,564 splash.bmp Splash Screen shown by Thinstall while loading program
318 start.ico Virtual data file loaded transparently from archive by VB program
318 Stop.ICO
32,768 Vb6Demo.exe Main program compiled with Visual Basic 6 (used several controls)
24,075 vb6_demo_project.tsp Thinstall project file for building single-file EXE


ogg_vorbis_runtime/ Files in this directory provide Ogg Vorbis to the application
995,383 MFC42.DLL
766 MFC42.DLL.threg Virtual registry file allows MFC provided ActiveX controls to be
used without system registration
290,869 msvcrt.dll C Runtime DLL needed by Ogg.DLL
49,152 ogg.dll Ogg runtime used by OCX
57,344 OggOCX.ocx Provides Ogg ActiveX interface to VB programs
2,782 OggOCX.ocx.threg Virtual registry file recorded by Thinstall - makes it appear
as if the ActiveX control has already been register on the system
No system registry changes are required to use
974,848 vorbis.dll
28,672 vorbisfile.dll


vb6_runtime/ Files needed by Visual Basic 6 programs, linked by Thinstall
74,960 advpack.dll
147,728 ASYCFILT.DLL
22,288 COMCAT.DLL
1,047 COMCAT.DLL.threg Virtual registry script, exposes comcat.dll ActiveX controls
608,448 COMCTL32.OCX
54,211 COMCTL32.OCX.threg Virtual registry script, exposes comctl32.ocx ActiveX controls
140,488 comdlg32.ocx
5,490 comdlg32.ocx.threg Virtual registry script, exposes comdlg32.ocx ActiveX controls
1,388,544 MSVBVM60.DLL Main DLL for Visual Basic 6 program
14,740 MSVBVM60.DLL.threg Virtual registry script, exposes msvbvm60.dll ActiveX controls
626,960 Oleaut32.dll
20,069 Oleaut32.dll.threg Virtual registry script, exposes oleaut32.dll ActiveX controls
114,960 OLEPRO32.DLL
0 OLEPRO32.DLL.threg Virtual registry script, exposes olepro32.dll ActiveX controls
16,896 STDOLE2.TLB Type library used by ole

xfxFormShaper/
26,624 CTL3D.DLL
1,347,344 MSVBVM50.DLL Visual Basic 5 runtime
6,861 MSVBVM50.DLL.threg Virtual registry script, exposes msvbvm50.dll ActiveX controls
15,872 xfxFormShaper.ocx OCX provide shaped windows
3,205 xfxFormShaper.ocx.threg Registry script, exposes xfxFormShaper.ocx ActiveX controls


(Virtual Registry Files contain a list of registry keys that would normally be installed onto the user's system, however using Thinstall these registry keys only exists inside your application and system remains unmodified. You can
record your own Virtual Registry Script for any OCX or DLL files that contain ActiveX / COM components).



Linking your own Application

The easiest way to link the VB Runtime with your EXE is :

Please use Thinstall version 2.203 or higher
1. Copy the directory vb6_runtime/ to your application directory
2. Run Thinstall and specify your application directory to the New Applicaiton Wizard
3. Click "Build!"

Since some of the VB Runtime and extra files may not be needed by your application you can experiment with deleting files from the project to produce smaller downloads. Be sure to test changes on Windows 95 First Release - since this version of Windows has the least number of required files pre-installed.

Adding Additional ActiveX Controls

To link & and use an ActiveX control without system registration, visit this help page. ActiveX controls (DLL & OCX) files linked with Thinstall do not need to registered on the end user's system when you record a virtual registry script.

Adding a Splash Screen

it is a great idea to add a loading Splash Screen to your application. This is displayed by Thinstall while your program is loading into memory. A Splash Screen makes your application look more professional and let's the user know what is going on slow machines.

For details on adding a splash screen, visit this help page.


Best File Options for VB Runtime Files

Thinstall has a number of options that can be set for individual files. It may be confusing when options you should use. For Visual Basic Applications, the follow file options work best:

Read Order - Always read from internal version
This option enhances your loading speed because Thinstall will not check for an external DLL while loading. It also eliminates the possibility your application might try to load a DLL copied into your program directory which is not compatible.

Visibility - Invisible to Shell Components
This option keeps the Virtual Files from appearing in any File Open type dialog boxes that are displayed to the user. Since the Virtual Files do not exist on the hard drive, it might be confusing for the user to see them inside the File-Open dialog.

Visibility - Visible to Search/Enum Request
This option allows files to remain hidden from program request that try to enumerate files inside the archive. From time to time, a program may try to see if a file exists before opening it, and this option could cause the first operation to fail. For best compatibility, you should leave files visible to Search/Enum Request. If you have a specific file that you are concerned about security / hacking, you can change this to "Invisible to Search/Enum".

Extraction / Caching - Never Cache or Extract
This option tells Thinstall the files inside the archive never need to be written to disk. If you package data files inside the archive that you are expecting to write to with your program, then you will want to investigate the other options.


DLL/OCX Registration - No Extraction / No Registration
If you have already recorded a virtual registry script for your DLL/OCX (.threg file), then choose this option. Your DLL/OCX does not need to be registered on the user's system because the registry keys already appear to have been created inside your application.
If you are developing your own OCX / DLL control, you may want to select the option "Record Registry Script during build". This rerecords the script file every time you click Build, allowing any registry changes that occurred during development to be captured.

Module Search Path - Use normal EXE/DLL/OCX Search Path
This option tells Thinstall to search for DLLs using the normal system DLL search order. The first path in the system search order is %InstallPath%, meaning your DLL will always be loaded.