Archive: InstallOptions - how to do radiobuttons choose install option


InstallOptions - how to do radiobuttons choose install option
Hi.
I have got NSIS installer for my Winamp language pack.
There are some pages, like PAGE_WELCOME,PAGE_LICENSE, PAGE_COMPONENTS, PAGE_DIRECTORY, PAGE_INSTFILES and PAGE_FINISH. User can choose whitch element he want to install. You can find it here, to see that:
My langpack example

As we can see there is an option "Skórka Nowoczesna PL" - to install (Modern Skin PL). Now, I did polish version of classic skin. So I want to do that, like in originall Winamp Installer - page to choose default skin set after instalation.
On that page (i use custom page (installoptions) after Page_Directory) it will be placed some components:
1. first image with picture of winamp modern PL
2. second image with picture of winamp classic PL
3. first RadioButton (Modern Skin)
4. second RadioButton (Classic Skin)
5,6,7 - labels
Default, radiobutton 1 is checked (State=1).
If user want to have Classic skin as a default skin he choose second radiobutton - to winamp.ini will be added that skin. If user choose Modern Skin (first radiobutton) it will be installed as a default.
After user choose first or second radiobutton and click button Next it must be write to some variable that I can use in section of Skins - in that section i will write it to winamp.ini.

Here is my example ini file (skorki.ini):

[Settings]
NumFields=7

[Field 1]
Type=Bitmap
Text=ms.bmp // it is first image
Left=0
Right=146
Top=20
Bottom=94

[Field 2]
Type=Label
Text=Wybierz, któr± skórkê Winamp ma u¿ywaæ po instalacji pakietu spolszczaj±cego. Mo¿esz pó¼niej zmieniaæ skórki, u¿ywaj±c Preferencji Winampa.
Left=1
Right=294
Top=0
Bottom=19
Flags=NOTABSTOP

[Field 3]
Type=Bitmap
Text=cs.bmp // it is second image
Left=150
Right=302
Top=22
Bottom=96

[Field 4]
Type=RadioButton
Text=Modern Skin PL
Left=24
Right=118
Top=97
Bottom=105
Flags=NOTABSTOP|NOTIFY
State=1

[Field 5]
Type=RadioButton
Text=Classic Skin PL
Left=182
Right=261
Top=97
Bottom=108
Flags=NOTABSTOP|NOTIFY
State=0

[Field 6]
Type=Label
Text=(zoptymalizowana dla wiêkszych monitorów, bardziej funkcjonalna)
Left=24
Right=135
Top=112
Bottom=129

[Field 7]
Type=Label
Text=(zoptymalizowana dla s³abszych komputerów, bardziej dostêpna)
Left=174
Right=285
Top=112
Bottom=131


Please, help me with that, I can't write it... It doesn't work. First of all, the images are not visible...
Second, how to do that user can click first radiobutton - second will be unchecked then click second radiobutton - first will be unchecked. After choose, for example second (radiobutton 2 is checked, first not) user can install files after click buttton Next...

I have:
//Pages
.
.
!insertmacro MUI_PAGE_DIRECTORY
Page custom SetCustom ValidateCustom ""
.
.
!insertmacro MUI_PAGE_INSTFILES


Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\skorki.ini "Grafika\skorki.ini"
File /oname=$PLUGINSDIR\ms.bmp "Grafika\Wizard\ms.bmp"
File /oname=$PLUGINSDIR\cs.bmp "Grafika\Wizard\cs.bmp"
FunctionEnd

Function SetCustom

InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\skorki.ini"
Pop $hwnd
!insertmacro MUI_HEADER_TEXT "Wybierz domy¶ln± skórkê interfejsu" "Dostosuj wygl±d Winampa, ustalaj±c odpowiedni± skórkê"
InstallOptions::show
Pop $0

FunctionEnd

Function ValidateCustom
??? //
FunctionEnd

I hope you understand what i mean and help me...
Best regards, Pawel


Rather than store it in a global variable, just read the State from your Section instead...

Section ...
ReadINIStr $R0 "$PLUGINSDIR\skorki.ini" "Field 4" "State"
StrCmp $R0 1 0 InstallClassicSkinA
; Install modern skin here
Goto End
InstallClassicSkinA:
; Install class skin here
End:
SectionEnd


-Stu