Statistiques
| Révision :

root / tmp / org.txm.setups / nsis / Include / VB6RunTime.nsh @ 3108

Historique | Voir | Annoter | Télécharger (3,38 ko)

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