- NSIS Discussion
- Library.nsh
Archive: Library.nsh
pabs
5th October 2005 10:00 UTC
Library.nsh
In Include/Library.nsh, I see several lines like this:
!include "${NSISDIR}\Bin\LibraryLocal.nsh"
If the user isn't logged in as an Administrator, then this won't work because they won't be able to edit/create files in ${NSISDIR}\Bin\. This is in version 2.10 BTW.
kichik
7th October 2005 14:43 UTC
Thanks, fixed.
I've added !tempfile and !delfile, modified LibraryLocal to accept an output file on the command line and updated Library.nsh to use it.
!tempfile uses mkstemp on *nix and !delfile simply uses unlink. They can be used to fix the portability issues in LogicLib.nsh. However, there's still a problem with the quoting in the !system call.
pabs
8th October 2005 11:17 UTC
Excellent news, thanks! Should be able to fix the !system quoting in a cross-platform way - IIRC, cmd.exe can use "quoted text", and probably command.com too.
kichik
8th October 2005 12:34 UTC
It can use quoted text, but echo itself takes the line as is. Using:
echo "asd"
will output:
"asd"
Even if there's a switch for cmd.exe or command.com to treat the quotes otherwise, how can you call cmd.exe with the switch in a portable method?
pabs
9th October 2005 12:04 UTC
Hmm. I see 2 options:
Set an environment variable or registry item to enable the correct quoting on Windows. Not sure if this is available.
Instead of using echo, would it be possible to create file writing functions like !fileopen, !fileread, !filewrite and !fileclose? These would be build-time functions.
kichik
9th October 2005 13:56 UTC
I was actually thinking of adding !fileappend and !filereadline while I was at it. But I didn't want to bloat it too much. But I guess I'll add it anyway, unless someone has a better idea for this.
Comm@nder21
9th October 2005 14:13 UTC
when you add more build functions ...
why not simply remove all and replace them by:
!compiletime
!compiletimeend
every plain nsis code between those lines then will be run immediatly. :D
just an idea ...
kichik
9th October 2005 14:55 UTC
That'd require a weird merger between the exehead code and the compiler code. How would you handle defines? How will !ifdef be done? It'd also not work on POSIX because the exehead code is very Windows specific.
Comm@nder21
9th October 2005 19:15 UTC
hey, this has been more or less a fun posting :D
kichik
12th October 2005 16:33 UTC
I've added !appendfile.