Old 9th May 2007, 10:27   #1
suryakiran
Junior Member
 
Join Date: May 2007
Posts: 3
File Problems

Hello all,
I'm a newbie to NSIS. I'm trying to create an installer.

I've to install some dll files and I'm doing this.

File \path\to\directory\filename.exe

This works fine.

but if i save \path\to\directory in a variable

Var /GLOBAL path
StrCpy $path "\path\to\directory"

and then use File like this

File $path\filename.exe

This fails. NSIS compiler complains that no file with the name $path\filename.exe exists.

How can i pass user defined variables to File.

I've even tried File ${path}\filename.exe.

This also did not work.

Please help me out.

Thanks,
Surya
suryakiran is offline   Reply With Quote
Old 9th May 2007, 10:31   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You are confusing run time variables with compile time constants. File is a compile time instruction and the value of $path is only set on run time and therefore your code will not work.

Use !define instead for compile time constants.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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