Archive: Variable $SYSDIR seems not to work


Variable $SYSDIR seems not to work
  Hi!
I am quite new with NSIS, I have written a script to install a OCX component in the computer (Windows 2000, SP3).
I want to use the macro UpgradeDLL as follows:

Push "$SYSDIR\mscomctl.ocx"
!define DLL_NAME mscomctl.ocx
!insertmacro UpgradeDLL

It seems not to work correctly. I get the following error by compiling
File: "mscomctl.ocx" -> no files found
Usage: File (/r filespec [...]|/oname=outfile one_file_only)
Error in macro UpgradeDLL on macroline 18

but if instead I used the path hardcoded it works:

Push "C:\winnt\system32\mscomctl.ocx"
!define DLL_NAME "C:\winnt\system32\mscomctl.ocx"
!insertmacro UpgradeDLL

I tried to find an answer in the html help files but it doesn´t say anything about fixing this problem.
Thanks for your time.
Jaime.


You need to define DLL_NAME as the full path to the DLL on your system so NSIS will know how to find it. What you push is the path where it should be installed in the user's machine, which should be $SYSDIR\mscomctl.ocx.


Push "$SYSDIR\\mscomctl.ocx" 

>!define DLL_NAME "C:\\winnt\\system32\\mscomctl.ocx"
>!insertmacro UpgradeDLL
>

Thanks a lot
  Thankyou, it works fine now.
Jaimosky