Archive: Problems w/ INI File Instructions


Problems w/ INI File Instructions
Lately, I've been updating some scripts of mine and I figured out something strange was going on: My INI files were disappearing! At first I thought that it was my scripting problems, but just executing the code below already reproduced it:

WriteINIStr "A.ini" "Section" "ValueName" "Value"
ReadINIStr $0 "A.ini" "Section" "ValueName"


I looked to find where my script was hiding, and I found it on my Windows dir! Imagine if the file name was "Win.ini"...

Using:

- Latest NSIS version (2.03 today's nightly snapshot).
- WinXP SP2.

The Windows directory is the default directory for INI files. I have a note about this to the documentation.


But I don't think that was the default on older NSIS versions, or maybe it should be a feature request, because all other commands using files treat a file w/o a path as it is located on current dir.


It is the default on older NSIS versions. The INI code hasn't changed much since 1.98. It works just like the Windows API does. Normal file access is relative to the current directory, but INI access defaults to the Windows directory.