Archive: LockWindow on/off


LockWindow on/off
what does this settings do?
it's not explained in the docs, but used in modern ui (e.g. system.nsh on line 1147).


Perhaps it makes the installation window 'on top' at all times (so other programs cannot hide the window).

Try the setting and see what happens.

-Stu


E.2.2.1 Changes from 1.98

New commands: [...] LockWindow, [...] SetCompressionLevel [...].
Both of them aren't on documentation, used hiddenly by NSIS and naturaly syntax highlighted by HM NIS Edit.

well nsis is open source so just check the src if u want to know what it does (btw, it sends the WM_SETREDRAW msg to the main window)


well nsis is open source so just check the src if u want to know what it does (btw, it sends the WM_SETREDRAW msg to the main window)
the fact that the source is distributed to everyone, doesn't mean, it's READABLE for everyone ...

Sorry for bringing up an old post, but I need to explain the use of the commands (which still aren't on the docs):

LockWindow on|off:

LockWindow "on" makes the window not to redraw itself from specified commands sent by user, like showing the window. When LockWindow "off" is used, all controls that weren't redrawn since LockWindow "on" will be redrawn. This makes the pages flickering look nicer because now it flickers a group of controls at the same time, instead of one control at a time. The individual control flickering is more noticiable on older computers...

SetCompressionLevel level_0-9:

Sets the individual files compression level. Supported by zlib and bzip2 compression methods. The lesser the compression, the faster the compilation will be, but the bigger the installer is. 0 is the minimum (no compression) and 9 is the maximum (maximum compression). Default is 9.

This command is special because it can be used anywhere (outside or inside Sections or Functions) for zlib.

For bzip2 compression method, it can only be used 1 time for all files to be compressed but you still can use more than 1 time before including files to installer data.

This command affects commands that include files to the installer data (File, ReserveFile, DLL calls...).

Some files gain size by the compression (they're already compressed). With this, they can be ignored for the smallest size possible, without affecting other files that are take advantage of the compression, and making the speed of the compilation and installation faster.


Thanks deguix. I can't find ${NSIS_VERSION} in there either.

-Stu


Thanks deguix. I can't find ${NSIS_VERSION} in there either.
If anyone wants to know ALL the other defines the NSIS already defines on start besides those mentioned in docs, just look at the file "Source\exehead\config.h". There are already explainations for them.

SetCompressionLevel doesn't currently do anything.

I've added a slightly modified version of deguix's LockWindow description. I've already forgotten why I didn't want to add it to the documentation and it probably wasn't that good of a reason anyway.


SetCompressionLevel doesn't currently do anything.
Hmmmm... I doubt it. Maybe it doesn't do all the things it should do (I didn't think of this before). I've been testing it more and it works only for the levels 0 and 1.

Try this attachment below (just change the "File" lines to real files). You'll see that the one that follows 'SetCompressionLevel 1' compresses, but the second one followed by 'SetCompressionLevel 0' doesn't. The last 'SetCompressionLevel 1' compresses the rest of the installer data (not only files).

So this is actually useful. The command just needs improved more to actually support levels 2-9 (which are the same as 1).

Tested with NSIS 2.06 (no updates).
WinXP SP2 w/ all updates available.

--------------------------------------------

Maybe I should create a new description for it after this discovery :D (logically, thinking on the future of this command):

SetCompressionLevel level_0-9

Sets the installer data compression level. Supported by zlib and bzip2 compression methods. Bzip2 compression only supports the use of this command 1 time in the script. The lesser the compression, the faster the compilation will be, but the bigger the installer is. 0 is no compression, 9 is the best compression.

Wow, I discovered another NSIS command, but this one doesn't look too useful:

Nop

Makes relative jumps to be reduced 1 line. For else, it doesn't do anything. Cannot be used outside of Functions or Sections.

Example:

  Goto +3
MessageBox MB_OK "This message box will not appear."
Nop
MessageBox MB_OK "This message box will appear."
Yep! Nop! :)

mmm Null OPeration, now that is a bit of the asm style of nsis showing through :)

-daz


Ok, so SetCompressionLevel 0 works. But it still doesn't do what it's supposed to do. If you want to disable compression, just use SetCompress off. It'll be faster too.