Pawel
15th June 2007 20:57 UTC
InstallOption - custom page with skin selection
Hello
This is my problem. I want to do something like in Winamp installer - Interface and Skin Selection (on custom page we got 3 radiobuttons (modern, classic and Other) - the Other radiobutton is related to droplist)).
The Modern radiobutton is checked by default.
1. How to load to droplist all skins that are located in Winamp skin directory? I use function:
GetSkins
;Exch $5
FindFirst$2 $1 "$INSTDIR\\Skins\\*.*"
StrCpy $9 ""
StrCmp $2 "" error
again:
StrCmp $1 "" done
StrCmp$9 "" 0 append
StrCpy$9 $1
Goto readnext
append:
StrCpy $9 "$9|$1"
readnext:
FindNext $2 $1
Goto again
done:
FindClose $2
; now write to the ini file
WriteINIStr"$PLUGINSDIR\\skorki.ini" "Field 7" "ListItems" $9
DetailPrint$9
goto finished
error:
; hmmm
finished:
>FunctionEnd
>
This function works good, but this displayed all files and folders - I need to display only *.wsz, *.wal and folders, not for example something.txt.
The second issue is that this function returns something like this:
ListItems=.|..|Modern Skin|Classic Skin|
How to remove this .|.. ?
2 problem
How to do, that when I click Classic radiobutton the state of it will be saved to my ini file (I don't know why, but it doesn't work - it is saved but just after clicking Next button and close the page - I want to change its state immediately after click on it).
Or when I click Other radiobutton the state of the droplist will be saved...
(Later, I can use this state saved in ini file to write suitable skin on disk.)
I hope you know what I mean.
Thanks for any help.
-Pepe
Red Wine
15th June 2007 23:49 UTC
Probably IOex could do that,
http://nsis.sourceforge.net/InstallOption****plug-in
Pawel
16th June 2007 00:22 UTC
Originally posted by Red Wine
Probably IOex could do that,
http://nsis.sourceforge.net/InstallOption****plug-in
Hmm, It is not I am thinking about... thanks
Afrow UK
16th June 2007 12:11 UTC
Function GetFiles
Exch $R0
Push $R1
Push $R2
ClearErrors
FindFirst $R1 $R2 $R0
StrCpy $R0 ""
IfErrors done
StrCpy $R0 $R0|$R2
ClearErrors
FindNext $R1 $R2
IfErrors 0 -3
StrCpy $R0 $R0 "" 1
done:
FindClose $R1
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Function GetFolders
Exch $R0
Push $R1
Push $R2
Push $R3
StrCpy $R3 $R0
ClearErrors
FindFirst $R1 $R2 $R3\*.*
StrCpy $R0 ""
IfErrors done
StrCmp $R2 . next
StrCmp $R2 .. next
IfFileExists $R3\$R2\*.* 0 next
StrCpy $R0 $R0|$R2
next:
ClearErrors
FindNext $R1 $R2
IfErrors 0 -6
StrCpy $R0 $R0 "" 1
done:
FindClose $R1
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
...
Push $INSTDIR\*.wsz
Call GetFiles
Pop $R1
Push $INSTDIR\*.wal
Call GetFiles
Pop $R0
StrCpy $R1 $R1|$R0
Push $INSTDIR
Call GetFolders
Pop $R0
StrCpy $R1 $R1|$R0
States are only saved when the user clicks next. You should read the values in the page leave function.
Stu
Pawel
16th June 2007 14:11 UTC
Stu, thanks.
It works very well, as I want.
A little question, if you don't mind ;)
As I wrote, I got three radiobuttons on page. One of this radiobutton must be connected with dropdown list. So, how to activate dropdown list after clicking on radiobutton and display one of the founded folder (by default the dropdown list is disabled (State=DISABLED)).
I want to do it just like in Winamp installer (Interface and Skin Selection).
Regards!
-Paweł
Afrow UK
16th June 2007 14:21 UTC
Use the NOTIFY flag on the radio buttons. It will cause the leave function to be called, where you must check Settings>State for the field number in question (call Abort to go back to the page after manipulating the controls).
See the testnotify.nsi InstallOptions example.
Stu
niwrad777
22nd June 2007 03:25 UTC
Hello
This is a code example similar the script Winamp ES (incomplete).
Download Code
http://www.gigasize.com/get.php/-110...xample_nsi.zip
Niwradâ„¢
Pawel
22nd June 2007 19:39 UTC
Thank You Niwrad
I did it (thanks Afrow UK), but Your code can be usefull.
Best regards
-Pawel
niwrad777
29th June 2007 00:53 UTC
:winamp: Forgive I did not find out here they have the file.
-----------------------------------------------------------
Pawel I wait for an answer on the union of the patches in a single graphical interface
Pawel
30th June 2007 00:15 UTC
Originally posted by niwrad777
-----------------------------------------------------------
Pawel I wait for an answer on the union of the patches in a single graphical interface
What do You mean? Did You write to me with some questions?
-Pawel