Skip to content
⌘ NSIS Forum Archive

InstallOptionsEx

368 posts

Toopak#
Ok.... I have reproduced blink effect.... Please see the scripts in the attachment. If you click "Use Win Auth" checkbox on the Profile DB group you'll see that blink. The second checkbox on PDM DB tab works just fine. The only difference is:


StrCmp $0 1 +1 +4
WriteINIStr "$PLUGINSDIR\DBConnection.ini" "Field 9" "Flags" "DISABLED"
WriteINIStr "$PLUGINSDIR\DBConnection.ini" "Field 11" "Flags" "DISABLED"
Goto +3
WriteINIStr "$PLUGINSDIR\DBConnection.ini" "Field 9" "Flags" ""
WriteINIStr "$PLUGINSDIR\DBConnection.ini" "Field 11" "Flags" ""
I need to disable the controls so when user clicks back button and then returns to this page those controls are still disabled.

Thanks in advance!

Attachments

deguix#
That blink effect is the page update I talked about which, unfortunately, didn't go well. It's slow because the DLL updates every control (the DLL only knows that the INI file has changed). Maybe a solution would be creating a new DLL call so you can inform what INI value name from a control changed in the INI file.
Toopak#
Basically I don't mind extra code in my install script to prevent this problem. I'm pretty far from C++ language (did not touch it for a few years) so I think you'll better make a decision based on your experience. 🙂

Thanks for the hard work man!
deguix#
InstallOptionsEx 2.4.1 beta 13 - DLL

Toopak: Your bug is fixed. "Page update from its INI file" feature was removed though. At least it won't blink anymore on your pages 🙂.

flizebogen: I also added the Collapse/Expand All feature to the docs. I think you're going to like the speed to load the docs 😁.

See full list of changes:

- Added VSCROLL for ComboBox and DropList controls, and READONLY flag for CheckBox and RadioButton controls.
- Text on Button controls is automatically wrapped if there has no sufficient space.
- Label, Bitmap and Icon controls can have Link controls underneath them so the "hand" cursor shows when pointing to those.
- The text of DateTime controls is now aligned to the right when RTL is activated.
- ListBox controls new feature: multiple vertical columns (see Text INI value name).
- Added "Collapse/Expand/Invert All" options to documentation.
- Optimized the documentation.
- Removed "page update from INI file changes" feature.
- Added TRANSPARENT flag for Bitmap controls.

If kichik is going to launch the new InstallOptions next NSIS version (2.05), probably the next IOEx version will be 2.4.2 beta 1 😕. I organized IOEx betas like that so I can't revert it anymore (I forgot about that IO could change). But it's still usable 🙄...
deguix#
Print? Wow, what a useful way to read one! Quite interesting...

I was thinking, what would be a great thing to release on 2.4.2 beta 1. New control types, just like I did on 2.4.1 beta 1? Maybe.... With the extra time I got from the blizzard here with 30+ inches of snow (about 75 cm of height), no school for 2 days... 😁 I think it's a great time to implement TreeView controls isn't 🙂? But it is difficult because of the grouping of items 😕 (ListItems is in only one line). I don't know if this is a great way to group items in a group...:

I|II{A|B{1|2|3}}|III{A|B|C}

It would appear like:

I
II
+-A
+-B
+-+-1
--+-2
--+-3
III
+-A
+-B
+-C

Is there any other ideas that might be a good solution for grouping items together in one line?
Afrow UK#
How about:
I|II|>A|>B|>>1|>>2|>>3|III|>A|>B|>C

Basically > makes it step inwards if you know what I mean.
I think this would be easier to use because you don't have to worry about missing a curly bracket off by accident, plus I'm sure it would be easier to parse the string in your source code too 😁

-Stu
deguix#
I'm sure it would be easier to parse the string in your source code too
It's just a little bit harder because the DLL won't know when the group will end or start (like on I|>>1) so it would need 2 extra loops, and also, it would need to record which level each item is being written to. But your idea is still brillant because of the easiness to use.

Resuming both ideas:

"{" and "}":

- Strengths:
--- Small line.
--- The item left to the '{' is always the parent.
--- Fast DLL process.

- Weaknesses:
--- Someone could forget a bracket.
--- Not easily to seen on HM NIS Edit.
--- Difficult to know which level an item is in.

">":

- Strengths:
--- Number of ">" indicate the number of levels the item is.
--- Previous item with a any previous level than the item is the parent.
--- Neatly seen on HM NIS Edit.

- Weaknesses:
--- Big line.
--- Slower than "{" and "}".

