Archive: Put field from FileRequest in an INI file


Put field from FileRequest in an INI file
  I'm trying to copy the result of a FileRequest in an INI File.
Here is my code:


Function EnvironmentPath

!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "axatica install.ini"

FunctionEnd

Function EnvironmentPathLeave

;Get fields
!insertmacro MUI_INSTALLOPTIONS_READ $Path_MatikaExe "axatica install.ini" "Field 3" "State"

WriteINIStr $PLUGINSDIR\option.ini Field3 State $Path_MatikaExe

FunctionEnd


I've also tried the ReadINIStr as indicated in the InstallOption but nothing seems to work.

Any help will be more than welcone


It's "Field 3" in WriteINIStr as well, not Field3. The space is required.


Hi kichik -

I've modified my code according to your suggestion:


Function EnvironmentPathLeave

;Get fields
!insertmacro MUI_INSTALLOPTIONS_READ $Path_MaticaExe "axatica install.ini" "Field 3" "State"
WriteINIStr "$PLUGINSDIR\option.ini" "Field 3" "State" $Path_MaticaExe

FunctionEnd


But this still does not fix the problem. The INI is not updated....

Any other suggestion


Ok your fix is working fine... Thanks a lot...

My problem was that I wanted to modify a INI file which is part of the installation.
So I have to put my custom page after the INSTFILES one.

Is there any trick to update o file during installation?


You can always adjust the file right after you write it out with the File command.
Or you can make any adjustments to files you just installed in a hidden section. E.g.


Section "-PostInstall"

# do stuff here
>SectionEnd
>