Archive: Suggestions (long)


Suggestions (long)
I have some question and oppinions regarding version 2 b0
and whether there is any plan of introducing some of these features in a (near) future version :)

1. Is there a way of conditionally creating a shortcut depending on the instalation or not of a section ?
I already found a workaround to this by testing the existence of some files/directories in the target directory
but I was wondering if there is a cleaner way of doing it.

What I'm actually thinking is to have some sort of instalation information file, that keeps the state
of the instalation as long as the application is installed.

Think if you need to install a file only if a section is selected by the user, but also to the fact that
when you uninstall you should delete the file (or perform some other operation on that file).

It will be useful to be able to know at uninstall time what sections the user chose so that you perform
an action conditionally. I know there is a workaround here also, by writing values to the registry, but
I was wondering how difficult will be to keep an ini file containing the full installation process:
type of the instalation the user chose, the files that were copied, etc.; and this file should be easily
access by some functions of NSIS. You shouldn't even have to tell which file to save these settings to,
it should use a default one in the same dir as the uninstall executable.


2. Will there be any support for if/else conditional statements ? I know you can do it with labels
but for a larger script the script code becomes unclear (I know I'm picky)
and if you were to do this, some sort of boolean expresion have to be implemented, I mean
IfFileExists should change to a boolean command like ( if (FileExists..... )
but that's probably for version 3.0 :)


3. Can you add the $USERHOME variable that will represent the user's folder ? I know about the "Shell Folders"
registry key but this one is not in there and some applications may need to store information in that folder.
I personally needed that and had to do a small app in C++ that gets it and writes it in an INI file
and then let the script use it. It's a big hassle to do this easy task as you can imagine,
but i did it for lack of a better method. Shouldn't be to difficult to add even in version 2.0 (*hint, hint*)


4. Will the string functions expand ? One way of getting the user home dir can be to do some string
operations on other shell folder paths but the string functions of NSIS are more than limited.
I mean you only have StrCpy and StrLen so far. Some regular expression would be nice ;)


5. Is there a way of performing an action if a section is NOT installed ?
if not can you extend the syntax of the script to accept something similar to:

Section "Blah blah"
; commands to execute when the section is selected
SectionNot
; commands to execute when the section is NOT selected
SectionEnd

if SectionNot is missing than it behaves just as now


6. Can you revert the way Section and SubSection work ? I mean it seems more natural to me to write

Section "Papa"
SubSection "Kiddy 1"
SubSectionEnd

SubSection "Kiddy 2"
SubSectionEnd

SectionEnd

rather than

SubSection "Papa"
Section "Kiddy 1"
SectionEnd

Section "Kiddy 2"
SectionEnd

SubSectionEnd

I mean a section has sub sections not the other way around.


7. Is there a way to display a tiny window center in front of the install window (like InstallShield does
when it has some components to register, etc. generally when the delay is not due to the install program)
that has no decorations (just a gray little window with a centered text, no titlebar, no nothing)

if not, can you put it ? :)


8. Can you expand the documentation to describe in more details how one can create his own skin,
I mean some details about modern.exe format, even if it will be only for C++ programmers.
Can you for example use non rectangular windows, or transparent ones ?


9. Can you expand the file functions ? I'm reffering to the posibility to modify an existing file
without having to rewrite it all.
Some line base functions (for text files) that can replace only a specified line would really make a difference.


That's about it, sorry if it seems i want to much from a free product but only want to make it better.
I've use it in several projects and I find it invaluable. I'm planning to start myself some of these things
when I finish my current project.

Awaiting for your oppinions.

Cheers,
Chris


1. Just put it in the section... If you want to create it in another section use SectionGetFlags to know if the section is selected.

Nothing is stopping you from writing an INI file using INI file manipulation functions and reading it in the uninstaller.

2. NSIS 3 ;)

3. What's USERHOME? And how do you get it without the registry?

Instead of writing a program that writes to an INI file you should have written a plug-in to just push to the NSIS stack... Have a look at Contrib\ExDLL for an example.

4. There is nothing you can't do with StrCpy (that takes more than 2 parmaters) and StrLen.

5. Again, SectionGetFlags should do the trick.

6. http://sourceforge.net/tracker/index...49&atid=373088

It's being considered.

7. Use Banner.dll.

8. NSIS is not skinable. You can only use normal Windows controls with the new ChangeUI.

9. Just open it with "a" mode which stands for append.
Have a look at this example: http://www.clantpa.co.uk/nsis/wiki/index.php/FileRead (also mentioned in the FAQ)


I think USERHOME is a Windows NT environment variable, so you don't need to write a plugin.


Thx for the answers guys,

USERHOME is the home folder of the user, like the user directory in Unix/Linux OSes, in 2000 it's <SYSDRIVE>\Documents and Settings\<username> and yes Joost is right there is an env variable called USERPROFILE, i can't believe i missed it :confused:


kichik I'll try some of your suggestions thanx,

some of my comments on what you said:

4. I think that there are quite a few things that can't be covered by StrCpy, for example how do you split a string by the last occurence of a char ('\' most probably for paths) ? StrCpy can copy substring to variables but how do you find the index of the char ?

8. ok, but can I create a different executable that has the exact same resources with the same settings (IDs and everything) but with different positions for the controls ? will that work only by modifing or creating a new modern.exe ?

9. thx for the link (please no RTFM ;) or FAQ in this case )
can you tell me if NSIS's file functions handle UTF(unicode) files correctly ?




Keep up the good work :up: ,
it's much appreciated

Btw, do you plan do implement a patch maker that will integrate somehow with NSIS, or at least share the same interface and script language ?


You can do everything you want with loops and StrCpy. Have a look in the useful function section in the documentation for a few examples.

To create another UI just copy default.exe open it up with Resource Hacker or another resource editor and start editing.

NSIS use Windows ReadFileA so it can't read Unicode files.

Patching won't be implemented inside NSIS. You can use VPatch.

Keep up the good work ,
it's much appreciated
Thanks :D