Jeperipi
4th December 2010 05:53 UTC
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
Anders
4th December 2010 08:23 UTC
Unicode NSIS should still be able to read ascii .ini files
MSG
5th December 2010 16:58 UTC
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"
jiake
6th December 2010 01:33 UTC
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"