![]() |
How to append a string to a variable
Ok, I have a default directory that I want to install to. I also have a "directory" page, so that the default directory can be changed if need be.
Regardless of whether or not the default directory is used, I would like to append "\lib\extensions\" to the end of the directory. I am copying an extension to an extension directory, and it's just easier if the user only has to tell me where the installation is. For instance, if the user picks "C:\blah" , I would like to install to "C:\blah\lib\extensions\myext.jar". Here's my script code: |
StrCpy $MyVar "$MyVar\blah"
|
That failed to work.
|
Where possible I always use quotes for path and file names.code: |
That didn't work either...
|
So whats the actual problem? I have compiled the script you posted using my own files and it works just fine. You could have a look at the log window at the end of the install and see if the path is actually showing up.
|
It will compile, but the file only gets copied to the directory chosen, or the default directory.
I need to add "/lib/extensions" onto either the default path, or the path chosen, and then copy my file to that directory. It's as if is not getting executed.code: |
Works for me too...
According to the docs, SetOutPath expects a full pathname. You might want to check to make sure that $INSTDIR is a full path. (Does $INSTDIR have a trailing backslash perhaps?) Another thing you might check is whether or not SetOutPath generating errors. You can check inserting an "IfErrors" command directly after your SetOutPath statement. (Might also want to check for error after the file command.) Something like this: code: |
1 Attachment(s)
I don't know what is going on here :hang:, but it should work. I have uploaded an example to this post that contains the source .nsi, ClockIt.txt, and the resulting .exe. I am using NSIS 2.15 for my coding.
[edit]Still works with the trailing backslash in the directory page path.[/edit] |
O M G
I feel like such a retard. I don't know why, but when I changed the file above, it worked. Now I can't get it to not work. I have no clue what I was doing wrong, they all look identical. Could a space somewhere throw things off? Arggg, I feel stupid. |
There, there, its all right now :o. Stupid little errors do creep in, and this was the simplest one yet. I don't know what you were doing wrong, but it always worked for me :D.
|
| All times are GMT. The time now is 05:18. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.