Skip to content
⌘ NSIS Forum Archive

InstallOptionsEx

368 posts

deguix#
Yes, but you should create "Unknown" controls for controls that don't exist on InstallOptions.
deguix#
InstallOptionsEx 2.4.2 beta 1 - DLL

Not so many things this version were implemented, but the implementation of TreeView was the feature I spent my time the most. Other big changes were the fix of a bug existant since 2.4.1 beta 10 about Password controls, and the inclusion 4 brand new INI value names for "Field #" INI section. Take a look at the changes:

- Added new control type: TreeView.
- Major Fix: Password controls without a value for Text INI value name gave a fatal error.
- Added new flags to Flags INI value name: CHECKBOXES for TreeView controls, TRANSPARENT for Animation controls (second implementation).
- Removed flags from Flags INI value name: RIGHT for CheckBox and RadioButton controls, LEFT for UpDown controls.
- Added new INI value names for "Field #" INI sections: Align, VAlign, TxtAlign,and TxtVAlign.
- Removed ellipsis support for strings that pass control border boundaries on Label, Link, DropList, ComboBox and ListBox controls.
- Added tab character support for Label and Link controls.
Added carriage return, new line and tab characters support for DropList, ComboBox and ListBox controls.
- Adjusted rectangles of Label and Link controls so that the focus rectangle don't cut part of strings (only Link controls) and have at least 1 pixel of background color on the left and right of the control.
- Right-To-Left dialogs have the UpDown control to invert its position in relation to its buddy control.
- Forgot to mention about NOWORDWRAP flag for Text and Password controls in the documentation.
- MaxLen INI value name for TrackBar controls didn't calculate correctly the maximum number of items. Now if you specify 10, there will be 10 items.
- Aplied patch #1164307.
dandaman32#
Would like a "display and continue script" function (for things like showing a trial version nag screen and disabling the Next button for 5 seconds)

-dandaman32
dimator#
InstallOptionsEx Progress Bar Usage

Hi, I'm curious to see a usage of the progressbar control. What I tried to do was this:


Function MyPage
InstallOptionsEx::initDialog /NOUNLOAD "$PLUGINSDIR\test.ini"
Pop $hwnd
InstallOptionsEx::show
Pop $0

StrCpy $R0 "0"

loop:
WriteINIStr "$PLUGINSDIR\test.ini" "Field 2" "State" "$R0"

IntOp $R0 $R0 + 1
Sleep 25
IntCmp $R0 100 +1 loop +1

cancel:

FunctionEnd
Where Field 2 is a progress bar of course, but I guess that's not the way, because IOEx::show does not return? Any suggestions?

Thanks
deguix#edited
You have to use SendMessage to adjust the current position with the message PBM_SETPOS:

!define PBM_SETPOS 0x0402

GetDlgItem $0 $hwnd 1201 ;field # + 1200 - 1
StrCpy $R0 "0"

loop:
SendMessage $0 ${PBM_SETPOS} $R0 ""

IntOp $R0 $R0 + 1
Sleep 25
IntCmp $R0 100 +1 loop +1

cancel:
Or using LogicLib.nsh:

!define PBM_SETPOS 0x0402

GetDlgItem $0 $hwnd 1201 ;field # + 1200 - 1

${For} $R0 1 100
SendMessage $0 ${PBM_SETPOS} $R0 ""
Sleep 25
${Next}
About the docs:

- I found a problem in the new docs where "Notify" INI value name in "Field #" section disappeared. I'm gonna check this out later.
dimator#
Having such loops block other UI activity by the user, so he can't for example click Cancel. I wonder if it's possible to include
System::Call ${sysGetMessage}
and
System::Call ${sysDispatchMessage}
in the loop, to keep the UI responsive.

I am not totally comfortable with how NSIS handles the message loop, so any ideas?
dimator#
InstallOptionsEx timer auto-callback

So, due to my complete confusion regarding how to update a progress bar without blocking the rest of the UI, I have decided to hack IOEx. What I want to do is to modify the following loop in showCfgDlg() (InstallerOptions.cpp):


