Archive: InstallLib does not register any dll or ocx


InstallLib does not register any dll or ocx
New to NSIS. My first project is for trying to convert an old VB6 setup to NSIS, and testing it in Windows 7. To make things easier, I am testing with UAC disabled.

When installing, it installs all the normal files, links and uninstall program, but it does not install any of the dlls and ocx.

I am testing it with the logging version of the installer, and in the install.log file does not apear any comment or error about the dlls and ocx.

Sure it will be something forgotten, so, any help will be appreciated.

Here is a partial code of what I am using

; MUI end ------

!include "Library.nsh"

Var ALREADY_INSTALLED
Var Version

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "ProtonSetup.exe"
InstallDir "C:\PROTON"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show

RequestExecutionLevel admin

Section "ProtonInstall"
LogSet on
ReadRegDWord $Version HKLM "${PRODUCT_DIR_REGKEY}" Version
IfErrors new_installation
StrCpy $ALREADY_INSTALLED 1
new_installation:
SetOverwrite ifnewer
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\dbgrid32.ocx" "$SysDir\dbgrid32.ocx" "$SysDir"
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\ADODCES.DLL" "$SysDir\ADODCES.DLL" "$SysDir"
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\STDFTES.DLL" "$SysDir\STDFTES.DLL" "$SysDir"
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\MSSTDFMT.DLL" "$SysDir\MSSTDFMT.DLL" "$SysDir"
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\MSADODC.OCX" "$SysDir\MSADODC.OCX" "$SysDir"
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\MSMPIES.DLL" "$SysDir\MSMPIES.DLL" "$SysDir"
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\MSMAPI32.OCX" "$SysDir\MSMAPI32.OCX" "$SysDir"
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED "Support\FLXGDES.DLL" "$SysDir\FLXGDES.DLL" "$SysDir"


Perhaps you're not running the installer as admin. When UAC is disabled, windows ignores the requested execution level. To work around this, use the userinfo plugin to manually test for actual admin access in .onInit.


It was easier than supposed. I tested in an XP machine, and it happened the same, so, after investigating, I added SetOutPath before registering dlls in the SysDir and InstDir folders, and now it works.


SetOutPath sets the working directory which is also used in the search path for dependencies. If you have dependencies outside of the system folder and the search path, you have to set the working folder to that.


Thanks for your interest kichik.

The sample script inserted does not completely illustrate the situation because are only some partial lines of about 100 files to copy, and the ocx and dlls that did not copied where those in the InstDir folder, those in SysDir copied correctly.

After using the log version of the installer, I saw that SetOutPat $InstDir also creates the folder if it does not exists, so putting it at the beginning of the files to copy to $InstDir solved my problem.