Archive: Problem with paths


Problem with paths
Hello

I'm new to NSIS and I have few problems.

I try to create a simple install.

First, I would like to read two variables from ini file (folderbase and version) and use it in a following way:

File /r var1 + var2 ;which would be e.g. D:\work\Base\v1.00 where var1 would be D:\work\Base\ and var2 would be v1.00.

But I keep getting error message that NSIS cannot find any files under var1+var2

What wrong am I doing?

Second problem is when I want to install this stuff. I need an option to disable/enable page. I create 2 pages, one where I choose install dir for folder1 and second where I choose install dir for folder2. Then in installer I can choose if I want to install both or just one. The question is how can I disable a page where I specify path for installation. E.g. I choose to install just folder2 but I still can see a page where I need to specify path for folder1.

Thx in advance for any help.


Hi korba_bm,

Try with File $0\$1 not File var1 + var2
where $0 is foldername obtained by reading a file and
$1 is filename obtained by reading a (may be another) file
use FileRead command for this
eg.
FileOpen $0 $INSTDIR\file.dat r

I guess it should work, I haven't tried it yet.
Please let me know if you get it done.


Well... I tried this way:

Section "Framework"
SetOutPath "$FRAMEWORK_DIR"
ReadINIStr $8 $INI "Framework" "Path"
ReadINIStr $9 $INI "Framework" "Version"
DetailPrint $8\$9
File /r "$8\$9"
Call installFramework
SectionEnd

I get an error message:
File: $8\$9 -> no files found.

As I checked the variables have correct values
eg. C:\Work\Framework\v1.00

If I use
"File /r C:\Work\Framework\v1.00" then it works, when I use variables then NSIS cannot find files.


It's because variables are run time. For File command compiler must know files names in compilation time... So, you can't do this (But why you want to use these values from ini file?).


Hmmm...makes sense. Ok, I think I will drop the idea with the ini file.

Thanks for help.