Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 27th July 2005, 18:15   #1
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 188
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
stonkers is offline   Reply With Quote
Old 27th July 2005, 20:35   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
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.
Joost Verburg is offline   Reply With Quote
Old 28th July 2005, 14:28   #3
stonkers
Senior Member
 
Join Date: Sep 2003
Posts: 188
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!
stonkers is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump