How to Make VB Program (Setup) Run On Every PC & O/S?

I developed a Database application using VB6 which runs and installs fine on my PC with Windows 7 64bit but after setup on another PC with the same Widows 7, it installs but cannot run.
How can I make it run fine on every PC O/S either Windows XP or 7, etc. System32 or 64bit?
Thanks.

I'm not absolutely sure about the answer to this question but I would like to follow this thread myself. I believe that the answer has something to do with downloading the latest drivers for your operating system. Possibly updating to the latest service pack for your OS. Thank you for asking this question because I believe that we all need to know the answer to this. Is it possible that we might have to compile our apps in every OS environment individually? That is what I think must ultimately be done. I will be following your thread with great expectations. Good luck.

Help the community by fixing grammatical or spelling errors, summarizing or clarifying the solution, and adding supporting information or resources. Always respect the original author.

Popular White Paper On This Topic

I'm not absolutely sure about the answer to this question but I would like to follow this thread myself. I believe that the answer has something to do with downloading the latest drivers for your operating system. Possibly updating to the latest service pack for your OS. Thank you for asking this question because I believe that we all need to know the answer to this. Is it possible that we might have to compile our apps in every OS environment individually? That is what I think must ultimately be done. I will be following your thread with great expectations. Good luck.

A few more thoughts on your question: a 64bit application will not run on a 32 bit PC, however, a 32bit app will work on a 64 bit PC that has been compiled in the same OS. Another thought is that you want to develop a program for the largest group of users. There are some third party programs that try to make apps compatible with other OS environments with some success.

Do you have any error logging mechanism to tell you what is going wrong?

How are you installing the app?

You really shouldn't have many issues from version to version of Windows, and since VB6 only creates 32 bit executables you won't have any issues with x68 vs. x64.

Most likely there is some external resource that you use that's not being distributed correctly, or you have something hard coded on your machine, that's not available the same way on the target machine.

There are 2 ways to make a program so that it will run in either 32bit or 64 bit OS.
1. have 2 compiled versions and let the user select the version they need
2. compile for the lowest common denominator (32bit OS)

You mention that it cannot run but you do not indicate the reason why it will not run. Is because you have 64bit code on a 32bit OS or is because of some security or trust certificate issue?

I have had my vb6 programs work on all versions of Windows. I have compiled on XP 32bit, Vista 32bit and now I compile on Windows 8 64bit

A few years ago I decided to add some functions that were not available for Windows 2000 but that is not important now since it works on XP, Vista, 7 and 8 (even on starter versions) all of these on 32 or 64 bit variants.

There were some cases where initially my programs would not work and here is what I did.

1) For Windows Vista, 7 and 8 you need to Run as Administrator
You may need to change advanced properties every time you reinstall.

2) In some cases you also need to install a VB6 Runtime update downloaded from Microsoft?s website

3) Less likely you need to install some dlls and ocxs yourself like MSCOMCTL.OCX

Before you can install or run programs developed in Visual Basic, you must first install the "Visual Basic Runtime". Just install it once usualy you will need to search on google and download file VBRun60sp6.exe. I guess its now time to switch to either VB.Net or C Sharp. Working with old and outdated technologies will get harder and harder when it comes to compatibility issues. Can VB6 Apps run on Windows 8 ?

I'm sure Rob Crombie will jump in at some point, bemoaning the issue of dependencies of your run-time and creating apps that are independent of other components, but the bottom line is that it happens. (Sorry Rob to spoil your thunder :-)

As most people have said, there shouldn't be an issue if you follow the guide lines. Jorgearr's list is pretty good, but you also need to ensure that you:
a) use up-to-date database technologies as there are problems with trying to installing legacy DLLs on system that already have a newer version installed. It's the "I've got a later version already, I'm not going to install that older version" symptom.
b) use a 'sensible' installer that understands about dependencies and COTS type OCX dependencies such as ADO drivers etc.

Then it's a matter of testing on various clean machines. Using a virtual machine is good for that. As Rob Lee's implied - is there anything wrong at the moment? Chasing an invisible problem will waste a lot of time.

Jorge and Dennis,
All versions of Windows since W98SE have the VB6 runtimes, so you do not need to install them.
Additionally if you stick with SP5 in your VB6 IDE, you never have to worry about what version of the SP the user has on their PC.
I have never had to install a runtime in any XP or Win7 PC

It has to be said that VB6 isn't fully compatible with Windows Vista and Windows 7 any other statement would be misleading. I have had a lot of problems with my Old VB6 App and immediately switched to C Sharp the learning curve was rather tiring though, but now I am very comfortable. Some of the issues I have had with my old VB6 app in Windows Vista and Windows 7 is sockets communication, I think this is due to hardened security in Vista and Win 7. VB Apps seem not to work well. My Notify Icon on System Tray used to hang in Windows 7 and vista even when I exit the app but works well in Windows XP. A friend of mine had issues installing VB6 IDE on Windows 8 that's when I learned that The Visual Basic 6.0 IDE is no longer supported as of April 8, 2008 by MS. Displaying a Form in Windows 7 and Windows 8 does not translate to full compatibility of VB6. There are more issues than that for example Data Connections(ODBC, ADO etc). Some third party libraries that were shipped with VB6 and could be included during compilation may not be in the interest of Microsoft Support that too could bring serious issues in modern OS. Having said that the bottom line is that VB6 is obsolete its time to start moving on.

I was not referring to running the VB6 IDE in those OS's
Good advice for developers would be to minimize as much as you can. the use of dependencies, so you have less problems with MS's disregard for backward compatibility. (But they do have advice on their web site, regarding those pesky controls/dependencies.)
Some other issues with the running of apps in Win 7, can be solved with the compatibility settings.

Well I just tried installation on Win Xp.
It installed fine alright but when I run it I got a message:
Component "Crystl32.OCR" or one of its dependencies not
correctly registered: a file is missing or invalid.
And on Win7, an error message: lvButton not properly registered.
What should I do please? Though I have registered all OCRs and Dlls.
Help me please.
Thanks.
Godwin.

On your development machine, create a tiny project, and only have your lvbutton and Crystal as dependencies.
Compile that program to an EXE.
Use the P&DW (Package and Deployment Wizard) to make your installer. It is in the Start Menu, in the VB folder, in the Tools folder (When I say folder, I mean the Start Menu drill down entries).
If you know how to image your drive, create an image of your XP system first, then run the Installer. Then see if the tiny program runs OK.
Rob
PS By imaging the drive, that allows you to experiment, and then undo the installs.
Once you have worked out how to do it all, you can make a single installer, with the program of your choice (P&DW or ???)

I'd personally never install the installer on a development machine, since this will remap all of your DLLs and OCXs to the installation folder, instead of the original files, and getting the originals back can be a real nightmare.

Use a Virtual Machine for this (I use VMWare, but Virtualbox is a good free one). The benefit of a VM is that you can test changes, and then immediately revert the machine.

Sorry if it sounded like I was suggesting running the Installer on the development machine.
During the whole history of time, I have never done that, and in fact I have never even thought of doing that.
Hold a gun to my head, and I still would not do that.

