InstallOptions error
I have encountered some problems with a custom page in my installer, i first tried it without any file in my sections
( ;File ... instead of File ... :) ) and every things worked perfectly :cool: ,
but when i re add the files i want my installer to decompress, the custom page take about 1 minute to appear
and when i finally set my preferences (thanks to checkboxes textbox ...)and clik Next it does install the whole thing
but does not execute the code of the custom page leave function :confused: .
Here is my code :
;Include Modern UI v2
!include "MUI2.nsh"
;Include a Logic Library
!include "LogicLib.nsh"
;Inculde Install Options for the custom pages
!include "InstallOptions.nsh"
...
...
;Interface Settings
!define MUI_ICON install\cstrike.ico
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP install\logo.bmp
!define MUI_WELCOMEFINISHPAGE_BITMAP install\logov.bmp
!define MUI_COMPONENTSPAGE_CHECKBITMAP install\simple-round2.bmp
!define MUI_ABORTWARNING
!define MUI_COMPONENTSPAGE_SMALLDESC
;Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
Page custom ParamAsk ParamSet
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;Sections
...
...
;My Custom page :
Function ParamAsk
!insertmacro MUI_HEADER_TEXT "Choisissez les réglagles de Counter-Strike Insalan" "Choisissez ici les options que vous voulez activer pour Counter-Strike"
!insertmacro INSTALLOPTIONS_EXTRACT "options.ini"
!insertmacro INSTALLOPTIONS_DISPLAY "options.ini"
FunctionEnd
Function ParamSet
!insertmacro INSTALLOPTIONS_READ $R1 "options.ini" "Field 1" "State"
!insertmacro INSTALLOPTIONS_READ $R2 "options.ini" "Field 2" "State"
!insertmacro INSTALLOPTIONS_READ $R3 "options.ini" "Field 3" "State"
!insertmacro INSTALLOPTIONS_READ $R4 "options.ini" "Field 4" "State"
!insertmacro INSTALLOPTIONS_READ $R5 "options.ini" "Field 5" "State"
!insertmacro INSTALLOPTIONS_READ $R6 "options.ini" "Field 6" "State"
!insertmacro INSTALLOPTIONS_READ $R7 "options.ini" "Field 7" "State"
FileOpen $0 $INSTDIR\parms.ini w
${If} $R1 == 1
FileWrite $0 "-noforcemspd$\r$\n"
${EndIf}
${If} $R2 == 1
FileWrite $0 "-noforcemaccel$\r$\n"
${EndIf}
${If} $R3 == 1
FileWrite $0 "-noforcemparms$\r$\n"
${EndIf}
${If} $R4 == 1
FileWrite $0 "-freq 75$\r$\n"
${EndIf}
${If} $R5 == 1
FileWrite $0 "-freq 100$\r$\n"
${EndIf}
FileWrite $0 $R6
FileClose $0
${If} $R7 == 1
WriteRegBin HKCU "Control Panel\Mouse" "SmoothMouseXCurve" "000000000000000000a0000000000000004001000000000000800200000000000000050000000000"
WriteRegBin HKCU "Control Panel\Mouse" "SmoothMouseYCurve" "000000000000000066a6020000000000cd4c050000000000a0990a00000000003833150000000000"
${EndIf}
FunctionEnd
And here is my installoptions file :
; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=15
[Field 1]
Type=Checkbox
Text=-noforcemspd
Left=20
Right=85
Top=15
Bottom=25
[Field 2]
Type=Checkbox
Text=-noforcemaccel
Left=20
Right=85
Top=25
Bottom=35
[Field 3]
Type=Checkbox
Text=-noforcemparms
Left=20
Right=85
Top=35
Bottom=45
[Field 4]
Type=Checkbox
Text=-freq 75
Left=20
Right=85
Top=50
Bottom=60
[Field 5]
Type=Checkbox
Text=-freq 100
Left=20
Right=85
Top=60
Bottom=70
[Field 6]
Type=Text
Left=20
Right=90
Top=75
Bottom=85
[Field 7]
Type=Checkbox
Text=Supprimer l'accélération souris de windows.
Left=20
Right=170
Top=110
Bottom=120
[Field 8]
Type=Label
Text=Paramètres de lancement de Counter-Strike :
Left=0
Right=160
Top=0
Bottom=10
[Field 9]
Type=Label
Text=Désactive la modification de la vitesse de la souris par Half-life.
Left=100
Right=326
Top=17
Bottom=25
[Field 10]
Type=Label
Text=Idem pour l'accélération de la souris.
Left=100
Right=338
Top=26
Bottom=35
[Field 11]
Type=Label
Text=Idem pour l'attribution des touches de la souris.
Left=100
Right=371
Top=36
Bottom=45
[Field 12]
Type=Label
Text=Force le taux de rafraichissement de l'écran �_ 75 Hertz.
Left=100
Right=302
Top=52
Bottom=60
[Field 13]
Type=Label
Text=Force le taux de rafraichissement de l'écran �_ 100 Hertz.
Left=100
Right=306
Top=61
Bottom=70
[Field 14]
Type=Label
Text=Rentrez ici vos paramètres de lancement de CS personalisés.
Left=100
Right=357
Top=75
Bottom=100
[Field 15]
Type=Label
Text=Paramètres de Windows :
Left=2
Right=80
Top=95
Bottom=105
I don't understant why is this working when my sections are empty, and not when i put files in my sections ...
Thank you for your help ;)