Archive: How to create my own plugin for NSIS


How to create my own plugin for NSIS
  Hello,
I wanna ask you how to create own plugin for NSIS. I want to write it in Delphi. I found an example in NSIS\src\Contrib\ExDLL folder, but unfortunately I don't understand it well (it doeasnt do what I want, as I understand only shows messagebox with user variable).

Maybe I will write what I want to do. I want to create a plugin that will show (on a custom page), a page with Treeview, with checkboxes. If I check some node it will write info about it to ini file.

How can I display in custom page a standard window with treeview component, using delphi plugin?
Please, if someone of you use delphi, give me some advice.
Regards,
-Pawel


You can use EmbeddedLists plug-in for tree views.
Writing to the log on the other hand is something you need to do on page leave.

Stu


Originally posted by Afrow UK
You can use EmbeddedLists plug-in for tree views.
Writing to the log on the other hand is something you need to do on page leave.

Stu
Hello Stu,
I have tested your embeddedlists plugin. But, I want to create something that we can see on MUI_PAGE_COMPONENTS -
the combobox and treeview. On this treeview I have to show items with checkboxes - to do system files associations - if user select (select checkbox) some node, it will be written to ini file and then parsed.

As I understand it is impossible to do with your plugin, because I can display only treeview - I want some more (info text, treeview, combobox).
Am I wrong?
Regards,
-Pawel

That's right, it only shows a tree view. Another option is to try InstallOptionsEx. nsDialogs will also allow you work but you'd need to do a bit of work using SendMessage in your NSIS script. Otherwise, writing your own plug-in is the way forward.

Stu


OK, I am using InstallOptionsEx. But I have problems with treeview items.

I am creating treview on custom page using this code in ini file:

***91;Field 4***93;

>Type=TreeView
Left=10
Right=-10
Top=37
Bottom=-9
Flags=CHECKBOXES -> show checkboxys on treeview
StateImageList=simple.bmp -> bitmap for checkboxes
ListItems=ParentItem_1{ChildItem_1{ChildItem_1_1|ChildItem_1_2}|ChildItem_2{ChildItem_2_1|ChildItem_2_2}}ParentItem_2{ChildItem_1{ChildItem_1_1|ChildItem_1_2}|ChildItem_2{ChildItem_2_1|ChildItem_2_2}}
>State=4{4{1|0}|4{0|1}}4{4{1|1}|4{0|0}}
Using this I want to have this tree:
ParentItem_1           -> no checkbox (4)             

ChildItem_1 -> no checkbox (4)
ChildItem_1_1 -> selected checkbox (1)
ChildItem_1_2 -> unselected checkbox (0)
ChildItem_2 -> no checkbox (4)
ChildItem_2_1 -> unselected checkbox (0)
ChildItem_2_2 -> selected checkbox (1)
>ParentItem_2 -> no checkbox (4)
ChildItem_1 -> no checkbox (4)
ChildItem_1_1 -> selected checkbox (1)
ChildItem_1_2 -> selected checkbox (1)
ChildItem_2 -> no checkbox (4)
ChildItem_2_1 -> unselected checkbox (0)
ChildItem_2_2 -> unselected checkbox (0)
It is a tree view with 3 levels. I got problems with checkboxys. It doeasn't work correctly for me. Am I writing correctly the definition ListItems=... ?

In help I see this information:

{ - Starts a new tree level. The item to the left of this character is the parent item.
| - Separates an item from another.
} - Ends a tree level.

Example:
ListItems=MyParentItem{MyChildItem1|MyChildItem2}
State=MyParentItem{MyChildItem2}

If CHECKBOXES is specified, it specifies the state of all items checkboxes with state flags (not item names). In this case, you have to follow the exact same structure of the items as on ListItems INI value name. Example:
ListItems=MyParentItem{MyChildItem1|MyChildItem2}
State=0{11|4}
Item state flags have to be joined with "bitwise OR" before writing to the INI file. Example:
11 = 0x0B = Checked + Read-Only + Bold.

Then put it like this in the State INI value:
State=0{11|4}



Please, can someone of you check my Listitems line and write correctly 3 levels treeview with checkboxys (only on 3 level)?
The second problem is how to detect that user selected for example 3 node and checked checkbox?

Thanks for any help.
-Pawel