s793016
9th January 2006 17:24 UTC
INI File problem
Sorry, my English is very very bad.
This one is ok.
ClearErrors
ReadINIStr $R2 "some.ini" "SomeSection" "SomeKey"
IfErrors +3
DeleteINIStr "some.ini" "SomeSection" "SomeKey"
WriteINIStr "some.ini" "SomeSection" ";Somekey" "$R2"
This one is not ok right now. It never got value from ";SomeKey", I remembered old NSIS 2.0 do this code ok.
ClearErrors
ReadINIStr $R2 "some.ini" "SomeSection" ";SomeKey"
IfErrors +3
DeleteINIStr "some.ini" "SomeSection" ";SomeKey"
WriteINIStr "some.ini" "SomeSection" "Somekey" "$R2"
Is this a bug or something?
I always used those way to temporary remark some line inside inifile successful, and now NSIS 2.12 can not do the second code.
Comm@nder21
9th January 2006 19:05 UTC
maybe problems with comments handling?
as you may know, ';' is the beginning of a comment in NSIS.
there have been some fixes to the comment handling in latest NSIS versions, that may cause such problems..
bhaelochon
9th January 2006 22:24 UTC
Rather than a bug that has been introduced, it sounds like a bug that's been fixed. Semicolons indicate a comment in an INI file, so it would make sense that ReadINIStr $R2 "some.ini" "SomeSection" ";SomeKey" doesn't work. In fact, a quick test with GetPrivateProfileStringA() confirms that trying to read the value of ";SomeKey" does not return a (useable) value.
Comm@nder21
10th January 2006 12:38 UTC
ah, yes, i thought it may have been something on compiletime, but you're right, it has to do with ini file format.