Archive: ReadINIStr is reading an overwritten file


ReadINIStr is reading an overwritten file
On reinstalls, I am reading values from a newly re-written ini file and writing those values to an xml config file.

It appears that the call for:

ReadINIStr $1 $INSTDIR\myinifile.ini Section Value

is reading the depricated (overwritten) file. In debugging, I try blowing the old ini file away prior to writing a new one, but I still get similiar results in that NSIS can't see the newly created file so $1 = "" even though the file is there.

The process of writing the ini file is not accessible to me, so do you suggest something like:

ExecWait 'sleep (seconds)'

would allow NSIS to 'catch-up' to the new file? This sounds odd, but I do notice that my debug MessageBoxes that I plant allow some time to pass and (seems like) the values can then be read correctly.


Try using FlushINI.


I think you have to SendMessage WM_WININICHANGE.
I don't remember the details, but I am sure you can get them via Google.


iceman_k, what you said is for Win.ini file... Joost has the right answer. :up:


much appreciated, thanks for your help
mdm