Anyone else?
Afrow UK#
Ah I see what you mean.

I was thinking about placing + to make groups, but that still doesn't tell where a group should end.
I think your original idea would be best.

-Stu
Toopak#
Re: InstallOptionsEx 2.4.1 beta 13 - DLL

Originally posted by deguix
Toopak: Your bug is fixed. "Page update from its INI file" feature was removed though. At least it won't blink anymore on your pages 🙂.
Thanks, man! Works great now! 🙂
Afrow UK#
Hey it would be ideal to make some macros to do common tasks like check/uncheck check-boxes, add list-box items and so on (in Leave function).

-Stu
deguix#
I planned to create a DLL call that warns the DLL about a change on the INI file:
Maybe a solution would be creating a new DLL call so you can inform what INI value name from a control changed in the INI file.
It'll do everything you wish for that can be also changable on the INI file (if that approach works) without even using GetDlgItem. This enables also to use InstallOptionsEx to create more than 1 page at a time (which I don't know how to do at this point), and so it goes on. It's all matter of time... and also a little bit of luck with the weather around here...
deguix#edited
As a TreeView control on generally would be compared to the Components page TreeView control, I'm trying to do these things below:

- When you don't have CHECKBOXES flag activated, State INI value only indicates 1 item to be selected.
- When using the CHECKBOXES flag, State INI value indicates the state of every item used on ListItems INI value name.

- Text INI value is the bitmap file where the checkboxes can be located. It's the same format as found on the components page. This is required or the checkboxes won't show. Requires at least: Internet Explorer 3.0.

Maybe I should stop talking about it and do it. 😞
deguix#
I was thinking lately about the usefulness of the ValidateText value name. After I included the notification system I don't think it's that useful anymore. You could do the same thing by using a notification like ONTEXTCHANGE, StrLen to verify the length of the string, and a MessageBox to show a string. Do you think I should keep it, or remove it from the next versions? (MaxLen and MinLen will still be usable to support some control abilities)
Brummelchen#edited
how to handle buttons ?

i have 2 buttons on my IO and how do i read out which one was clicked ?

it is to mention that these 2 buttons replaces 2 radiobuttons and depending on this it choses different IO pages following thereafter

before:
o bla
o blubb
[next]

after
[bla] [blubb]
(no next)

PS how to open a HLP file from a button like LINK ???
deguix#
i have 2 buttons on my IO and how do i read out which one was clicked ?
Read the "State" value name of "Settings" section of your INI file using "ReadINIStr". Like:
ReadINIFile $0 "YourPage.ini" "Settings" "State"
But, in order for the page to notify you about button clicks, you have to put a notification flag on the "Notify" value name of the field you want on your INI file. Like:
[Field 1]
Type=Button
Text=Blablabla
Left=0
Right=30
Top=0
Bottom=10
Notify=ONCLICK
it is to mention that these 2 buttons replaces 2 radiobuttons and depending on this it choses different IO pages following thereafter
In this case, you need to use WriteINIStr after the page was shown to change the "Type" value of those fields. Like:
WriteINIStr "YourPage.ini" "Field 1" "Type" "Button"
PS how to open a HLP file from a button like LINK ???
Put the full path location where it's found on the "State" of that link control. Like:
[Field 3]
Type=Link
Text=Click me
Left=100
Right=-1
Top=40
Bottom=70
State=C:\MyDir\MyHelpFile.hlp
You can also put a variable $0-$9, $R0-$R9 to specify the path if you think it's easier:

State=$R9\MyHelpFile.hlp
Brummelchen#
doesn't work here
[Field 1]
Type=Button
Text=Save
Left=30
Right=130
Top=10
Bottom=30
State=
Notify=ONCLICK
FONTBOLD=1

[Field 2]
Type=Button
Text=Restore
Left=160
Right=260
Top=10
Bottom=30
State=
Notify=ONCLICK
FONTBOLD=1
State of INI [SETTINGS] is both 0
ReadINIStr $BUTTON "$PLUGINSDIR\menu01.ini" "Settings" "State"
  !insertmacro MUI_INSTALLOPTIONS_READ $BUTTON "menu01.ini" "Settings" "State"
doesn't work either
State=$R9\MyHelpFile.hlp
nsis205, latest IOex 2.41b13

The IO is called w/o any PAGE and hast no PRE or LEAVE functions.
deguix#
The IO is called w/o any PAGE and hast no PRE or LEAVE functions.
That's why it's not working. It has to be read on the leave function. After the leave function, a page notification is always set (like ONNEXT, ONBACK or ONCANCEL) and state will always be 0.

