Scripted silent install of Visual Basic 6.0

I recently had a need to install Visual Basic 6.0 Enterprise Edition on a number of machines using a batch file script and a silent -unattended – installation process. Given the age of the application I thought this would be quite straightforward and well documented, but there were a number of hurdles to clear on the way so here is my solution.

First point of call was the Microsoft KnowledgeBase Article KB195828 titled HOW TO: Silently Install Visual Studio 6.0 Enterprise Edition. This sounded just what I needed. Unfortunately the version of Visual Basic (rather than Studio) I was installing did not have the Acost.exe application in the instructions. 

However the smsinst.exe installer in these instructions did exactly what I wanted anyway, when run manually. When it came to scripting it I found the executable exits immediately- this means that the script would continue to the next entry without waiting for the executable to finish. Even using the start /wait command which would usually resolve this did not work.

A bit of experimenting ,Googling , and referring further to the MS KnowledgeBase later I finished with the following script. The contents of CD1 had been copied to a network location accessible via a UNC path from the target machine. The serial number is given in the acmsetup line- the hyphen is removed from the serial number on the case, so in this example it would have been 123-4567890 on the sticker.

REM Set the Installation source folder variable
SET INSTDIR=\\UNC Path to Installation folder on network
REM Run the registry patch which allows us to skip the first GUI section of the install
REGEDIT /S "%INSTDIR%\key.dat"
REM Run the VB Installer itself with the serial number
START /WAIT %INSTDIR%\setup\acmsetup.exe /T VB98Ent.stf /S "%INSTDIR%\" /n"User Name" /o "Company name" /k 1234567890
/b 1 /gc %TEMP%\vb6_install_log.txt /qtn

It is then necessary to reboot before applying the appropriate Service Pack.

2 thoughts on “Scripted silent install of Visual Basic 6.0

  1. Rob Wiley

    I’m glad you had this. It really helped. I have to maintain and even build new “build” servers that have vb6 as a component. One detail that I encountered since I’m doing this on a Windows 2008R2 server – the key.dat file puts the “aspo” value in HKLM\SOFTWARE\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual Basic\SetupWizard – which does *not* work with 2008R2. I did a manual install (which worked) and found that aspo was put in HKLM\Software\Wow6432Node\Microsoft/VisualStudio\6.0\Setup\Microsoft Visual Basic\SetupWizard. Once I used that as the first step VB6 installed without a hitch.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *