Archive: Problem when readinistr in nsis unicode


Problem when readinistr in nsis unicode
Hi Guys,

now i working with nsis unicode and i need to read the firefox ini file.
because this ini is not an unicode file. then my nsis return me an empty string when calling readinistr function. this ini is default from firefox, so there is no way for me to make it as a unicode ini file. Any idea to read this file in nsis unicode?

here the script to read the ini.
ReadINIStr $1 "$APPDATA\Mozilla\Firefox\profiles.ini" "Profile0" "Path"

Thank you very much for your help.

Regards

Jeperipi


Unicode NSIS should still be able to read ascii .ini files


Possibly the path to the ini file is incorrect. I suggest you use a MessageBox to verify:
MessageBox MB_OK "$APPDATA\Mozilla\Firefox\profiles.ini"


Try this:

SetShellVarContext current
IfFileExists $APPDATA\Mozilla\Firefox\profiles.ini 0 +8
ReadINIStr $1 $APPDATA\Mozilla\Firefox\profiles.ini Profile0 IsRelative
IntCmp $1 1 +3
ReadINIStr $1 $APPDATA\Mozilla\Firefox\profiles.ini Profile0 Path
Goto +3
ReadINIStr $1 $APPDATA\Mozilla\Firefox\profiles.ini Profile0 Path
StrCpy $1 $APPDATA\Mozilla\Firefox\$1
MessageBox MB_OK "Firefox profile path: $1"