|
|
#1 |
|
Senior Member
Join Date: Jul 2003
Location: Germany
Posts: 114
|
MUI2 and nsDialogs - The reason for it?
Hi,
since the latest release I try to use MUI2. I´ve some questions about it: 1. What is the reason for using MUI2? 2. Is there a list of new features compared to the old version (MUI1) 3. Will MUI1 be supported in the future, too? Then I tried to upgrade to nsDialogs, but I really don´t know how to upgrade my current custom installpages to the new nsDialogs. A few questions about it: 1. Is there an editor to create own custom pages with nsDialogs? 2. How can I set some data (some text or activate a checkbox or a radio button) to a control in my custom page? Should I use SetUserData? How should I use it? Is there an example for doing this? 3. Will InstallOptions be supported in the future? At the moment I don´t see the big advantage to use MUI2 and nsDialogs. I´ve used in my software several custom pages and with some real time notifcation in the dialogs without any problems. Maybe someone can give me a hint why I should use this and how to upgrade it? Best regards Rainer |
|
|
|
|
|
#2 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
nsDialogs is faster and provides more features as compared to InstallOptions. The main features of MUI2 are similar to MUI1, but it is easier to customize or extend. For example, the Multi-User header files provides a MUI2 page. And of course MUI2 uses nsDialogs so the performance is also better.
New features will only be added to MUI2/nsDialogs, but MUI1/InstallOptions will continue to be included in NSIS 2.x. So you don't need to hurry to upgrade existing scripts with custom pages. For new projects MUI2 is recommended. |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
How can you say its easier to extend? With MUI1 you can move controls around on the welcome/finish page just by editing the .ini @ runtime, with MUI2 you would have to call SetWindowPos and GetWindowRect etc, no?
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jul 2003
Location: Germany
Posts: 114
|
Hi,
is it possible to use a graphical editor to create custom pages with nsDialogs? Best regards Rainer |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Not yet that I know of.
Stu |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Feb 2008
Posts: 12
|
I agree about this graphical editor when using nsdoalogs, i dont think i shall be using it until such a tool comes out.
Mind you i aint getting very far with the previous way of doing it either. lol regards bazzauk2002 |
|
|
|
|
|
#7 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
I think it is fairly unlikely that there will ever be a visual designer for nsDialogs for the following reasons:[list=1][*]nsDialogs can be used for any windows control and can therefore be different from OS to OS. e.g., there may be some controls which are supported on Windows XP and not on Windows 95, etc. It will be extremely difficult and time-consuming to develop such a versatile GUI designer.
[*]nsDialogs commands are interspersed with regular NSIS commands (and can indeed be split over multiple functions and/or macros). Any GUI designer will have to perform advanced parsing of NSIS scripts to even have a hope of handling this. [*]nsDialogs commands can accept variables which can be modified at runtime. It is not possible for a design-time GUI to predict what can happen at runtime.[/list=1] A workaround would be to use the existing InstallOptions designers to visually design your dialog, and then use existing macros to convert them to nsDialogs commands. Unfortunately, however, this is a one-way process, since any modifications made to the generated nsDialogs commands will not be reflected in the original INI file. If you are not terribly affected by the performance gains of nsDialogs over InstallOptions (have these ever been quantified, by the way?), and are happy with the limited subset of control types supported by InstallOptions, then perhaps you may have no need to switch from InstallOptions at all. |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Jul 2003
Location: Germany
Posts: 114
|
I´ve created several setups with NSIS and every setup contains several at least one custom page. Some setup contains more custom pages than the default pages. At the moment I´ve no need to use some other controls like the default controls.
I think the InstallOptions are very beautiful for beginners to create custom pages, because it is very easy using the graphical editor. Without a graphical editor I can´t imagine to create custom pages without it and I think a professional setup creator must contain an editor (by itself or by a third party vendor) to create custom page. I also don´t want to create my HTML site with notepad! This is really a reason for me not to use nsDialogs, except when I must use it (NSIS > 2.x). So, please don´t beat me . I partly agree with you and I understand the reasons to implement it, but I´m not really convinced of the new implementations. I think it is a big break and at the moment (or nearly in the future) I can only see new work for me .Best regards Rainer |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Dec 2005
Location: Glow
Posts: 285
|
Well creating / and using pages with nsDialogs is actually very similiar to creating windows with Windows api. The whole CreateControl call is just kind of wrap around the CreateWindowEx function.
With this design developers that has ever created applications with windows or dialog boxes (what kind of makes sense if you are already creating an installer for your application) should feel right at home when using nsDialogs. And I think this is definitely the right direction to go. And what comes to graphical designer... There never might be a such complete designer as iceman_k describe, but I am quite confident that nsDialogs designer(s) to create the basic layout for pages will appear at some point. Cheers
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Mar 2008
Posts: 129
|
I was kind of wondering about the differences as well. As far as I can tell, the benefits offered with nsDialogs in my case isn't worth the additional complexity.
I know that the documentation says to only use nsDialogs in the MUI2 welcome and finish pages, but can I still use install options with other custom pages and have them share the mui2 look, like the HEADERBMP ? I am doing my first custom dialog and am confused about which direction to go. My one custom dialog will be very simple for the most part. I'm not a big fan of win32 programming. I'd rather not have to read through two sets of documentation to determine which is right for me. If I have to use MUI 1 with install options, then do you tihnk I would regret using MUI 1 if my custom dialog is very simple? |
|
|
|
|
|
#11 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Mar 2008
Posts: 129
|
Thanks for the prompt reply. I'm glad to hear the install options will work with MUI2. I'm not trying to knock nsDialogs, as I can see the power of it when that is needed.
|
|
|
|
|
|
#13 | |||||
|
Senior Member
Join Date: Jul 2003
Location: Germany
Posts: 114
|
Quote:
Quote:
Quote:
Quote:
Quote:
Nevertheless I prefer MUI2 + IO and I avoid using the nsDialogs. I really don´t want to upgrade my setups to nsDialogs because this takes so much time. Best regards Rainer |
|||||
|
|
|
|
|
#14 | ||
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Quote:
Quote:
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
||
|
|
|
|
|
#15 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
I think the best option for a dialog editor would be to store the dialog in some generic format and allow it to be exported to InstallOptions INI or nsDialogs script code.
|
|
|
|
|
|
#16 | |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
Quote:
Doing a one time parse to generate the installer is reasonably easy. However, creating and maintaining a model in memory which is synchronized with text editors is very complex. I have made an attempt to create such a parser, but I simply don't have the time- it is a full time effort. Creating an intermediate format in which dialogs can be stored is trivial. However, the true power of a GUI builder lies in its round-tripping capability- and that will get lost if the GUI representation is not synchronized with the textual representation. Just my 2 cents. |
|
|
|
|
|
|
#17 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
I agree that round-tripping can be useful, but using an intermediate format is better than having no support at all.
For InstallOptions you had to manually write the code to set texts based on variables / language strings. That should now be possible with a GUI builder. |
|
|
|
|
|
#18 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Even if you want round-tripping, you can decide that you only support built-in macros in nsDialogs.nsh. That's not much worse than other available solutions. Even with a proper AST, you can't handle loops or functions. Actually, you always can, but it'd be harder and harder to represent, no matter which language you choose.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#19 | |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
Quote:
1) Only predefined nsDialogs macros will be supported. 2) All nsDialogs calls will have to be in a single NSH file. 3) nsDialogs calls for a specific dialog cannot be spread over multiple functions or wrapped in other macros. 4) No use of variables. If a variable is specified for an (x,y) location or control setting, there is no way a GUI editor can represent it correctly. etc. Given these issues, I abandoned the idea of an nsDialogs GUI builder. |
|
|
|
|
|
|
#20 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Those restrictions are not much different than those of any other GUI editors I've seen, including VEP (though that was a long time ago, so they may have advanced).
Even with all of these restrictions and more, the editor will still be at least as good and feature-complete as any of the old InstallOptions editors. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#21 |
|
NSIS Dev
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
|
One of the advantages VE has is the JDT editor with its associated AST model which it gets for free with Eclipse. Also, from what I remember, VEP was not very happy if you messed around too much with the generated code- it would tolerate only a certain level of manual modification. However, like you said, it may have improved a lot now.
The way VE works is quite interesting- from what I remember, it actually fires up a separate java VM in which the SWT or Swing widgets are instantiated and it then uses reflection and the Java beans mechanism to interact with the widgets. Because these are objects which it can interact with in real time, runtime behavior can be emulated reasonably easily. e.g., it can use the AST to determine variable values, etc., at runtime and use those to interact with the widget classes and determine how they react to variable inputs. I am not sure how other Swing GUI editors work and how flexible they are. |
|
|
|
|
|
#22 |
|
Senior Member
Join Date: Jul 2008
Posts: 157
|
|
|
|
|
|
|
#23 |
|
Senior Member
Join Date: Nov 2005
Posts: 115
|
GUI editors are mentioned. You can use a program called ResEdit, kinda like ResHacker, but it's much better than ResHacker. Set the size to 140 high and 300 wide and no border, and design away. Once you have what you want then grab the x y w h values and use those. It only lists dialog units, when using other languages or DPI settings I recommend staying away from using pixels. So much better than guessing and repeat compiling and hoping your nsDialogs page will turn out how you want it.
I also used ResEdit when customizing the included UIs. http://www.resedit.net/ (You don't need the Platform SDK.) ResEdit is still being updated, ResHacker was last updated in 2002. As a warning though, save your form often because ResEdit tends to crash. Also when creating a new page I create a mini script, very small and fast to compile. So if your program is large you don't have to wait long to see how your page turns out, and using DetailPrint or MessageBox to see if the variables you use return the desired values. Last edited by redxii; 26th September 2010 at 09:01. |
|
|
|
|
|
#24 | |
|
Senior Member
Join Date: Jul 2008
Posts: 157
|
Quote:
|
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|