Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Put field from FileRequest in an INI file (http://forums.winamp.com/showthread.php?t=230178)

sandal1306 5th November 2005 15:30

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 15:40

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

sandal1306 5th November 2005 16:41

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 17:33

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 22:16

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.
PHP Code:

Section "-PostInstall"
  
# do stuff here
SectionEnd 



All times are GMT. The time now is 04:44.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.