views:

150

answers:

4

hello,

I have heard about portable applications, i like to make some of my utility application portable. Does any one know if it it possible to make an app developed in vb6 portable.

I plan on replacing most controls with usercontrols, thereby no need for most MS activex controls except the runtime files.

any ideas?

[EDIT] When i mean portable, i mean noon need for installation, and mostly a single exe or at most all files needed by this application reside in the same directory

+2  A: 

I think at least XP and newer versions of Windows all include the VB6 runtime libraries, so unless you want to run your application on older Windows versions it should be easy enough to make it portable.
Just include any DLLs etc it depends on and make sure that it doesn't store it's settings to the registry or similar.

ho1
Avoiding the use of the registry for settings... good catch!
Bob Riemersma
A: 

If I understand what you want (a sort of XCopy deployment similar to .NET apps), this is highly unlikely. VB6 and applications developed in it are highly dependent on COM. If you use any ActiveX or COM components in your application, they'll have to be registered with the operating system, so a Setup application will have to be used to configure it.

Now, that's not to say it isn't possible, and I'm sure there are ways to get around it (maybe a small pre-check app that verifies your main app's components are registered before launching it). But right out of the box, no. My experience has been that VB applications had to be installed with a setup program.

Mike Hofer
VB6 apps aren't by default dependant on any ActiveX or COM components, only if they've been added to the app, and he did mention that he's replacing those he has used with normal user controls. Most of the VB6 apps I worked on didn't use any COM/ActiveX, so I usually did something similar to XCopy deployment (assuming that the VB runtime files existed on the PC, but this is much less likely to be an issue nowdays).
ho1
+3  A: 

While NT 5.0 was being developed Microsoft was working on what became known as Registration-Free COM, and one application for this was VB6 programs.

Reg-Free COM was not ready when Windows 2000 was released, but was featured in NT 5.1 (Windows XP) and later. However by then VB's fate was to be shelved, so we never got a "VB7" toolset supporting VB developers.

It is still alive and well though, and XP SP1 and SP2 as well as VB6 SP6 incorporated improvements in Reg-Free COM for VB6.

The upshot is that you can create portable (XCopy-able) VB6 applications for Windows XP and later, you just have to struggle with tools from later versions of Visual Studio that aren't very VB6-friendly or use a 3rd party tool. These generate appropriate isolation manifests and optionally embed them as manifest resources.

Look here under Reg-Free COM or try a search engine to find some of the tools available.

Bob Riemersma
Avoid placing COM libraries "next to" a VB6 EXE. Put them in a subfolder. Otherwise you risk the VB6 runtime registering them in place on first linkage, which can result in flawed registration pointing to your removable device or application folder. This can break other applications when yours is removed!
Bob Riemersma
+1 There are some 3rd party tools suggested here, for instance "make my manifest" http://stackoverflow.com/questions/270523/vb6-xcopy-deployment
MarkJ
A: 

I found 1 program, it will create a file with uzy extension. but the program seems contain a virus, my antivirus will delete it. I forgot the name of the program

hasan
this is not helpful it the program contains a virus
Smith