Updated 2012-01-03 23:06:43 by RLE

PT 15-Jul-2004 The standard installation of Microsoft Visual Studio is some 400MB. I recently needed to do some debugging on a machine that I didn't want to install VC6 on (because it can be hard to properly uninstall). However, if all you need is VC6 to compile stuff, then you don't need all the other stuff. Here is how. Note that my target was building tcl - if you are building something else you may need to copy a few more bits.

Create the following directory tree.
 vc6
|-bin
|-include
|-lib

Copy the whole of lib and include directories from your VC98\ to your new tree. Then copy from the VC98\bin directory to your bin directory cl.exe, c1.dll, c1xx.dll, c2.dll, cvtres.exe, lib.exe, link.exe and nmake.exe Then copy from MSDev98\bin to your bin mspdb60.dll, rc.exe and rcdll.dll.

Setup a vc6setup.bat file with the following to create a build environment
 echo Setting environment for minimal Visual C++ 6
set MSVCDir=drive:\path\to\vc6
set INCLUDE=%MSVCDir%\include
set LIB=%MSVCDir%\lib
set PATH=%MSVCDir%\bin;%PATH%
Title Minimal VC6 build shell

You can now open a new command shell and run the batch file to setup a build shell. To build tcl you can now cd to tcl\win and do
 nmake -f makefile.vc OPTS=none release

The installation takes about 70MB disk space so can easily be put on a USB memory stick if needed.

Once you have finished on the target system a simple rmdir /q /s vc6 will get rid of the whole lot.

With Platform SDK

Obviously under windows you should always build stuff with the most recent headers and libraries you can get - which means the Platform SDK - this is a free download from Microsoft. If you want to apply this to the minimal installation given above, you simply need to copy the Platform SDK include and lib directories on top of your minimal ones. The result is an up-to-date command-line build environment weighing in at about 100MB with no entries in the registry to worry about.

APN 20101015 As per Pat Thoyts on the chat, if you are building with VC++ 6, you cannot use an SDK later than Feb 2003 SDK as the libraries supplied in later SDKs are not compatible with the VC++ 6 linker. Turns out this SDK is not visible on Microsoft's download pages but can still be downloaded from their servers. Copy the files
 http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.1.cab
http://download.microsoft.com/download/platformsdk/sdk/update/win98mexp/en-us/3790.0/FULL/PSDK-FULL.bat