VB6RunTime.nsh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. VB6RunTime.nsh
  3. Setup of Visual Basic 6.0 run-time files, including the Oleaut32.dll security update
  4. Copyright 2008-2017 Joost Verburg
  5. To obtain the run-time files, download and extract
  6. http://nsis.sourceforge.net/vb6runtime.zip
  7. Script code for installation:
  8. !insertmacro InstallVB6RunTime FOLDER ALREADY_INSTALLED
  9. in which FOLDER is the location of the run-time files and ALREADY_INSTALLED is the
  10. name of a variable that is empty when the application is installed for the first time
  11. and non-empty otherwise
  12. Script code for uninstallation:
  13. !insertmacro UnInstallVB6RunTime
  14. Remarks:
  15. * You may have to install additional files for such Visual Basic application to work,
  16. such as OCX files for user interface controls.
  17. * Installation of the run-time files requires Administrator or Power User privileges.
  18. Use the Multi-User header file to verify whether these privileges are available.
  19. * Add a Modern UI finish page or another check (see IfRebootFlag in the NSIS Users
  20. Manual) to allow the user to restart the computer when necessary.
  21. */
  22. !ifndef VB6_INCLUDED
  23. !define VB6_INCLUDED
  24. !verbose push
  25. !verbose 3
  26. !include Library.nsh
  27. !include WinVer.nsh
  28. !macro VB6RunTimeInstall FOLDER ALREADY_INSTALLED
  29. !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR"
  30. ;The files below will only be installed on Win9x/NT4
  31. !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR"
  32. !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\comcat.dll" "$SYSDIR\comcat.dll" "$SYSDIR"
  33. !insertmacro InstallLib DLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR"
  34. !insertmacro InstallLib TLB "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\stdole2.tlb" "$SYSDIR\stdole2.tlb" "$SYSDIR"
  35. Push $R0
  36. ${if} ${IsNT}
  37. ${if} ${IsWinNT4}
  38. ReadRegStr $R0 HKLM "System\CurrentControlSet\Control" "ProductOptions"
  39. ${if} $R0 == "Terminal Server"
  40. !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4TS\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
  41. ${else}
  42. !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
  43. ${endif}
  44. ${endif}
  45. ${else}
  46. ;No Oleaut32.dll with the security update has been released for Windows 9x.
  47. ;The NT4 version is used because NT4 and Win9x used to share the same 2.40 version
  48. ;and version 2.40.4519.0 is reported to work fine on Win9x.
  49. !insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
  50. ${endif}
  51. Pop $R0
  52. !macroend
  53. !macro VB6RunTimeUnInstall
  54. !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll"
  55. !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll"
  56. !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll"
  57. !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll"
  58. !insertmacro UnInstallLib DLL SHARED NOREMOVE "$SYSDIR\asycfilt.dll"
  59. !insertmacro UnInstallLib TLB SHARED NOREMOVE "$SYSDIR\stdole2.tlb"
  60. !macroend
  61. !verbose pop
  62. !endif