Previous | Contents | Next

B.2 Library Installation

B.2.1 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 IfRebootFlag and make your own page or message box.

B.2.2 Parameters

libtype shared install localfile destfile tempbasedir

libtype

The type of the library

DLL - Dynamic link library (DLL)
REGDLL - DLL that has to be registered
REGEXE - EXE COM server that has to be registered using /regserver
TLB - Type library or DLL that contains a type library
REGDLLTLB - DLL that has to be registered and contains a type library

shared

Specify whether the library is shared with other applications

NOTSHARED - The library is not shared
$VARNAME - Variable that is empty when the application is installed for the first time, which is when the shared library count will be increased.

install

Specify the installation method

REBOOT_PROTECTED

NOREBOOT_PROTECTED

REBOOT_NOTPROTECTED

NOREBOOT_NOTPROTECTED

localfile

Location of the library on the compiler system

destfile

Location to store the library on the user's system

tempbasedir

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). The Windows temp directory could be located on any volume, so you cannot use this directory.

B.2.3 Options

Define any of the following before inserting the InstallLib macro to modify its behavior as specified.

B.2.3.1 LIBRARY_X64

B.2.3.2 LIBRARY_SHELL_EXTENSION

B.2.3.3 LIBRARY_COM

B.2.3.4 LIBRARY_IGNORE_VERSION

B.2.4 Notes

B.2.5 Example

B.2.5.1 Unshared DLL

 !insertmacro InstallLib REGDLL NOTSHARED REBOOT_NOTPROTECTED dllname.dll $SYSDIR\dllname.dll $SYSDIR

B.2.5.2 Shared DLL

 ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if the application is
 ;already installed. For example:

 IfFileExists "$INSTDIR\MyApp.exe" 0 new_installation ;Replace MyApp.exe with your application filename
   StrCpy $ALREADY_INSTALLED 1
 new_installation:

 !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED dllname.dll $SYSDIR\dllname.dll $SYSDIR

Previous | Contents | Next