The Library header file can be used to setup dynamic link libraries (DLL) and type libraries (TLB).
If necessary, the following actions will be performed:
\b File copying
\b File copying on reboot
\b Version checks
\b Registration and unregistration
\b Registration and unregistration on reboot
\b Shared DLL counting
\b Windows File Protection checks
The macros are stored in the header file Library.nsh, which should be included in scripts using this system:
\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.
\H{library_install} Library Installation
\S1{} Introduction
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.
\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
\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.
\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
\c StrCpy $AlreadyInstalled 1
\c new_installation:
\c
\c !insertmacro VB6RunTimeInstall C:\vb6runtimes $AlreadyInstalled ;Replace C:\vb6runtimes with the location of the files
\c
\c SectionEnd
\c
\c Section "-un.Uninstall VB6 run-time files"
\c
\c !insertmacro VB6RunTimeUnInstall
\c
\c SectionEnd
Remarks:
\b You may have to install additional files for such Visual Basic application to work, such as OCX files for user interface controls.
\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.
\b Add a Modern UI finish page or another check (see \R{ifrebootflag}{IfRebootFlag}) to allow the user to restart the computer when necessary.