mmleyr
3rd July 2007 08:11 UTC
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.
Afrow UK
3rd July 2007 08:49 UTC
Which is displayed first? Your custom page or the InstFiles page?
Stu
mmleyr
3rd July 2007 08:58 UTC
!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
Afrow UK
3rd July 2007 09:11 UTC
Well there you go then. How can you expect $Pll to have a value when your sections are executed after your custom page?
Stu
mmleyr
3rd July 2007 09:15 UTC
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.
Afrow UK
3rd July 2007 09:17 UTC
Sections are executed on the InstFiles page only, in which case move the code in your section to the summary function.
Stu
mmleyr
3rd July 2007 09:33 UTC
....erm, Afrow UK, maybe you can give me some example based on my first post in this thread, please? :)
Best regards.
Afrow UK
3rd July 2007 10:15 UTC
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
mmleyr
3rd July 2007 11:40 UTC
Nice. It work's fine.
Thanks again Afrow UK.
Cheers.
Best regards.