Archive: quirks


quirks
hello all!

i'm developing an installation tool based on nsis and have the following quirks/issues/suggestions. please be so kind as to have a look at these, perhaps they are known issues.. (read faq, read help, searched forums etc.:))

1. trying to pack everything in the folder i'm compiling at, tried a lot possibilities, best one yet seems to be File /r "*" , but it does not create the subdirectories itself, i have to CreateDirectory every directory before it :(( is there a smarter way?
2. this unpack thing executes in the script .oninit, and results in no dialogs, no wait-cursors, the user sees nothing when the extraction is done. is there a way to change this (i really need to place all files into $EXEDIR\somedir), a requestable dialog like the one showing up while the installer is checking its integrity would be great.
3. when skipping every startup pages with abort in their init, when the first displayed page is the installoptions (coming right after the section selection), it does not have a valid title area (since the prev. page was not painted). this does not look too nice. can this title area somehow be forced to be painted, yet with the original page being skipped. or can (does) the installoptions page have a custom title area, set via insertmacros?
4. wanted to change the finish page string for the readme, used !insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_FINISH_RUN "hit me baby one more time" , it gives a warning message in the end of the compilation. (works fine though.) can this warning be quelled somehow.
5. i cannot understand the disk space requirement calculation strategy: why isn't it calculated compile-time, when inserting the files? currently i use a script-wide constant with a rough estimate..
6. .onsuccess, i copy all files for the user to a separate directory. i could not get to the readme display to use this directory though, it seems that the readme display does not wait for .onsuccess, so i open it from the internal temp dir, resulting in displaying a file that does not exists really.. not too nice.
7. CreateDirectory does not return error if it was unsuccessful (eg. a file exists with that name already, or due to ntfs restrictions). should check manually after it, i guess :(
8. for disabling parallel running instances of the installation program, eg. a semaphore-like ReadAndSetINIStr would be really nice. now i have to hope that two programs don't enter the unsafe section between ReadINIStr and WriteINIStr (pretty highly unlikely although).
9. a compiled pack of nsis with enabled logging would be really welcome. a colleague tried to compile and the result gave nasty asserts :(

a request: PLEASE PLEASE include a general notice in the dox that the error flag is transparent. for ones like me, the assembly-style of code may result in one's thinking that errorflag is like carry and is _set_ according to the result of the internal functions (so like, i expected to be cleared if a fn returns with success). okay, the description itself says it, but i think one separate notice somewhere would be great.

any comments would be welcome :)


1) Use File /r for the subdirs.

2) Use the Banner plug-in

3) Set the tile using the MUI_HEADER_TEXT macro.

4) You should not insert the macro. Define MUI_TEXT_FINISH_RUN before the MUI_LANGUAGE macro.

5) What is wrong? It does check the size of all files.

6) Why not copy it in a section?

7) Using the latest version (NSIS 2 beta 3)? It should set the error flag now.

8) Use the system plug-in to set a mutex so you won't get problems with a race condition. Check the archive for an example.

9) Use the VC6 compiler (with Platform SDK installed) or VC7.


1) You have to just set the out path with SetOutPath (which creates the directory too) and NSIS will do the rest including creating the directories for /r.


thanks for the tips :) i'll try them. i have some questions/comments 'though:

1) when the tree i have to extract is some 3-6 levels deep, will it work if i File /r all the 1st level subdirectories?

4) okay, but i need to use the readme function and want to change the text for that one. there does not seem to be a string for that, or is there one?

5) mmmm i used the File /r "*", and the totals displayed 0k, could only force it with an AddSize in a section. did i catch something wrong? should the File /r set the totals?

6) uhh that's exactly what i need :))

7) b0 because i don't want to redesign all dialogs :) sooner or later i'll upgrade, good to hear that it's fixed :)


1) Yes.

5) It only counts files that are used added inside a section, not functions.


Originally posted by kichik
1) You have to just set the out path with SetOutPath (which creates the directory too) and NSIS will do the rest including creating the directories for /r.
that's what i expected as well :) i mean, my directory structure is as follows:


compile-root (with my .nsi inside, outdir is .., there are data files on this level as well)
data1
data1a
data1b
... ...
data2
...


during run-time, i need to be copied into the destination (to-be-upgraded program environment) folder and unpack my files into a subfolder like this:

exedir
other-dir-i-dont-touch1
other-dir-i-dont-touch2
...
mytemp
data1
data1a
data1b
... ...
data2
...


so .oninit, i do a SetOutPath $EXEDIR\mytemp and execute File /r "*", which does not do what i expect, but works fine if i CreateDirectory all levels of subdirs. hope it's not a b0 quirk, the iferrors behaviour change and mui dialog definitions change would mean a lot of review work when upgrading.. :(

Originally posted by kichik
5) It only counts files that are used added inside a section, not functions.
uhh, so not even .oninit? bad news :( but pretty logical though :) anyway, that could be fixed since the whole installer will be built from elements, and the builder perl script thingie can calculate file sizes, which can be included with an AddSize somewhere.

I don't remember fixing anything like this. I don't remember even touching File before two days ago (b4). Can you please attach the compiler output?


Originally posted by kichik
I don't remember fixing anything like this. I don't remember even touching File before two days ago (b4). Can you please attach the compiler output?
is it okay to send it in e-mail directly to you? it's a bit confidental, or what, you know :) and/or, is the .oninit part of it enough for you to know what's going on? :)

Sure, send it to kichik at users dot sf dot net. .onInit would be enough but I don't see how that will help you hide the files installed.


Originally posted by kichik
Sure, send it to kichik at users dot sf dot net. .onInit would be enough but I don't see how that will help you hide the files installed.
mail sent :) thx in advance. the point in sending that part only is that the code is around 45k, and the compiler output is not too short either :)

4) !define MUI_TEXT_FINISH_SHOWREADME "your text"
before the MUI_LANGUAGE macro


Originally posted by Joost Verburg
4) !define MUI_TEXT_FINISH_SHOWREADME "your text"
before the MUI_LANGUAGE macro
wow, did not notice that one, thanks :)

I can't find anything wrong with the output or the script. Are you absolutely sure it doesn't work with just SetOutPath "$EXEDIR\AutoFeriTemp"?

If not, well, try b3 :)


Originally posted by kichik
I can't find anything wrong with the output or the script. Are you absolutely sure it doesn't work with just SetOutPath "$EXEDIR\AutoFeriTemp"?

If not, well, try b3 :)
you mean changing the constant to its literal value? hope that's not the issue :) btw, the SetOutPath: "$EXEDIR\AutoFeriTemp" itself appears in the output log right before the File /r (and the fixup for the directories :)), so i guess it could not be more safe :) anyway i'll keep this one open, and looking forward to update to the newest build when i'll have some time for that.. thanks for help anyway. if i can, i shall report if the update solved this problem.

No, I meant without the CreateDirectory commands. The log shows that it does create the directories with File /r, and thus SetOutPath should be enough...