Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   File Read & Write (http://forums.winamp.com/showthread.php?t=210401)

PeterDev 14th March 2005 20:24

File Read & Write
 
Hello,

I have development an installer with custom files. users responses are stored in the $PLUGINSDIR\FileName.ini.

As one of the requirements, I need to write out a general user respone file (ie:\ for silent installs, for configurator components, etc ... ).

I do this, and it works fine until the temporary file of $PLUGINSDIR\FileName.ini has been modified with WriteINIStr.

So, I can open the response

FileOpen $FileHandle "$INSTDIR\ResponseFile.xml" w
FileWrite $FileHandle "Response Value"
...
FileClose $FileHandle

but as soon as I try to read the value from the updated '$PLUGINSDIR\FileName.ini' with
ReadINIStr $TEMP_VAR $PLUGINSDIR\FileName.ini "Field 4" ListItems

The installer throws a file create error for $INSTDIR\ResponseFile.xml. If I do not update the screen references by '$ScreenFile', then no problem..

Any idea how I can do this ?

PeterDev 14th March 2005 20:41

I found that the WriteINIStr is the culprit. I suppose of leaves the file open (marked dirty) ?

How can I close the file ? or what do I need to do ?

deguix 14th March 2005 23:44

Quote:

I found that the WriteINIStr is the culprit. I suppose of leaves the file open (marked dirty) ?
Maybe attaching your script used would be better to clarify this. Maybe the .xml file has been opened first with another FileOpen, or you're running it somewhere? Maybe you're using FileOpen with WriteINIStr, and thus the error? Or maybe you didn't use FlushINI (Win9x) to update the INI file and thus, you read it without success? I don't know.

PeterDev 15th March 2005 12:28

I though about including the script, but it is getting rather lengthy. I did use FlushINI command... same error.

The workaround is to store it in a variable...


All times are GMT. The time now is 05:06.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.