On Windows makensis wants it's commandline-options to start with '/' (eg. '/Dvar=val'), while it wants them to start with '-' on Linux (eg. '-Dvar=val').
This is very inconvenient since our project uses the same Makefiles for Windows and Linux and creating different Makefiles or doing hackery defines for just a simple '-'/'/' seems to be work in the wrong place.
So I would like NSIS 2.24's makensis to accept '-' as well as '/'.
Thanks for your efforts and especially for making this nice tool available for Linux! I was really positively surprised when one day I saw "makensis" in the package list of my package manager. A Windows installer generator available on Linux, yay!
Logged In: YES
user_id=35028
Originator: NO
Doing this is problematic because / is used on Linux as a directory separator and using it as an option character would prevent referencing files by absolute pathname.
I guess that it would be ok to allow - and / on Windows, it would prevent files from having a dash at the start, unless makensis supports the linux standard of turning off options processing with the double-dash: makensis -- -foo.nsi
Logged In: YES
user_id=584402
Originator: NO
Want to go for it, pabs? Both dash and slash on Windows and double dash for files starting with a dash. MakeNSISw should also know about this and always add a double dash, just in case.
Logged In: YES
user_id=35028
Originator: NO
Looks like there is already support for -- in the code on non-Win32 platforms at least. Anyway, fixed the code to allow '-' on Windows for the option character as well as '/' and also support -- on Windows. I'm not familiar with makensisw, so can you please check the change I made to it? If the changes I made are acceptable, please close this bug if that is what you normally do. Changes are available in:
Contrib/Makensisw/utils.cpp 1.73
Source/Platform.h 1.35
Source/makenssi.cpp 1.83
Logged In: YES
user_id=584402
Originator: NO
Thanks pabs.
I checked MakeNSISw and fixed the buffer allocation that wasn't adjusted.
Logged In: YES
user_id=778819
Originator: YES
Can't you escape a file starting with a slash via \-foo.nsi on Windows?
Thanks for the quick fix!
Logged In: YES
user_id=568035
Originator: NO
Wow, I'm very glad to see tis implemented!
A little bit of history:
I proposed such a solution and submitted a patch back in 2004 (see http://sourceforge.net/tracker/index.php?func=detail&aid=1055553&group_id=22049&atid=373087\), but it seems that my proposal was too "revolutionary" for that time ;-), so it was fulfilled only partially: slashes on Windows and dashes on *nix.
Amir, thank you for fully implementing it now!
Dennis and Paul, thank you for pointing out the problem again.
Nsis is a GREAT product. We are using it in SDCC project (see http://sdcc.sourceforge.net/\) as a packager for WIN32 snapshot builds, which are cross compiled on Linux, and in gpsimWin32 project (see http://gpsim.sourceforge.net/gpsimWin32/gpsimWin32.html\).
Once more: thanks to all of you,
Borut