Debian Codegraph @

Include/VB6RunTime.nsh

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