Archive: Suggestion for improving NSIS 2


Suggestion for improving NSIS 2
  While i was working with NSIS, there are a few things that could be better.
First of all the documentation:
- You should add a paragraph describing the style, how the functions are explained ( "|" means or and "[ ]" means optional parameter ). I would like to know: If more than one parameter is optional, can i omit other parameters, when I only like to set the last one?
- You should document the usefull function GetWindowText (used in System.nsh).
- I can hand over more than one parameter to CallInstDll. The second one must be something like functionname. It's is not yet in the documentation.
- Apparently is is not possible to call SendMessage with WM_SETTEXT and the first parameter as LangString variable. Even if it begins with "STR:". It only works that way:

SendMessage<ID> ${WM_SETTEXT} 0 "STR:$(LangString)" 

. Please add that info.
- More information about SetRebootFlag? Is it only a variable or does the setup automatically reboot, if this flag is set? Is there a MessageBox asking the user, what to do?
- Modern User Interface: Add docu about !insertmacro MUI_LANGDLL_PUSH. Does the second parameter always have to be the lang. name in English?

Things regarding the code:
- One function should be able to be called from Install as well as Uninstall. That's not possible because every function called from Uninstall must begin with "un.".
- What about a function setting these entries in the registry. They add Uninstall information the the Control Panel -> Add/Remove Software. Especially the items NoRepair/NoModify made the "(only remove)" string unnecessary.

Windows

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "DisplayName" "${MUI_PRODUCT} ${MUI_VERSION}"
>WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "UninstallString" '"$INSTDIR\uninstall.exe"'
>WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "Publisher" "Konrad Windszus"
>WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "URLInfoAbout" "http://www.wincd.de"
>WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "URLUpdateInfo" "http://www.wincd.de"
>WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "HelpLink" "http://www.wincd.de"
>WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "DisplayVersion" "${MUI_VERSION}"
>WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "NoModify" 1
WriteRegDWORD HKLM"Software\Microsoft\Windows\CurrentVersion\Uninstall\WinCD" "NoRepair" 1
>
- I would like to have another standard page for displaying readme files. I made changes to the license page, but that's very complicated. It should be also a rich edit control.
- Another page with checkboxes for desktop and quicklaunch shortcuts would also be very nice. I made one page and I will supply it in the Archive.
- Last small thing. If you insert custom pages, the caption should start with ":" to be uniform to the others. Perhaps you could automatically add the ":" that the caption is only the raw caption like "Installation Folder" in DirPage.

At least thank you very much for that great work! NSIS is definitely the best installer for small projects!


Thank you for the quick answer.
- SendMessage with WM_SETTEXT and the second parameter as LangString variable (it was a typo in the first topic) doesn't work. Only "STR:$(LANGSTRING)" does. Why?
- The reboot flag should be used in an example. If i set the reboot flag to true and in the MUI there is a checkbox. What if the user deselects the checkbox. Is the reboot flag then set to false. When (in which function in MUI) should I call Reboot? Is the setup closed first? You should add some more infos or an examle regarding this topic!


This one actually is documented :)

To send a string param, put STR: before the parameter, for example: "STR:Some string".
As a $(something) translates into a string and you want to use it as a string you must put STR: infront of it. If you don't, it will treat it as a number.

Yep, the reboot checkbox is documented in the MUI docs. We'll add it.
In the MUI if when it reaches the finish page and the reboot flag is on, it will present the user with two options - to reboot now, or later. If the user chooses now the MUI will reboot. If you are not using the MUI you will have to reboot yourself in .onInstSuccess for example.

I don't know whether is already is, but you, Konrad, should post your 'Uninstallkeys for Windows' sample in the Archive. (no KiCHiK, why I don't do it? Because it's his code!) And maybe KiCHiK can include a small sample in the NSIS package which uses this code.


I added a page to the archive under Tutorials, which explains how to create a link in the Windows Control Panel.


Thanks a lot!