B.4 Visual Basic 6 Run-Time Files

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.

  1. !include VB6RunTime.nsh
  2.  
  3. Var AlreadyInstalled
  4.  
  5. Section "-Install VB6 run-time files"
  6.  
  7. ;Add code here that sets $AlreadyInstalled to a non-zero value if the application is already installed. For example:
  8. IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation ;Replace MyApp.exe with your application filename
  9. StrCpy $AlreadyInstalled 1
  10. new_installation:
  11.  
  12. !insertmacro VB6RunTimeInstall C:\vb6runtimes $AlreadyInstalled ;Replace C:\vb6runtimes with the location of the files
  13.  
  14. SectionEnd
  15.  
  16. Section "-un.Uninstall VB6 run-time files"
  17.  
  18. !insertmacro VB6RunTimeUnInstall
  19.  
  20. 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.