Secondly, remove the empty "State" INI value names from your fields. The plugin will think that you want to execute something and it won't return to the leave function.

Thirdly, the "State" of a Button or Link field is the same thing as the first parameter of the Exec NSIS command. So that means if you are used to run an application like this with NSIS:
Exec "C:\MyDir\MyApp.exe"
You can just put exactly as it appears:
State=C:\MyDir\MyApp.exe
Brummelchen#
>> That's why it's not working. It has to be read on the leave function

whoops - i should have a closer look to my script (now for 1.5 years - still no end)

> page custom selectaction

Should PAGE end here ?
  InstallOptionsEx::dialog "menu01.ini"
Pop $R0
The button state should be returned state in POP (differs from back next cancel) as well...

... after a while...

ok i managed the leave function.

but now i have next problem:
i have a 3rd button [Go] which selects a language.

if i click there the code behind is working fine but the leave function does not get a new state - exactly: its empty ''
the Go-button return (aborts) back to the IO page which need to be redrawn in new language - nothing happens...


Help-Link - i tried now everything, it still doesn't work

[Field 8]
Type=Link
Text=Online-Help
Left=30
Right=68
Top=120
Bottom=128
State=

  !insertmacro MUI_INSTALLOPTIONS_WRITE "menu01.ini" "Field 8" "State" "$EXEPATH\onlinehelp.hlp"
State, path and file are correct but nothing happens.
Brummelchen#
sorry - yes - i mask some code 😉

it is: strcpy $B2BPATH $exedir > exepath ^^

later it is
!insertmacro MUI_INSTALLOPTIONS_WRITE "menu01.ini" "Field 8" "State" "$B2BPATH\online.hlp"

but that dont work as mentioned (although ini is ok)
Brummelchen#
sorry, thats not really possible, only snippets
(it's a 40kb script with many subroutines and lots of
variables and some external language files)

[Settings]
NumFields=8
Title=
BackEnabled=0
BackButtonText=< Back
NextEnabled=1
NextButtonText=Next >
CancelEnabled=1
CancelButtonText=Quit

CancelShow=1
NextShow=0
BackShow=0


[Field 1]
[Field 2]
[Field 3]
[Field 4]
[Field 5]
[Field 6]
[Field 7]

[Field 8]
Type=Link
Text=Online-Help
Left=30
Right=68
Top=120
Bottom=128
State=

strcpy $B2BPATH $exedir
;for testing purpose only cause later the path
;is compared with the real installpath from registry

!insertmacro MUI_INSTALLOPTIONS_WRITE "menu01.ini" "Field 8" "State" "$B2BPATH\online.hlp"

InstallOptionsEx::dialog "$PLUGINSDIR\$LANGSHORTmenu01.ini"
Pop $R0
The next normal IO is fully functional

[Field 12]
Type=Link
Left=260
Right=310
Top=124
Bottom=134
State=Online.hlp
Text=Online Help
... this way or i put the full path+file into it..
but not in IOex.

do you need more information ?
deguix#
Sorry, I was out of NSIS for a while, and I'm now at my school. But I can see from your code that you forgot about the Notify INI value name for Link and Button controls are always required. Clicks won't work if you don't specify this for those 2 controls. This is considered as a feature.
Brummelchen#
>> you forgot about the Notify INI value name for Link
i need notify for link ???
Do u want to fool me ? 😉
Displays a static hot text that, when the mouse is passed over its area, the mouse cursor turns into a hand. When combined with Label, Bitmap and Icon controls, this makes their areas also make the mouse turn into a hand, and execute the action of this control. It's better to don't use any text with this trick.
Please update your readme, thanks i reserved the old one
[...]See Notify value name below for more information on notifications.
I'll try...
notify=onclick works without any additional code thx

now the other point - i need to redraw the IO after abort - possible ?
deguix#
Please update your readme
As IOEx is on betas this is not a thing that is going to be usually done. My priority is more on the plugin itself than docs so maybe some kind of information on docs could be still wrong after changes.

now the other point - i need to redraw the IO after abort - possible ?
That's what I'm trying to do on next versions. Fortunately I'm going to work more on IOEx this week because of the February school vacation.😁
Afrow UK#
Originally posted by deguix
That's what I'm trying to do on next versions. Fortunately I'm going to work more on IOEx this week because of the February school vacation.😁
Damn, this is my last day today 🙁

-Stu
deguix#
If I had school Saturdays and Sundays, and they took off those winter days off and holidays, about more than half of the year would be a vacation. 😁 (180 days of school in total)