Archive: NSIS 1.8b, needs testing and love


NSIS 1.8b, needs testing and love
Hello all.. a couple of days ago I put together NSIS 1.8b, which consists primarily of a few architectural changes as well as some added features.

These architectural changes let us be more flexible in calls and gotos. To be more specific, you can now get the address of a label or function, and call or goto that address. The address can be stored in a user variable, so you can now do things like callback functions.

Anyway, I had to change a lot to make this possible, so things need a lot of testing. I've given it some, and all the obvious bugs have been removed, but any help or reassurance would be appreciated.

I've also just updated it more with 1.8b2, which is on http://firehose.net/free/nsis/. 1.8b2 adds even more functionality relating to relative jumps, as well as getting the current code address.

(edit) Also, I updated it so that labels beginning with a `.' are global. Fun.


-Justin


Holy Crap!!!!!!

Awesome!!!!
-Duane


Justin,

I have a small backup installer that does nothing more than creating another installer script and building it.

It would be nice if this "generator" installer could be output to $temp\gen.exe but trying something like that doesn't compile (at least in 1.7).

If this can be fixed without bloating things it would be nice.

Thanks, Andi


suh-weet.

now i guess i have to update slate blue...whahhhh


Originally posted by AndiG
Justin,

I have a small backup installer that does nothing more than creating another installer script and building it.

It would be nice if this "generator" installer could be output to $temp\gen.exe but trying something like that doesn't compile (at least in 1.7).

If this can be fixed without bloating things it would be nice.

Thanks, Andi
You could have the generating installer write the OutFile command to the script manually, ala:


SetOutPath $INSTDIR
File myfile.nsi
FileOpen $R0 $INSTDIR\myfile.nsi a
FileWrite $R0 "$\r$\nOutFile $TEMP\gen.exe$\r$\n"
FileClose $R0
ExecWait ...


Get my drift? Or maybe I misunderstood you...

-Justin

Slight misunderstanding: I'm not interested in the generating installer itself (it is writing the final one to a fiel as you assumed), that one should be build in the temp directory like:

Name "Find Files"
OutFile "%temp%\Find Files.exe"
Caption "Find Files"

"Failed to obtain setup.exe from the script"


A few minor problems
It seems you forgot to add "config.h" in "exehead\resource.h" which is needed by the "NSIS_CONFIG_XPSTYLE_SUPPORT" stuff.

Also in "zlib\infutil.h", the definition of "UPDIN" is not accepted by gcc (again :D). It needs a cast for "z->total_in+=p-(cast)z->next_in;". I didn't know which type you used, so change "cast" by what you need.

At last, VC seems to reconstruct the "exehead\resouce.rc" because it deleted the windows.h include, the little tweaks for the windows and added "afxres.h" again (I really don't know why it adds this).

Nels


I've got an idea for a feature-change:
Is it possible to make it so that the use can choose to create a uninstaller or not? Maybe the UninstallExeName can be included in a section, which the user can disable. This isn't possible yet and that's a pitty I think.


Effin ell Justin... you've been busy! Macros? You'll be giving us classes next ;)

It's handy being able to modify variables like $EXEDIR and $CMDLINE - will help simplify one of my functions..

Bug - (in the uninstaller only) when finished, the progress bar has not reached 100%.

Idea - Allow labels to be Called directly - sort of having local functions?

--
Dave


NSIS 1.8b3
I tried to compile NSIS 1.8b3 with -> no problem ;)

In fact, only one but it's more a windres issue : it defines WS_POPUP, WS_BORDER and WS_SYSMENU by default, so it causes problem with the child windows. I'll contact the mingw (gcc for win32) team to discuss this.

I attached the gcc Makefiles if somebody wants to try it. These are my first makefiles so please be cool with me :D

Nels


Sorry
Here are the makefiles


Again
Sorry, it's me again.
Forget about the windres issue. It's now corrected (in binutils 2.11.92). It means that NSIS compiles with gcc with NO problem ;)


Heh try them with nsis 1.8b4 :)

Cool.. These makefiles don't work for me (some weird error with make), maybe I'm using too old of a cygwin/ming... My make version is 3.77. The error I get is

', needed by `all'. Stop.target `exehead


Strange. Anyway, mind if I distro these makefiles (once they seem to work) in the distro? :)

-Justin


Compiling with mingw
I used make 3.79 which is included in the main package.

Here is a small howto:
1/ Go to http://sourceforge.net/projects/mingw and download 'MinGW-[version].tar.gz' (actual version is 1.1, here is the direct link http://prdownloads.sourceforge.net/m...nGW-1.1.tar.gz).
2/ Decompress the downloaded file where you want.
3/ Add the [install_dir]\bin in you path.
4/ Go to the NSIS source directory.
5/ Type 'make'.
6/ You now have you 'makensis.exe'


Cool, after getting mingw32 (I was using stock cygwin before), and updating to the latest binutils, it works. :) I tuned the makefile a bit, too, but we're still at 49kb with gcc vs. 34kb with vc++. Maybe I can find a way of merging the .bss section with the .data section like VC++ does, and save another few kb. If that. Anyway, here are my update makefiles. Nels, can I distribute them with 1.80? :)

-Justin


unistall error
i get the following error on uninstall with 1.8b

install corrupted : invalid opcode

(uninstall code was ok in 1.6x)


crish, are you using the new WriteUninstaller command? Because the old UninstallExeName was 'superceded'. No idea what that word exactly means, but things have changed :)


I get the 'install corrupted : invalid opcode' error too, on uninstalling NSIS 1.8b2.
Koen, notice that this error occurs on uninstall, not on compiling the script.
But with 1.8b3 all went fine :)

~ Florian


i get the same error on the example2 script

on the nsis site, i found that its ok since b2

but i will try the b3


gcc makefiles

Originally posted by justin
Cool, after getting mingw32 (I was using stock cygwin before), and updating to the latest binutils, it works. :) I tuned the makefile a bit, too, but we're still at 49kb with gcc vs. 34kb with vc++. Maybe I can find a way of merging the .bss section with the .data section like VC++ does, and save another few kb. If that. Anyway, here are my update makefiles. Nels, can I distribute them with 1.80? :)

-Justin
Of course you can include them, that's why I sent them ;)

Originally posted by justin
Cool, after getting mingw32 (I was using stock cygwin before), and updating to the latest binutils, it works. :) I tuned the makefile a bit, too, but we're still at 49kb with gcc vs. 34kb with vc++. Maybe I can find a way of merging the .bss section with the .data section like VC++ does, and save another few kb. If that. Anyway, here are my update makefiles. Nels, can I distribute them with 1.80? :)

-Justin
just out of interest, you can get exactly midway with Borland's compiler - 41.5kb..

1.80 can now be found at firehose.net :)

http://www.firehose.net/free/nsis


Justin,

two problems have been found in NSIS version 1.80
please take a look at:

http://forums.winamp.com/showthread....threadid=68347
http://forums.winamp.com/showthread....threadid=68242

thx, greetz, Hendri.


And this one http://forums.winamp.com/showthread....threadid=68275