How to add file in NSIS from different folders
Asked Answered
G

4

7

I have the following already set up and working:

File file1.bat
File file2.xml
File common.file1.dll
File common.file2.dll
File common.file3.exe

What I would want, to avoid keeping the common files in the source directory, is reference them from the parent directory like so:

File file1.bat
File file2.xml
File ..\common.file1.dll
File ..\common.file2.dll
File ..\common.file3.exe

Edit: This actually works when I tried it again.

But apparently, this is not recognized.
Is there another way to reference these files?

Govan answered 18/1, 2013 at 13:23 Comment(0)
H
13

File's are relative to the .nsi and ..\xyz should work...

Holpen answered 18/1, 2013 at 14:11 Comment(1)
You are right, it works! I updated my question to reflect this.Govan
U
2

You can specify separate output file paths and source file paths for the File command:

File /oname=$INSTDIR\common.file3.exe ..\common.file3.exe
Unboned answered 25/9, 2014 at 6:51 Comment(0)
D
1

You can define an environment variable pointing to the folder where you want to keep your dependencies. Then use that environment var in your nsi script.

Disengage answered 30/1, 2013 at 15:1 Comment(0)
B
0

try to add the following line in your script:

File file1.bat
File file2.xml
SetOutpath "<source directory path>"
File common.file1.dll
File common.file2.dll
File common.file3.exe
Bluestone answered 18/1, 2013 at 13:32 Comment(1)
Nope, that is not it, I think, because it does not allow "..\" which is what I intend to copy the common files from.Govan

© 2022 - 2024 — McMap. All rights reserved.