How to install the VB6 runtimes

From NSIS Wiki
Jump to navigationJump to search

A new VB6RunTime.nsh header file is available for the setup of the VB6 run-time files. To obtain the latest run-time files, download vb6runtime.zip and extract this file.

!include VB6RunTime.nsh
 
Var AlreadyInstalled
 
Section "-Install VB6 run-time files"
 
  ;Add code here that sets $AlreadyInstalled to a non-zero value
  ;if the application is already installed. For example:
  ;(Replace MyApp.exe with your application filename)
  IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation 
    StrCpy $AlreadyInstalled 1
  new_installation:
 
  ;Replace C:\vb6runtimes with the location of the files
  !insertmacro VB6RunTimeInstall C:\vb6runtimes $AlreadyInstalled
 
SectionEnd
 
Section "-un.Uninstall VB6 run-time files"
 
 !insertmacro VB6RunTimeUnInstall
 
SectionEnd

Remarks:

  • You may have to install additional files for such Visual Basic application to work, such as OCX files for user interface controls.
  • Installation of the run-time files requires Administrator or Power User privileges. Use the Multi-User header file to verify whether these privileges are available.

Add a Modern UI finish page or another check (see IfRebootFlag) to allow the user to restart the computer when necessary.