Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an executable file for another machine\OS

Status
Not open for further replies.

TiltingCode

Programmer
Apr 10, 2009
61
US
I just started a new job and have been given the task of creating a VB6 executable which someone will eventually install on a client's machine in another location (out of state). This exe will probably replace an exe which we originally installed so I imagine any other pertinent files are already on the target machine. So, my question is can I simply compile the new exe on any machine and copy it over to the target or do I need to compile it on a PC with the same operating system and anything else I may be over-looking?
 
The biggest trick can be getting the old application cleanly off the old machine, which depends on how some plinker may have shoehorned it on there in the first place.

For simple programs created using the "Standard" subset of VB6 the Packaging and Deployment Wizard is usually adequate for creating a viable setup package to run on the target system.

This was replaced in 1998 and 1999 by Visual Studio 6.0 Installer 1.0 and then 1.1 for programmers using Professional and Enterprise editions.

There are also a number of free and for-pay 3rd party packaging products: some simple and easy, others complex, and a few that can be hazardous unless you really know what's what.

You'll be better off uninstalling the old program first in most cases.


As long as you adhere to the application development guidelines for Windows that came out while Windows 95 was still a current OS, you'll have no issues as long as you avoid anything introduced after your target OS came out. Even then in many cases Microsoft provided redist packages to add a few newer features after the fact.

However a lot of casual plinkers tended to do silly things that violate the guidelines. This is one major source of problems when moving between Win9x, older systems like XP that let you get away with pretending you are on Win9x via appcompat, and modern versions of Windows that enforce more of the development guidelines.


But a professional programmer who has kept up with things won't have many problems. It's the kasual koder who gets stuck.
 
Thanks for your reply, dilettante, but I don't think it should be that difficult as I under the impression I only have to create another exe and copy it over. It's the OS on my machine (Windows 7) and the target machine (I don't know the OS yet but I think it may be XP) I'm concerned about. Is it possible I only have to run VB6 in XP mode and make a new exe (if their OS is XP)?
 
Compiling an app written on a Win 7 32 bit machine should work on an XP as long as you use only the controls provided by Microsoft. You might have problems with some third party Activex controls.

You can get odd things running it on a Windows 98. For instance the rich text control on Windows 98 needs a carriage return and line feed (vbcrlf) to start a new line but only need Carriage return (vbcr) on later OSs. Text sizes may come out differently.

If in doesn't work, install Vb6 in the XP and compile it there.

You can't just copy the exe file. If no other VB program has ever run in the XP machine, you have to properly install it with PDW or similar as already suggested otherwise some of the system files will be missing
 
Oh and in my Win7 machine I also run my VB6 exe in XP Compatibility mode with admin access
 
Of course there is the ADO binary compatibility break in Win7 SP1 to consider of course.

See An ADO-based application that is compiled in Windows 7 SP1 or in Windows Server 2008 R2 SP1 does not run in earlier versions of Windows.

These kinds of things are rare though.

Still, VB6 has really not been an appropriate tool for the casual plinker for a long time now. You need to stay on top of platform changes and it is now very late in the game to be asking questions like this one.

That's where VB.Net and ClickOnce installs come in.
 
If you can't get the program generated by compatibility mode to work, switch to an XP mode VM on your W7 machine. This is 32-bit XP. Just install VB6 there and build and it should work because you are now doing 32-bit XP to 32-bit XP.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top