sandal1306
5th November 2005 16:30 UTC
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
kichik
5th November 2005 16:40 UTC
It's "Field 3" in WriteINIStr as well, not Field3. The space is required.
sandal1306
5th November 2005 17:41 UTC
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
sandal1306
5th November 2005 18:33 UTC
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?
Animaether
5th November 2005 23:16 UTC
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
>