new header file for the setup of Visual Basic 6.0 run-time files
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5489 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
23e1474468
commit
858ddb4141
4 changed files with 392 additions and 325 deletions
|
@ -1,302 +1,277 @@
|
||||||
\A{library} DLL/TLB Library Setup
|
\A{library} DLL/TLB Library Setup
|
||||||
|
|
||||||
|
|
||||||
\H{library_intro} Introduction
|
\H{library_intro} Introduction
|
||||||
|
|
||||||
NSIS 2.01 features a new system for the installation and uninstallation of dynamic link libraries (DLL) and type libraries (TLB).
|
The Library header file can be used to setup dynamic link libraries (DLL) and type libraries (TLB).
|
||||||
Using this new system you can handle the complete setup with one single line of code:
|
If necessary, the following actions will be performed:
|
||||||
|
|
||||||
\b File copying
|
\b File copying
|
||||||
|
|
||||||
\b File copying on reboot
|
\b File copying on reboot
|
||||||
|
|
||||||
\b Version checks
|
\b Version checks
|
||||||
|
|
||||||
\b Registration and unregistration
|
\b Registration and unregistration
|
||||||
|
|
||||||
\b Registration and unregistration on reboot
|
\b Registration and unregistration on reboot
|
||||||
|
|
||||||
\b Shared DLL counting
|
\b Shared DLL counting
|
||||||
|
|
||||||
\b Windows File Protection checks
|
\b Windows File Protection checks
|
||||||
|
|
||||||
The macros are stored in the header file Library.nsh, which should be included in scripts using this system:
|
The macros are stored in the header file Library.nsh, which should be included in scripts using this system:
|
||||||
|
|
||||||
\c !include Library.nsh
|
\c !include Library.nsh
|
||||||
|
|
||||||
Note that the library macros are limited on non-Windows platforms. DLL version information is required when compiling on non-Windows platforms.
|
Note that the library macros are limited on non-Windows platforms. DLL version information is required when compiling on non-Windows platforms.
|
||||||
|
|
||||||
|
|
||||||
\H{library_install} Library Installation
|
\H{library_install} Library Installation
|
||||||
|
|
||||||
\S1{} Introduction
|
\S1{} Introduction
|
||||||
|
|
||||||
The InstallLib macro allows you to install a library. It sets the error flag if something went wrong during library setup.
|
The InstallLib macro allows you to install a library. It sets the error flag if something went wrong during library setup.
|
||||||
|
|
||||||
To ask the user for a reboot, if required, use the Modern UI with a Finish page or use \R{ifrebootflag}{IfRebootFlag} and make your own page or message box.
|
To ask the user for a reboot, if required, use the Modern UI with a Finish page or use \R{ifrebootflag}{IfRebootFlag} and make your own page or message box.
|
||||||
|
|
||||||
\S1{} Parameters
|
\S1{} Parameters
|
||||||
|
|
||||||
\c libtype shared install localfile destfile tempbasedir
|
\c libtype shared install localfile destfile tempbasedir
|
||||||
|
|
||||||
\\<b\\>libtype\\</b\\>
|
\\<b\\>libtype\\</b\\>
|
||||||
|
|
||||||
The type of the library
|
The type of the library
|
||||||
|
|
||||||
DLL - Dynamic link library (DLL)\\<br\\>
|
DLL - Dynamic link library (DLL)\\<br\\>
|
||||||
REGDLL - DLL that has to be registered\\<br\\>
|
REGDLL - DLL that has to be registered\\<br\\>
|
||||||
TLB - Type library or DLL that contains a type LIBRARY\\<br\\>
|
TLB - Type library or DLL that contains a type LIBRARY\\<br\\>
|
||||||
REGDLLTLB - DLL that has to be registered and contains a type library\\<br\\>
|
REGDLLTLB - DLL that has to be registered and contains a type library\\<br\\>
|
||||||
|
|
||||||
|
|
||||||
\\<b\\>shared\\</b\\>
|
\\<b\\>shared\\</b\\>
|
||||||
|
|
||||||
Specify whether the library is shared with other applications
|
Specify whether the library is shared with other applications
|
||||||
|
|
||||||
NOTSHARED - The library is not shared\\<br\\>
|
NOTSHARED - The library is not shared\\<br\\>
|
||||||
$VARNAME - Variable that is empty when the application is installed for the first time,
|
$VARNAME - Variable that is empty when the application is installed for the first time,
|
||||||
which is when the shared library count will be increased.\\<br\\>
|
which is when the shared library count will be increased.\\<br\\>
|
||||||
|
|
||||||
\\<b\\>install\\</b\\>
|
\\<b\\>install\\</b\\>
|
||||||
|
|
||||||
Specify the installation method
|
Specify the installation method
|
||||||
|
|
||||||
REBOOT_PROTECTED
|
REBOOT_PROTECTED
|
||||||
|
|
||||||
\b Upgrade the library on reboot when in use (required for system files).
|
\b Upgrade the library on reboot when in use (required for system files).
|
||||||
|
|
||||||
\b Upgrade the library if the file is not protected by Windows File Protection.
|
\b Upgrade the library if the file is not protected by Windows File Protection.
|
||||||
|
|
||||||
NOREBOOT_PROTECTED
|
NOREBOOT_PROTECTED
|
||||||
|
|
||||||
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
||||||
|
|
||||||
\b Upgrade the library if the file is not protected by Windows File Protection.
|
\b Upgrade the library if the file is not protected by Windows File Protection.
|
||||||
|
|
||||||
REBOOT_NOTPROTECTED
|
REBOOT_NOTPROTECTED
|
||||||
|
|
||||||
\b Upgrade the library on reboot when in use (required for system files).
|
\b Upgrade the library on reboot when in use (required for system files).
|
||||||
|
|
||||||
\b Upgrade the library without checking for Windows File Protection.
|
\b Upgrade the library without checking for Windows File Protection.
|
||||||
|
|
||||||
NOREBOOT_NOTPROTECTED
|
NOREBOOT_NOTPROTECTED
|
||||||
|
|
||||||
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
||||||
|
|
||||||
\b Upgrade the library without checking for Windows File Protection.
|
\b Upgrade the library without checking for Windows File Protection.
|
||||||
|
|
||||||
\\<b\\>localfile\\</b\\>
|
\\<b\\>localfile\\</b\\>
|
||||||
|
|
||||||
Location of the library on the compiler system
|
Location of the library on the compiler system
|
||||||
|
|
||||||
\\<b\\>destfile\\</b\\>
|
\\<b\\>destfile\\</b\\>
|
||||||
|
|
||||||
Location to store the library on the user's system
|
Location to store the library on the user's system
|
||||||
|
|
||||||
\\<b\\>tempbasedir\\</b\\>
|
\\<b\\>tempbasedir\\</b\\>
|
||||||
|
|
||||||
Directory on the user's system to store a temporary file when the system has to be rebooted.
|
Directory on the user's system to store a temporary file when the system has to be rebooted.
|
||||||
|
|
||||||
For Windows 9x/ME support, this directory should be on the same volume as the destination file (destfile).
|
For Windows 9x/ME support, this directory should be on the same volume as the destination file (destfile).
|
||||||
The Windows temp directory could be located on any volume, so you cannot use this directory.
|
The Windows temp directory could be located on any volume, so you cannot use this directory.
|
||||||
|
|
||||||
\S1{} Options
|
\S1{} Options
|
||||||
|
|
||||||
\R{define}{Define} any of the following before inserting the InstallLib macro to modify its behavior as specified.
|
\R{define}{Define} any of the following before inserting the InstallLib macro to modify its behavior as specified.
|
||||||
|
|
||||||
\S2{} LIBRARY_X64
|
\S2{} LIBRARY_X64
|
||||||
|
|
||||||
\b Installs a DLL built for Windows x64.
|
\b Installs a DLL built for Windows x64.
|
||||||
|
|
||||||
\b \\<b\\>Warning:\\</b\\> this resets file system redirection.
|
\b \\<b\\>Warning:\\</b\\> this resets file system redirection.
|
||||||
|
|
||||||
\S2{} LIBRARY_SHELL_EXTENSION
|
\S2{} LIBRARY_SHELL_EXTENSION
|
||||||
|
|
||||||
\b Define this before inserting InstallLib macro to call SHChangeNotify with SHCNE_ASSOCCHANGED after registration.
|
\b Define this before inserting InstallLib macro to call SHChangeNotify with SHCNE_ASSOCCHANGED after registration.
|
||||||
|
|
||||||
\b Use this to refresh the shell when installing a shell extension or when changing file associations.
|
\b Use this to refresh the shell when installing a shell extension or when changing file associations.
|
||||||
|
|
||||||
\S2{} LIBRARY_COM
|
\S2{} LIBRARY_COM
|
||||||
|
|
||||||
\b Define this before inserting InstallLib macro to call CoFreeUnusedLibraries after registration.
|
\b Define this before inserting InstallLib macro to call CoFreeUnusedLibraries after registration.
|
||||||
|
|
||||||
\b Use this for unloading all unnecessary libraries from memory when installing COM libraries.
|
\b Use this for unloading all unnecessary libraries from memory when installing COM libraries.
|
||||||
|
|
||||||
\S2{} LIBRARY_IGNORE_VERSION
|
\S2{} LIBRARY_IGNORE_VERSION
|
||||||
|
|
||||||
\b Define this before inserting InstallLib macro to ignore version information in the file and always install it, even if it already exists.
|
\b Define this before inserting InstallLib macro to ignore version information in the file and always install it, even if it already exists.
|
||||||
|
|
||||||
\b Use this when an older or specific version is required.
|
\b Use this when an older or specific version is required.
|
||||||
|
|
||||||
\b Not recommended for DLLs installed to $SYSDIR.
|
\b Not recommended for DLLs installed to $SYSDIR.
|
||||||
|
|
||||||
\S1{} Notes
|
\S1{} Notes
|
||||||
|
|
||||||
\b If you want to support Windows 9x/ME, you can only use short filenames (8.3).
|
\b If you want to support Windows 9x/ME, you can only use short filenames (8.3).
|
||||||
|
|
||||||
\b \\<b\\>Warning:\\</b\\> when deploying DLLs, always use redistributable files. Never copy files from your system directory.
|
\b \\<b\\>Warning:\\</b\\> when deploying DLLs, always use redistributable files. Never copy files from your system directory.
|
||||||
|
|
||||||
\S1{} Example
|
\S1{} Example
|
||||||
|
|
||||||
\S2{} Unshared DLL
|
\S2{} Unshared DLL
|
||||||
|
|
||||||
\c !insertmacro InstallLib REGDLL NOTSHARED REBOOT_NOTPROTECTED dllname.dll $SYSDIR\dllname.dll $SYSDIR
|
\c !insertmacro InstallLib REGDLL NOTSHARED REBOOT_NOTPROTECTED dllname.dll $SYSDIR\dllname.dll $SYSDIR
|
||||||
|
|
||||||
\S2{} Shared DLL
|
\S2{} Shared DLL
|
||||||
|
|
||||||
\c ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the application is
|
\c ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the application is
|
||||||
\c ;already installed. For example:
|
\c ;already installed. For example:
|
||||||
\c
|
\c
|
||||||
\c IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation ;Replace MyApp.exe with your application filename
|
\c IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation ;Replace MyApp.exe with your application filename
|
||||||
\c StrCpy $ALREADY_INSTALLED 1
|
\c StrCpy $ALREADY_INSTALLED 1
|
||||||
\c new_installation:
|
\c new_installation:
|
||||||
\c
|
\c
|
||||||
\c !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED dllname.dll $SYSDIR\dllname.dll $SYSDIR
|
\c !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED dllname.dll $SYSDIR\dllname.dll $SYSDIR
|
||||||
|
|
||||||
\H{library_uninstall} Library Uninstallation
|
\H{library_uninstall} Library Uninstallation
|
||||||
|
|
||||||
\S1{} Introduction
|
\S1{} Introduction
|
||||||
|
|
||||||
The UnInstallLib macro allows you to uninstall a library. It sets the error flag if something went wrong during library removal.
|
The UnInstallLib macro allows you to uninstall a library. It sets the error flag if something went wrong during library removal.
|
||||||
|
|
||||||
\S1{} Parameters
|
\S1{} Parameters
|
||||||
|
|
||||||
\c libtype shared uninstall file
|
\c libtype shared uninstall file
|
||||||
|
|
||||||
\\<b\\>libtype\\</b\\>
|
\\<b\\>libtype\\</b\\>
|
||||||
|
|
||||||
The type of the library
|
The type of the library
|
||||||
|
|
||||||
DLL - Dynamic link library (DLL)\\<br\\>
|
DLL - Dynamic link library (DLL)\\<br\\>
|
||||||
REGDLL - DLL that has to be registered\\<br\\>
|
REGDLL - DLL that has to be registered\\<br\\>
|
||||||
TLB - Type library or DLL that contains a type LIBRARY\\<br\\>
|
TLB - Type library or DLL that contains a type LIBRARY\\<br\\>
|
||||||
REGDLLTLB - DLL that has to be registered and contains a type library\\<br\\>
|
REGDLLTLB - DLL that has to be registered and contains a type library\\<br\\>
|
||||||
|
|
||||||
|
|
||||||
\\<b\\>shared\\</b\\>
|
\\<b\\>shared\\</b\\>
|
||||||
|
|
||||||
Specify whether the library is shared with other applications
|
Specify whether the library is shared with other applications
|
||||||
|
|
||||||
NOTSHARED - The library is not shared\\<br\\>
|
NOTSHARED - The library is not shared\\<br\\>
|
||||||
SHARED - The library is shared and should be removed if the shared library count
|
SHARED - The library is shared and should be removed if the shared library count
|
||||||
indicates that the file is not in use anymore..\\<br\\>
|
indicates that the file is not in use anymore..\\<br\\>
|
||||||
|
|
||||||
\\<b\\>uninstall\\</b\\>
|
\\<b\\>uninstall\\</b\\>
|
||||||
|
|
||||||
Specify the uninstallation method
|
Specify the uninstallation method
|
||||||
|
|
||||||
NOREMOVE
|
NOREMOVE
|
||||||
|
|
||||||
\b The library should not be removed. You should use this option for common or important
|
\b The library should not be removed. You should use this option for common or important
|
||||||
system files such as the Visual Basic/C++/MFC runtimes.
|
system files such as the Visual Basic/C++/MFC runtimes.
|
||||||
|
|
||||||
REBOOT_PROTECTED
|
REBOOT_PROTECTED
|
||||||
|
|
||||||
\b Remove the library on reboot when in use (required for system files).
|
\b Remove the library on reboot when in use (required for system files).
|
||||||
|
|
||||||
\b Remove the library if the file is not protected by Windows File Protection.
|
\b Remove the library if the file is not protected by Windows File Protection.
|
||||||
|
|
||||||
NOREBOOT_PROTECTED
|
NOREBOOT_PROTECTED
|
||||||
|
|
||||||
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
||||||
|
|
||||||
\b Remove the library if the file is not protected by Windows File Protection.
|
\b Remove the library if the file is not protected by Windows File Protection.
|
||||||
|
|
||||||
REBOOT_NOTPROTECTED
|
REBOOT_NOTPROTECTED
|
||||||
|
|
||||||
\b Remove the library on reboot when in use (required for system files).
|
\b Remove the library on reboot when in use (required for system files).
|
||||||
|
|
||||||
\b Remove the library without checking for Windows File Protection.
|
\b Remove the library without checking for Windows File Protection.
|
||||||
|
|
||||||
NOREBOOT_NOTPROTECTED
|
NOREBOOT_NOTPROTECTED
|
||||||
|
|
||||||
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
\b Warns the user when the library is in use. The user will have to close applications using the library.
|
||||||
|
|
||||||
\b Remove the library without checking for Windows File Protection.
|
\b Remove the library without checking for Windows File Protection.
|
||||||
|
|
||||||
|
|
||||||
\\<b\\>file\\</b\\>
|
\\<b\\>file\\</b\\>
|
||||||
|
|
||||||
Location of the library
|
Location of the library
|
||||||
|
|
||||||
\S1{} Options
|
\S1{} Options
|
||||||
|
|
||||||
\R{define}{Define} any of the following before inserting the UnInstallLib macro to modify its behavior as specified.
|
\R{define}{Define} any of the following before inserting the UnInstallLib macro to modify its behavior as specified.
|
||||||
|
|
||||||
\S2{} LIBRARY_X64
|
\S2{} LIBRARY_X64
|
||||||
|
|
||||||
\b Uninstalls a DLL built for Windows x64.
|
\b Uninstalls a DLL built for Windows x64.
|
||||||
|
|
||||||
\b \\<b\\>Warning:\\</b\\> this resets \R{setregview}{RegSetView} and file system redirection.
|
\b \\<b\\>Warning:\\</b\\> this resets \R{setregview}{RegSetView} and file system redirection.
|
||||||
|
|
||||||
\S2{} LIBRARY_SHELL_EXTENSION
|
\S2{} LIBRARY_SHELL_EXTENSION
|
||||||
|
|
||||||
\b Define this before inserting UninstallLib macro to call SHChangeNotify with SHCNE_ASSOCCHANGED after unregistration. Use this to refresh the shell when uninstalling a shell extension or when changing file associations.
|
\b Define this before inserting UninstallLib macro to call SHChangeNotify with SHCNE_ASSOCCHANGED after unregistration. Use this to refresh the shell when uninstalling a shell extension or when changing file associations.
|
||||||
|
|
||||||
\S2{} LIBRARY_COM
|
\S2{} LIBRARY_COM
|
||||||
|
|
||||||
\b Define this before inserting UninstallLib macro to call CoFreeUnusedLibraries after unregistration. Use this for unloading all unnecessary libraries from memory when uninstalling COM libraries.
|
\b Define this before inserting UninstallLib macro to call CoFreeUnusedLibraries after unregistration. Use this for unloading all unnecessary libraries from memory when uninstalling COM libraries.
|
||||||
|
|
||||||
\S1{} Example
|
\S1{} Example
|
||||||
|
|
||||||
\c !insertmacro UnInstallLib REGDLL SHARED REBOOT_NOTPROTECTED $SYSDIR\dllname.dll
|
\c !insertmacro UnInstallLib REGDLL SHARED REBOOT_NOTPROTECTED $SYSDIR\dllname.dll
|
||||||
|
|
||||||
|
|
||||||
\H{library_vb6} Visual Basic 6 Runtimes
|
\H{library_vb6} Visual Basic 6 Run-Time Files
|
||||||
|
|
||||||
Add this code to your script to install and uninstall the VB6 runtimes.
|
A new VB6.nsh header file is available for the setup of the VB6 run-time files.
|
||||||
|
To obtain the latest run-time files, download \W{http://nsis.sourceforge.net/vb6runtime.zip} and extract this file.
|
||||||
The correct version of the following files should be stored in your script folder
|
|
||||||
(or modify the paths to the local files if you want to use another folder):
|
\c !include VB6RunTime.nsh
|
||||||
|
\c
|
||||||
\b msvbvm60.dll
|
\c Var AlreadyInstalled
|
||||||
|
\c
|
||||||
\b oleaut32.dll
|
\c Section "-Install VB6 run-time files"
|
||||||
|
\c
|
||||||
\b olepro32.dll
|
\c ;Add code here that sets $AlreadyInstalled to a non-zero value if the application is already installed. For example:
|
||||||
|
\c IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation ;Replace MyApp.exe with your application filename
|
||||||
\b oleaut32.dll
|
\c StrCpy $AlreadyInstalled 1
|
||||||
|
\c new_installation:
|
||||||
\b comcat.dll
|
\c
|
||||||
|
\c !insertmacro VB6RunTimeInstall C:\vb6runtimes $AlreadyInstalled ;Replace C:\vb6runtimes with the location of the files
|
||||||
\b asycfilt.dll
|
\c
|
||||||
|
\c SectionEnd
|
||||||
\b stdole2.tlb
|
\c
|
||||||
|
\c Section "-un.Uninstall VB6 run-time files"
|
||||||
A \W{http://support.microsoft.com/default.aspx?scid=kb;en-us;290887}{Microsoft article} that explains how to obtain these files is available.
|
\c
|
||||||
|
\c !insertmacro VB6RunTimeUnInstall
|
||||||
To ask the user for a reboot, if required, use the Modern UI with a Finish page or use \R{ifrebootflag}{IfRebootFlag} and make your own page or message box.
|
\c
|
||||||
|
\c SectionEnd
|
||||||
\c !include Library.nsh
|
|
||||||
\c
|
Remarks:
|
||||||
\c Var ALREADY_INSTALLED
|
|
||||||
\c
|
\b You may have to install additional files for such Visual Basic application to work, such as OCX files for user interface controls.
|
||||||
\c Section "-Install VB6 runtimes"
|
|
||||||
\c
|
\b 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.
|
||||||
\c ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the application is already installed. For example:
|
|
||||||
\c
|
\b Add a Modern UI finish page or another check (see \R{ifrebootflag}{IfRebootFlag}) to allow the user to restart the computer when necessary.
|
||||||
\c IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation ;Replace MyApp.exe with your application filename
|
|
||||||
\c StrCpy $ALREADY_INSTALLED 1
|
|
||||||
\c new_installation:
|
|
||||||
\c
|
|
||||||
\c !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR"
|
|
||||||
\c !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED "oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
|
|
||||||
\c !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED "olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR"
|
|
||||||
\c !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED "comcat.dll" "$SYSDIR\comcat.dll" "$SYSDIR"
|
|
||||||
\c !insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED "asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR"
|
|
||||||
\c !insertmacro InstallLib TLB $ALREADY_INSTALLED REBOOT_PROTECTED "stdole2.tlb" "$SYSDIR\stdole2.tlb" "$SYSDIR"
|
|
||||||
\c
|
|
||||||
\c SectionEnd
|
|
||||||
\c
|
|
||||||
\c Section "-un.Uninstall VB6 runtimes"
|
|
||||||
\c
|
|
||||||
\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll"
|
|
||||||
\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll"
|
|
||||||
\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll"
|
|
||||||
\c !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll"
|
|
||||||
\c !insertmacro UnInstallLib DLL SHARED NOREMOVE "$SYSDIR\asycfilt.dll"
|
|
||||||
\c !insertmacro UnInstallLib TLB SHARED NOREMOVE "$SYSDIR\stdole2.tlb"
|
|
||||||
\c
|
|
||||||
\c SectionEnd
|
|
||||||
|
|
||||||
You can use similar code to install common VB6 ActiveX controls (such as the controls for Windows Common Controls).
|
|
||||||
|
|
|
@ -154,6 +154,7 @@ ${MementoSection} "NSIS Core Files (required)" SecCore
|
||||||
File ..\Include\LangFile.nsh
|
File ..\Include\LangFile.nsh
|
||||||
File ..\Include\InstallOptions.nsh
|
File ..\Include\InstallOptions.nsh
|
||||||
File ..\Include\MultiUser.nsh
|
File ..\Include\MultiUser.nsh
|
||||||
|
File ..\Include\VB6RunTime.nsh
|
||||||
|
|
||||||
SetOutPath $INSTDIR\Docs\StrFunc
|
SetOutPath $INSTDIR\Docs\StrFunc
|
||||||
File ..\Docs\StrFunc\StrFunc.txt
|
File ..\Docs\StrFunc\StrFunc.txt
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
includes = Split("""
|
includes = Split("""
|
||||||
Colors.nsh
|
Colors.nsh
|
||||||
FileFunc.nsh
|
FileFunc.nsh
|
||||||
LangFile.nsh
|
LangFile.nsh
|
||||||
Library.nsh
|
Library.nsh
|
||||||
LogicLib.nsh
|
LogicLib.nsh
|
||||||
Memento.nsh
|
Memento.nsh
|
||||||
MUI.nsh
|
MUI.nsh
|
||||||
MUI2.nsh
|
MUI2.nsh
|
||||||
Sections.nsh
|
Sections.nsh
|
||||||
StrFunc.nsh
|
StrFunc.nsh
|
||||||
TextFunc.nsh
|
TextFunc.nsh
|
||||||
UpgradeDLL.nsh
|
UpgradeDLL.nsh
|
||||||
WinMessages.nsh
|
VB6RunTime.nsh
|
||||||
WinVer.nsh
|
WinMessages.nsh
|
||||||
WordFunc.nsh
|
WinVer.nsh
|
||||||
x64.nsh
|
WordFunc.nsh
|
||||||
""")
|
x64.nsh
|
||||||
|
""")
|
||||||
Import('env')
|
|
||||||
|
Import('env')
|
||||||
env.DistributeInclude(includes)
|
|
||||||
env.DistributeDocs('StrFunc.txt', path='StrFunc')
|
env.DistributeInclude(includes)
|
||||||
|
env.DistributeDocs('StrFunc.txt', path='StrFunc')
|
||||||
|
|
90
Include/VB6RunTime.nsh
Normal file
90
Include/VB6RunTime.nsh
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
VB6RunTime.nsh
|
||||||
|
|
||||||
|
Setup of Visual Basic 6.0 run-time files, including the Oleaut32.dll security update
|
||||||
|
|
||||||
|
Copyright © 2008 Joost Verburg
|
||||||
|
|
||||||
|
To obtain the run-time files, download and extract
|
||||||
|
http://nsis.sourceforge.net/vb6runtime.zip
|
||||||
|
|
||||||
|
Script code for installation:
|
||||||
|
|
||||||
|
!insertmacro InstallVB6RunTime FOLDER ALREADY_INSTALLED
|
||||||
|
|
||||||
|
in which FOLDER is the location of the run-time files and ALREADY_INSTALLED is the
|
||||||
|
name of a variable that is empty when the application is installed for the first time
|
||||||
|
and non-empty otherwise
|
||||||
|
|
||||||
|
Script code for uninstallation:
|
||||||
|
|
||||||
|
!insertmacro UnInstallVB6RunTime
|
||||||
|
|
||||||
|
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 in the NSIS Users
|
||||||
|
Manual) to allow the user to restart the computer when necessary.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
!ifndef VB6_INCLUDED
|
||||||
|
!define VB6_INCLUDED
|
||||||
|
!verbose push
|
||||||
|
!verbose 3
|
||||||
|
|
||||||
|
!include Library.nsh
|
||||||
|
!include WinVer.nsh
|
||||||
|
|
||||||
|
!macro VB6RunTimeInstall FOLDER ALREADY_INSTALLED
|
||||||
|
|
||||||
|
!insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR"
|
||||||
|
|
||||||
|
;The files below will only be installed on Win9x/NT4
|
||||||
|
|
||||||
|
!insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR"
|
||||||
|
!insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\comcat.dll" "$SYSDIR\comcat.dll" "$SYSDIR"
|
||||||
|
!insertmacro InstallLib DLL "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR"
|
||||||
|
!insertmacro InstallLib TLB "${ALREADY_INSTALLED}" REBOOT_PROTECTED "${FOLDER}\stdole2.tlb" "$SYSDIR\stdole2.tlb" "$SYSDIR"
|
||||||
|
|
||||||
|
Push $R0
|
||||||
|
|
||||||
|
${if} ${IsNT}
|
||||||
|
${if} ${IsWinNT4}
|
||||||
|
ReadRegStr $R0 HKLM "System\CurrentControlSet\Control" "ProductOptions"
|
||||||
|
${if} $R0 == "Terminal Server"
|
||||||
|
!insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4TS\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
|
||||||
|
${else}
|
||||||
|
!insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
|
||||||
|
${endif}
|
||||||
|
${endif}
|
||||||
|
${else}
|
||||||
|
;No Oleaut32.dll with the security update has been released for Windows 9x.
|
||||||
|
;The NT4 version is used because NT4 and Win9x used to share the same 2.40 version
|
||||||
|
;and version 2.40.4519.0 is reported to work fine on Win9x.
|
||||||
|
!insertmacro InstallLib REGDLL "${ALREADY_INSTALLED}" REBOOT_NOTPROTECTED "${FOLDER}\NT4\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR"
|
||||||
|
${endif}
|
||||||
|
|
||||||
|
Pop $R0
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro VB6RunTimeUnInstall
|
||||||
|
|
||||||
|
!insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll"
|
||||||
|
!insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll"
|
||||||
|
!insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll"
|
||||||
|
!insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll"
|
||||||
|
!insertmacro UnInstallLib DLL SHARED NOREMOVE "$SYSDIR\asycfilt.dll"
|
||||||
|
!insertmacro UnInstallLib TLB SHARED NOREMOVE "$SYSDIR\stdole2.tlb"
|
||||||
|
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!verbose pop
|
||||||
|
!endif
|
Loading…
Add table
Add a link
Reference in a new issue