.NET assemblies (VB.NET, C#, etc) can be decompiled, but there are ways to work around it, and overall it's not an issue if you don't want it to be (there are plenty of companies selling .NET apps and libraries).

A good obfuscation tool will make the decompiled code pretty much useless (or at least make the time to sort it out not worth the effort involved).

This is an issue of third party Libraries be aware that OCX do not register by default in most cases. This means that within your application you have to be aware which ones are third party libraries and register them manual using the REGSVR32 command. Take caution though that you are aware of your platform being 32bit or 64bit. Visit this link to learn about registering libraries http://support.microsoft.com/kb/207132/en-us

Before you begin registering Crystal32.OCX confirm these files are available on your PC. These are the dependencies being talked about.

Before I take you on this one, we need to come to the same level of understanding on this subject. By this I mean is, you should be aware and agree that every code is crackable even native code can be cracked and it has been cracked even Microsoft, Adobe and Symantec agree to this. So there is nothing that cannot be decompiled. Lets move on. All we do sometimes is to make that process a little more difficult. There are several procedures in place. The advantages of modern technologies over old ones in this case VB6 vs C# .Net Is that, the modern solutions have learned and been cleaned from the passed weaknesses. In .Net for example there are several tools that we use to lock an App from being easily decompiled. The procedures vary and sometimes can be costly. Dotfuscator is one a free edition and ships with Visual Studio, developed by PreEmptive Solutions. It is a post-development recompilation to make reverse engineering of .Net Apps difficult. You compile your application twice. The beauty about it is that it also reduces your exe file size in the process. Read about free more obfuscation tools here for .net http://twit88.com/blog/2007/09/15/free-net-obfuscation-tools/.

One of the most popular tool used to decompile .net apps is REFLECTOR. Reflector has problems decompiling Dotfusctor obfuscated exe files. You cannot stop piracy but you can complicate the process.

May I ask how you intend to install your app on another machine. There seems to a lot of code being suggested but if you're using a proper install (Inno, Wise, Install Shield or even (god forbid) PDW), it will take care of lot of the 'built-in' DLLs/OCXs. You only then have to cater for the third party ones like Codejock.SkinFramework.v15.0.1.ocx or b8Controls.

I notice that you're mentioning DLLs like asycfilt.dll and COMCAT.DLL.

NEVER EVER install these on another machine manually. You can cause the system to become totally unstable and crash forever! That's why, if you're using third party OCX's etc., you need a proper install program that'll do all the hard work for you.

Thanks but please I greatly need best solution
to my recent problem.
Can you give me files or components for
Crystl32.OCX that is causing my problem?
Also I developed the program using Win7 64 bit,
can it run on all windows such as XP, 7 & 8?
Waiting for your good solution please.
Godwin.

Sir Jorgearr,
Please I am waiting for your solution so as to be able
to install it on all platforms including 32 bit and 64 bit
either WinXP or Win7 or Win8.
I need components dependencies for Crystl32.OCX
and others to make all components (OCX & Dlls) work
better.
Thanks and waiting for your best solution.
Godwin.

You asked to have these files on my system
before registering Crystl32.OCX
But I do not have them, so do please kindly send it to me ASAP
ADVAPI32.DLL
COMCTL32.DLL
COMDLG32.DLL
CRPE32.DLL
GDI32.DLL
IMPLODE.DLL
MFC42.DLL
MSVCRT.DLL
MSVCRT20.DLL
OLE32.DLL
OLEAUT32.DLL
OLEDLG.DLL
OLEPRO32.DLL
USER32.DLL
VERSION.DLL

My program is developed on Win7, 64bit.
Can it be installed on any system such as: WinXP, Win7 or 8
and 32bit and 64bit?
Kindly help me ASAP so that I will be able to install the program to my clients.
Thanks a lot.
Godwin.

Thanks a lot however when trying my program recently
I got an error that variable not defined though it was working fine
earlier this morning.
Codejock.SkinFrameworkv15
What and how do I solve it though it is registered in SysWOW64 & System32
Help
Godwin.

The code I gave you is your solution, just copy-paste on a vb6 module and do your changes then compile as installer, put the installer in a folder, put the listed dlls and ocxs in the same folder, copy the folder to your destination machine, double click on xp or right click and run as administrator on 7, 8. It should install your application. Then you can beautify it.

One suggestion, you should eliminate unnecessary files until you get them working fine. Probably you don?t need a skin to start with.

Also it seems that your problem is related to Crystal Reports installation, which you could install separatelly (with license), before your application. I am not an expert on Crystal since I mostly use DataReport for being free.

Hi godwinbarnes,
Don't think so much, just download (inno compiler installer from google) and
make it any exe files in seconds. I am also using this software and it will
work great. Just select setup file and script file and install where you
want. That's it. I hope you like it.

@rob,
Hi, I'm curious. Does the VB6 IDE work in w8? Word had it that MS will necessarily have to support the legacy VB run-times (just too much older windows sw at stake if they don't), but would make w8 and later in a way that the vb6 IDE wouldn't operate, effectively stifling legacy vb development using the new OS'.
Allan

