Archive: InstallLib Trouble


InstallLib Trouble
Can anyone see a problem with the following script?


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Test Script

;Backgound Colors
BGGradient 800080 000000 FFFFFF
BrandingText " "

;Title Of Your Application
Name "Test"

;Includes
!include Library.nsh

;Do A CRC Check
CRCCheck On

;Output File Name
OutFile "InstallTest.exe"

;The Default Installation Directory
InstallDir "D:\Program Files\MyTestApp"

;The text to prompt the user to enter a directory
DirText "Please select the folder below"

Var ALREADY_INSTALLED

Section "Install"
;Install Files
SetOutPath $INSTDIR
SetCompress Auto
SetOverwrite on
File /r "D:\BuildFiles\Test\*.*"

StrCpy $1 "MyDll.dll"
call installDll

StrCpy $1 "MySecondDll.dll"
call installDll

StrCpy $1 "MyThirdDll.dll"
call installDll

ExecWait 'IISRESET /start'

SectionEnd


;--------------------------------
;Installer Functions

Function .onInit

ExecWait 'IISRESET /stop'

FunctionEnd


Function installDll

StrCpy $ALREADY_INSTALLED 0

IfFileExists "$INSTDIR\$1" 0 new_installation
StrCpy $ALREADY_INSTALLED 1

new_installation:
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED NOREBOOT_NOTPROTECTED D:\BuildFiles\TestDlls\$1 $INSTDIR\$1 $SYSDIR

FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


It's throwing the error:

!insertmacro: InstallLib
!error: InstallLib: The library D:\BuildFiles\TestDlls\$1 could not be found.
Error in macro InstallLib on macroline 89
Error in script "D:\buildutilities\InstallProConnect.nsi" on line 135


Am I not allowed to use $1 with InstallLib?

Thanks,
Eric


You are mixing up compile-time and run-time. How do you except the compiler to know what files to include if you use a run-time variable in the name?

You should use a macro instead.


I'm always mixing up compile-time and run-time. Maybe this time, it will finally settle into my THICK head! I'll use a macro, thanks!