while (!g_done) {
MSG msg;
int nResult = GetMessage(&msg, NULL, 0, 0);
if (!IsDialogMessage(hConfigWindow,&msg) && !IsDialogMessage(hMainWindow,&msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Somewhere in there, I want to add code that will callback a function in my NSIS installer. The callback will be... called based on a timer. So when setting up the IOEx dialog, I will pass a time parameter like 500 msecs, and the above while loop will determine if that time has elapsed and call my callback. Then, in my callback, I can update the progress bar, and do all the other things I need to do.

(This whole idea is due to my frustration with all other attempts to update a progress bar automatically, without blocking the UI in a loop. I have attempted various user32::SetTimber/callback based approaches, but with no luck, so if someone can point me to the "right" way to do this, I'd be happy. 🙂 )
deguix#
Hmmm... there existed one InstallOptions modification in the past that used this feature... I could merge his idea to the plugin! I just wanted this feature to be implemented as the value name of "Settings" INI section, and to be known as a page notification (like ONTIMEOUT or something). What do you think?

I forgot about that feature, thanks for reminding me! 😁
dimator#
Sure, that is a good idea. My approach just calls the Page's leave function after a half a second (repeatedly), although that should probably be specifiable somehow, as in the INI as you said, but I have a deadline for a project, so my goal is to get it working for my needs asap.

Looking forward to your update! If it's soon enough, I look forward to using it.
deguix#
Done, I just need to prepare docs. The feature included also halts when a notification from controls is called (like ONCLICK).
deguix#
InstallOptionsEx 2.4.2 beta 2 - DLL

This version really don't have much. The only implementation is the TimeOut value name for "Settings" section. See the full list below:

- Added TimeOut INI value name for "Settings" section. This enables the page to return after the specified time. When notifications are activated, the timer pauses until "Abort" is called on page's validation function. Also, it continues to repeat until the page is closed.
- Added ONRCLICK for TreeView controls.
- Fixed ONCLICK notification flag: Only captured single-clicks when ONDBLCLICK was not set.
- Added the missing Notify INI value name on the documentation.
dimator#
The TimeOut works great for my purposes. I'm glad I'll be able to keep my IOEx standard, instead of maintaining my patches. Thanks again.
pingcrosby#
InstallOptionsEx DropList Problem

InstallOptionsEx "DropList" problem is showing the item lists all compressed togethor.

To call invoke InstallOptionsEX .. i call

!macro MUI_RESERVEFILE_INSTALLOPTIONSEX
!verbose push
!verbose ${MUI_VERBOSE}
ReserveFile "${NSISDIR}\Plugins\InstallOptionsEx.dll"
!verbose pop
!macroend

!macro MUI_INSTALLOPTION****DISPLAY FILE
!verbose push
!verbose ${MUI_VERBOSE}
InstallOptionsEX::dialog "$PLUGINSDIR\${FILE}"
Pop $MUI_TEMP1
!verbose pop
!macroend

!insertmacro MUI_INSTALLOPTION****DISPLAY my.ini
Function CustomPageFunction
!insertmacro MUI_INSTALLOPTION****DISPLAY "my.ini"
FunctionEnd
With image below shows both a non InstallOptionsEX and InstallOptions droplist . As you can see one of the droplists shows the text in a somewhat "cramped" form.

I have seen this before in Win32 but i cannot remember the reasons/fix.
deguix#
The fix is to use ListItemsHeight to a higher value (the default is 10 pixels, I think). I knew of this problem before but I didn't know if there are any computer that uses larger fonts. Thanks for the report!

You see, ListItemsHeight INI value name is similar to Height for other controls, but I just don't implement like this because that's the Windows default. You can suggest me this if you think it's better.
pingcrosby#
ListItemsHeight :: make sense. I just didnt see it in the .ini settings inside the documentation.

If i may humbly make a couple of suggestions!

Could you make a note as to why you may want to use ListItemsHeight in the documentation.

Would you consider re-ordering the .ini file list in the documentation - ListItemsHeight sits between the Font... settings in my docs.

***
PS..
I really should just shut up and say thankyou for InstallOptionsEX - you ve done a fantastic job.

Its made my installer very cool..

Thanks
deguix#
Thanks. On the next version in the documentation, "ListItemsHeight" will be located right after "Left/Right/Top/Bottom/Height/Width".

Could you make a note as to why you may want to use ListItemsHeight in the documentation.
Do you mean if I could put in the docs why I chose "ListItemsHeight" instead of putting in place of the normal "Height", and not changing the actual value for "Height" to another INI value name, like "DropListHeight"?
pingcrosby#
Could you make a note as to why you may want to use ListItemsHeight in the documentation.
Please ignore this - i wrote this when i was very tired and on further reading this morning it is nonsensical. All the information is already included in the documentation.

Sorry to waste your time on this one.
KenA#
Ok, I'm lost. 😕 Has anybody has a bit of code showing how to use the ProgressBar control with InstallOptionEx ?

Thanks in advance,

KenA
KenA#edited
Hi,

I'm sorry to insist but nobody has a working piece of code using the ProgressBar control ? Or at least some pseudo code or explanations describing what should go in the pre page and what should go to the leave page ? So far I managed to either freeze the installer (I use the initDialog with /NOUNLOAD or quit with a crash without /NOUNLOAD, with no update of the control in either case. 🙁
D'oh ! The latest version (and the latest help file in particular) posted in this forum opened my eyes, so problem solved !😁

Deguix, thanks again for the great plugin even if sometimes I really struggle with the doc.👍

KenA
Yathosho#
it would probably be a good idea to replace the seperators of ListItem ("|") with something else, so one can use it for a listed item. so far i have to replace all | with $\ and all $ with $$. how about making a future version of IOEx use something else (i.e. $\n)?
deguix#
Deguix, thanks again for the great plugin even if sometimes I really struggle with the doc.👍
Sorry about that, maybe I'm better at programming IOEx than at developing docs...

it would probably be a good idea to replace the seperators of ListItem ("|") with something else, so one can use it for a listed item. so far i have to replace all | with $\ and all $ with $$. how about making a future version of IOEx use something else (i.e. $\n)?
I might never told you this, but "\n" and "\r" actually work in ListBox, DropList and ComboBox controls. Also, $\n would bring confusion between NSIS syntax. Writing that with WriteINIStr would be not good at all.

There is one thing I could do. I could create some escape characters for the characters used on lists: "\|", "\{" and "\}". It's quite unfare to don't let the user to use those characters as item names.

EDIT: Wow! This thread is quite big! It's going to beat the record of the thread with the most posts in NSIS forums!
Afrow UK#
😁

I have an idea. It would be cool to add 'tabs' (like on Desktop Properties). I could use this on one of my installers.

Something like

Type=Tabs
...
Text=Tab 1|Tab 2
State=1

Text = tab names
State = selected index

The tab clicks would act like NOTIFY and we could use them to change to another IOEx form with the exact same tabs (but with the next one selected with State field).

How easy would this be to implement?

-Stu
deguix#
Tabs are used to hold other controls. This would be a little easy because it only needs to know which controls are going to appear when one tab is selected. Also, the Tab control will need to hide or show the controls when a tab is selected.

The simplest implementation would be using the value name that I'll add for the next version which is "RefFields" value name. This will be a list of fields to be hidden or shown when tabs are selected or unselected. This list will probably use "|" and "," characters to separate field indexes.

The simplest answer then would be yes. I never thought on this idea until now. Thanks for bringing this up! 😁
saivert#
Nice, but really needed?

Tabs are great, but I don't know how good looking tabs would be in a Wizard dialog. That's why you got multiple pages and next/back buttons. But since I'm a nice guy I wont overrule this completely. Here is my tips:

Here is my pseudo INI layout:


[Field 1]
Type=TabbedPages
Text=Tab 1|Tab 2|Tab 3
State=1
; You got separate IO pages
Pages=page1.ini|page2.ini|page3.ini
Tab= ;filled in by IOEx
State in this case contains the index of the tabpage that is visible (to follow the same scheme as the other controls).
You must read the [Settings]State key from the page INI of the visible page to check for clicks on controls within a page.
deguix#
As I said, I had this idea:


Type=Tab
ListItems=Tab 1|Tab 2
State=Tab 2
RefFields=1,2,4|3
That's the simplest, effective and most useful general solution to have the least amount of addition of structure to the DLL. I'm trying to find balance between size and features.
The only thing I need to implement here is the handling of Tab controls and the "RefFields" multiple field ID's to work with, nothing more.
deguix#edited
InstallOptionsEx 2.4.2 beta 3 - DLL

Lately, my betas were slowing down, which is not good for betatesters at all. Also, the TODO's from previous versions which weren't done are now giving a toll on me. Expect to don't have new controls, and to have fast, bugfixing only builds for some versions to come.

For the plugin size, the most responsible for the increases are new INI value names. 3KB were added to the compressed build this version (19 KB now) and half of it were because of new INI value names. I'm expecting it to make somewhat near the 30KB mark at the end of beta development.

Now, on to the new features. ListView control is the newest attraction on IOEx. It has features like CHECKBOXES flag (imported from TreeView control), view mode flags, and extra options just for the REPORT_VIEW (which will be futurely used by Header controls). But Link and Button controls aren't going to be passed aside that easily. They have 2 new dialog flags: COLORREQUEST and FONTREQUEST. Let's see the full list of changes:
  • Added new value names for "Field #" section: RefField, StateImageList, SmallImageList, LargeImageList, HeaderItems, HeaderItemsAlign, HeaderWidth.
  • Added new flags for ListView controls: LIST_VIEW, ICON_VIEW, SMALLICON_VIEW, and REPORT_VIEW and for Link and Button controls: COLORREQUEST, FONTREQUEST.
  • Older INI's braking notice: All values supported by OPEN_FILEREQUEST, SAVE_FILEREQUEST and DIRREQUEST flags for Link and Button
    controls on State value name and UpDown controls on Text value name were transfered to RefField value name.
  • Now Link and Button controls with OPEN_FILEREQUEST, SAVE_FILEREQUEST, DIRREQUEST, COLORREQUEST, FONTREQUEST flags output state values to State value name.
  • UpDown controls now detect automatically the text from its buddy control. State value is not used anymore when the buddy control is set.
  • Older INI's braking notice: All values for TreeView controls on Text value name ware transfered to StateImageList value name.
  • Fixed automatic Custom Draw setting for Label, DropList, ComboBox, and ListBox. Custom Draw setting will only be set if you specify one of the color commands values. Because of this, when this setting is disabled, the colors will be as the Windows' default, and some features like multiline for those controls (except Label) will be disabled. The good news is that this fixes problems when setting text to those controls or change some colors for now. To use custom draw in controls with default color values, use empty values like on "TxtColor=".
  • Added forgotten details about Animation controls support for the State INI value, types of animation supported, TreeView controls support for the StateImageList INI value, and the ONSELCHANGE notification flag.
  • Fixed problems with notifications that executed when other handled or non-handled notifications were activated.
  • Fixed checkbox state changes on TreeView controls when the space key was pressed.
  • Other small bugfixes.

Just a note on this version, this is what I know I couldn't do yet:
  • the flag EDITLABELS is not finished.
  • the "\|" escape character is not implemented yet.
  • there is a bug on the last parameter of FONTREQUEST flag "State" INI value. The color is indicated as a decimal number.
deguix#
InstallOptionsEx 2.4.2 beta 3 post-build 1 - DLL

I forgot to fix a bug before launching it:

- ListItems of ListView controls have problems when setting empty item names.
deguix#
InstallOptionsEx 2.4.2 beta 3 post-build 2 - DLL

I made two changes to this build:

- Added EDITLABELS flag for TreeView and ListView controls.
- Fixed empty item names for TreeView controls.

This increased the build size in 0.5 KB (now 19.5 KB). First, add features, then remove unnecessary ones and fix bugs.

I think this strategy keeps me from forgetting what I changed in the plugin, because now I always have a list of what changed. I don't know, keep posting versions this quick would be good for posting numbers here in forums. At least, nobody has to wait anymore for features, because they come as fast as I implement them! 😁