Yes, I have downloaded the Dll fixer but the free ware
is not so perfect to fix all errors on my system and so still
problems not solved.
Do you have the registered copy of the DLL Fixer?
Kindly send it to me, please.
Thanks.
Godwin.

Yes, computers have unconditional Jump instructions... and the worst "spaghetti code" I ever encountered was written in Assembly Language by someone who used Jumps all over the place. Refactoring the code (a term that didn't exist for another twenty years) to use subroutines, sequential conditionals (the equivalent of a Select or Switch statement), and state variables was required just to be able to successfully debug the code.

One of the more useful rules for using unconditional Jumps was that the destination should always be down the page from the Jump instruction? unless you had a very good reason to do otherwise. This was pretty much the equivalent of the high-level language rule that we don't use GoTos unless we really have to.

Very early COBOL was filled with GoTo's. Then there was the Alter verb that coders used. I don't know how anyone ever thought of it unless memory restrictions and overlays were the cause. The Alter verb changed the destination of a GoTo.

For example, the code might say Perform ProcessRecords. The ProcessRecords code would then have a GoTo ProcessHeader in it to process a header record the first time through.

At the end of the ProcessHeader Subroutine would be the Alter Statement saying Alter ProcessHeader to ProcessDetail followed by the subroutine exit. Note, this was way before structured programming techniques and few subroutines were numbered.

After the Alter line and from that point forward, when ProcessRecords was executed for all subsequent records, the line of code that said "GoTo ProcessHeader" didn't go to the ProcdessHeader Subroutine. It went to the ProcessDetail Subroutine. 'Course nothing prevented another Alter from changing direction again to add even more confusion.

Between the Alter and overlays, early code could be truly difficult to debug when needed. I always worked very hard to remove the Alter every time I found it.

Please I have download them, Thanks a lot.
But there are some errors that needs to be fix
for the dll.
Do you a Dll files fixer - a registered version?
I download the free version but not so good.
Thanks and help me please,

One thing if you will search around on the web you will find most programs now have 2 yes TWO installers, one for 32 bit windows and one for 64 bit Windows. This is often due to the need for different data drivers for each version of Windows.

John,
I have wisely kept out of this thread (exception below in brackets), as my aversion to dependencies meant I rarely use Installers, and would be the least qualified to advise on their usage.
(EXCEPTION: Was my clarification that one does NOT need to Install the VB6 runtimes, as everyone should have them. And it may even be advisable to 'let sleeping dogs lie', and don't mess with the user's current runtime ? ? ?)

Regarding your last post, wouldn't one only choose the 32bit Installer, even if the target is a 64bit OS ?
My thinking is VB6 is a 32bit program . . . . .
(My thinking does not go much further due to my proclaimed lack of experience with Installers, but my gut is telling me to stick with the 32bit Installer.)

Rob, 32 but installer is fine with me, my thought on a 64 bit version of the install is for example if you are targeting Access 2010 64, does that need a different driver that the 32 bit version of Jet? I know in dot net (where I spend the bulk of my time now) there are differences in providers. I have also noticed that when downloading programs from the Internets these days that you often see 32 bit versions and 64 bit versions.

I think much of these issues will disappear in a few years as everything becomes virtualized but that is another subject :-)

Or 128 bit OS and applications are introduced. Then you will have to be concerned with 3 versions as there will still be folks that will still us XP until they have to buy a new PC and then complain about it not being XP. lol

I haven't supported 16 bit Windows 3.x since around 2000, I've forgotten can you get to data in Access 2.0 from JET that ships with Office 201+? Given the DOS and Windows 32 (FAT16/32) file systems will break in 2107, I suspect people will have moved off Windows XP by mid-century ;-)