Archive: Change some codes in file InstallOption on Example has problem


Change some codes in file InstallOption on Example has problem
While I am creating my installer, I have some problems.
I has looked for on example folder careful but I can not do it well.
In file InstallOptions.nsi, I repair on ioA.ini as:


[Settings]
NumFields=3

[Field 1]
Type=label
Text=Install Options Page A
Left=0
Right=-1
Top=0
Bottom=9

[Field 2]
Type=text
Left=0
Right=-1
Top=20
Bottom=58
Flags=MULTILINE|READONLY
State="Description:\r\n\r\nWhen installing for server, we need many program to install.\r\nFirstly, we will install JDK on this page

[Field 3]
Type=Button
Text=Install
Left=20
Right=163
Top=64
Bottom=84


I want to install jdk after next button is enable and run the next custom which it is the same way on Install Options.
In CustomPageA,if I use this code, I can not know HWND of dialog.



Function CustomPageA
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"

!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini"
FunctionEnd




However, I also used this to see HWND of Dialog




Function CustomPageA

!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"

!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ioA.ini"
Pop $HWND ;HWND of dialog

GetDlgItem $1 $HWNDPARENT 1 ;/Disable "Next" button.
EnableWindow $1 0 ;/Disable "Next" button.

!insertmacro MUI_INSTALLOPTIONS_SHOW

FunctionEnd




Although I use the second code, I can not control HWND of Dialog.
I mean, when I add code on function CustomPageA, It does not display to run application to set up JDK.
My code here:

Function CustomPageA

!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"

!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ioA.ini"
Pop $HWND ;HWND of dialog

GetDlgItem $1 $HWNDPARENT 1 ;/Disable "Next" button.
EnableWindow $1 0 ;/Disable "Next" button.

!insertmacro MUI_INSTALLOPTIONS_SHOW

;-------my code----------------------
ReadINIStr $HWND "ioA.ini" "Settings" "State"
StrCmp $HWND 3 Install
StrCmp $HWND 0 NextBtt
Abort
Install:
MessageBox MB_OK "Press install"
ReadINIStr $1 "ioA.ini" "Field 3" "State"
SetOutPath $PLUGINSDIR
File "e:\server\script\server\java.exe"
ExecShell 'open' "$PLUGINSDIR\java.exe"
StrCmp $1 "" 0 Validate
GetDlgItem $1 $HWNDPARENT 1
EnableWindow $1 0
NextBtt:
GetDlgItem $1 $HWNDPARENT 1
EnableWindow $1 1
;--------------------------------------

FunctionEnd

If someone use to see my prblem, please help me!!!!
Big thank for your help,
I also enclose image to express my idea
Thank you very much,

Use !insertmacro MUI_INSTALLOPTIONS_READ not ReadINIStr.

-Stu