Archive: InstallOptions Page disable the next button!


InstallOptions Page disable the next button!
I created an installer with two components. The first page of the first component is giving me a headache because its Next button is disabled all the time and I can not get to the next page.... I could not find a way to enable it!!!

Thanks for any help.

Here is my nsi script :

Caption "install test"
SetDateSave on
SetDatablockOptimize on
CRCCheck on
SilentInstall normal
BGGradient 000000 800000 FFFFFF
InstallColors FF8080 000030
XPStyle on
InstallDir "C:\"
InstallDirRegKey HKCU "Software\Products" ""
AllowRootDirInstall true
BrandingText "test"
ShowInstDetails show

!define _PRODUCT "product 1.0"
!define _SHORTNAME product10
!define _INC "Home"
!define _SMLOCATION "Products"

Name "${_PRODUCT}"
OutFile "${_SHORTNAME}-ntx86_install.exe"

ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "test.ini"


LicenseText "A test text, make sure it's all there"
LicenseData "..\source\exehead\main.c"
;Order of pages
Page license
Page components
Page directory
Page instfiles

!ifndef NOINSTTYPES ; only if not defined
InstType "Full"
!endif

AutoCloseWindow false
ShowInstDetails show

Section "Configure license file"
SectionIn 1
IfFileExists $INSTDIR\${_INC}\license\license.dat end found
found:
InstallOptions::dialog "$PLUGINSDIR\test.ini"
ReadINIStr $R0 "$PLUGINSDIR\test.ini" "Field 3" "State"
ReadINIStr $R1 "$PLUGINSDIR\test.ini" "Field 5" "State"
StrCmp $R0 "" done
FileOpen $9 $INSTDIR\${_INC}\license\license.dat w
FileWrite $9 "SERVER $R0 00000000 $R1 $\n"
FileWrite $9 "USE_SERVER $\n"
done:
end:
SectionEnd

Section "${_PRODUCT}"
SectionIn 1
SetOutPath "$INSTDIR"
WriteRegStr HKCU "Software\${_SMLOCATION}" "" "$INSTDIR\"
#File /a /r "${_INC}"
SectionEnd

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "test.ini"
FunctionEnd

And here my test.ini file :

[Settings]
NumFields=6
CancelEnabled=1
BackEnabled=1
NextEnabled=1
NextButtonText="next"

[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-5
Text=" Setting the license file... "

[Field 2]
Type=Label
Left=10
Right=-10
Top=20
Bottom=28
Text="If you know the host name of your license server please enter it here:"

[Field 3]
Type=Text
Left=10
Right=100
Top=38
Bottom=50
State=""

[Field 4]
Type=Label
Left=10
Right=-10
Top=60
Bottom=68
Text="If you know the port number of your license server please enter it here:"

[Field 5]
Type=Text
Left=10
Right=100
Top=78
Bottom=90
State=""

[Field 6]
Type=Label
Left=10
Right=-10
Top=98
Bottom=130
Text="If you do not have the above information click on Next.\r\n"


Remove

CancelEnabled=1
BackEnabled=1
NextEnabled=1
NextButtonText="next"

from the INI file. NSIS should handle it all automatically.

If you still have problems please attach a minimal example that reproduces the behavior.


Thanks Joost for your reply.

I followed your suggestion but now the problem is worse because all the buttons are disabled now! (Cancel,Back and Close). I can close it only through the tasks mananger now.

Please find a minimal example that reproduces the behavior:

InstallDir "C:\"
InstallDirRegKey HKCU "Software\Fluent Inc Products" ""

Name "my_product"
OutFile "ntx86_install.exe"

ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "test.ini"

Page directory
Page instfiles

Section "Configure license file"
InstallOptions::dialog "$PLUGINSDIR\test.ini"
SectionEnd

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\test.ini "test.ini"
FunctionEnd

And here is a minimal test.ini as well:

[Settings]
NumFields=3


[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-5
Text=" Setting the license file... "
[Field 2]
Type=Label
Left=10
Right=-10
Top=20
Bottom=30
Text="Please enter your port@host and click on close. "

[Field 3]
Type=Text
Left=10
Right=-10
Top=40
Bottom=50
State="port@host"


Thanks a lot.


Please check the InstallOptions examples and read the users manual about the Page commands.

InstallOptions should be used in a page function, not in a section.