Archive: Problew writing variable values to ini file.


Problew writing variable values to ini file.
Good day.

Code:
Section
${if} $PllS == ${Pll1}
StrCpy $Pll "30000"
${else}
StrCpy $Pll "20000"
${EndIf}
SectionEnd

Section
Push "#FPLL := $Pll" #text to be replaced
Push "FPLL := $Pll" #replace with
Push all #replace all occurrences
Push all #replace all occurrences
Push $INSTDIR\config\Chip.mk #file to replace in
Call AdvReplaceInFile
SectionEnd

Function summary
!insertmacro MUI_INSTALLOPTIONS_WRITE ioA.ini 'Field 2' State "PLL frequency in kHz: $Pll .\r\n"
;or WriteINIStr $PLUGINSDIR\ioA.ini 'Field 2' State "PLL frequency in kHz: $Pll .\r\n"
FunctionEnd

expected result:
after choice are made installer will show a page on which would be displayed
PLL frequency in kHz: 30000 (or 20000) .

real result:
installer shows page
PLL frequency in kHz: .

Question: why the variable's value isn't inserted in ini file.

Thx in advance. :)

Best regards.


Which is displayed first? Your custom page or the InstFiles page?

Stu


!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPage0Pre
!insertmacro MUI_PAGE_COMPONENTS

!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPage1Pre
!insertmacro MUI_PAGE_COMPONENTS

!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPage2Pre
!insertmacro MUI_PAGE_COMPONENTS

Page custom summary

; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!define MUI_FINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES


Well there you go then. How can you expect $Pll to have a value when your sections are executed after your custom page?

Stu


so, when i put my custom page AFTER instfiles page - it work fine.

but the problem is that i need it to be displayed BEFORE instfiles and before directory page.

Best regards.


Sections are executed on the InstFiles page only, in which case move the code in your section to the summary function.

Stu


....erm, Afrow UK, maybe you can give me some example based on my first post in this thread, please? :)

Best regards.


Function summary
${If} $PllS == ${Pll1}
StrCpy $Pll "30000"
${Else}
StrCpy $Pll "20000"
${EndIf}
!insertmacro MUI_INSTALLOPTIONS_WRITE ioA.ini 'Field 2' State "PLL frequency in kHz: $Pll .\r\n"
FunctionEnd


Stu

Nice. It work's fine.

Thanks again Afrow UK.

Cheers.

Best regards.