You are here

[Fixed] Opera Portable Directory bug

11 posts / 0 new
Last post
veyselcelik
Offline
Last seen: 2 days 9 hours ago
Joined: 2009-05-26 11:18
[Fixed] Opera Portable Directory bug

If Opera's directory includes special characters like "ı,ş,ç,ö,ü,ğ", it won't work. For instance my directory is "D:/Prog/ı/Opera". When I execute OperaPortable.exe, It creates "D:/Prog/?/Opera/Data/profile" and some of my profile in it. Then a blank page is opening. I have to overcome this issue, bcause almost all of my folders include special Turkish characters.

veyselcelik
Offline
Last seen: 2 days 9 hours ago
Joined: 2009-05-26 11:18
Isn't it clear?

Isn't it clear?

John T. Haller
John T. Haller's picture
Online
Last seen: 4 min 1 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Opera Itself

The PortbaleApps.com Launcher (OperaPortable.exe) can handle Unicode paths, but it would appear that Opera itself may not be able to. There are several apps that have this issue. Apps usually don't test for this as C:\Program Files, the normal install location, never has Unicode characters.

It is best to install to C:\PortableApps\ or similar. That's the default. It will always work. And both the app installers and the platform installers will automatically detect it.

Sometimes, the impossible can become possible, if you're awesome!

veyselcelik
Offline
Last seen: 2 days 9 hours ago
Joined: 2009-05-26 11:18
But if I use native portable

But if I use native portable Opera (without The PortbaleApps.com Launcher, selecting usb while installation) it works in Unicode paths. So, I guessed it's our launcher's (OperaPortable.exe) issue.

John T. Haller
John T. Haller's picture
Online
Last seen: 4 min 1 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Launcher Then Native

What happens if you run the launcher and then switch and run Opera.exe natively, which will still utilize the paths laid out by the launcher. Specifically, the operaprefs_default.ini file within the App\Opera directory is updated with:

Opera Preferences version 2.1
; Do not edit this file while Opera is running
; This file is stored in UTF-8 encoding

[System]
Multi User=0

[User Prefs]
Language Files Directory={Resources}locale\en
Language File={Resources}locale\en\en.lng
Opera Directory=P:\ATH\TO\OperaPortable\Data\profile\
Cache Directory4=P:\ATH\TO\OperaPortable\Data\profile\cache\
Opera Local Directory=P:\ATH\TO\OperaPortable\Data\profile\
Operator Cache Directory4=P:\ATH\TO\OperaPortable\Data\CacheOp\
Skin Directory=P:\ATH\TO\OperaPortable\Data\profile\skin\
Temporary Download Directory=P:\ATH\TO\OperaPortable\Data\profile\temporary_downloads\

If Opera fails with the real paths listed in there, then it would appear to be an Opera bug.

Sometimes, the impossible can become possible, if you're awesome!

veyselcelik
Offline
Last seen: 2 days 9 hours ago
Joined: 2009-05-26 11:18
I just installed OperaPortable on "D:/ğşöüç" directory.

I just installed OperaPortable on "D:/ğşöüç" directory. And open OperaPortable.exe

Here is the opera:about page
http://imageshack.us/a/img688/3029/adszfls.png

And here is the operaprefs_default.ini
http://imageshack.us/a/img812/7581/aadfdsz.png

I haven't understood why it happens like that.

edit:

And it had been created folder for profile like this
http://img339.imageshack.us/img339/3060/asdfasdfasdc.png

John T. Haller
John T. Haller's picture
Online
Last seen: 4 min 1 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Ok, Here's The Deal

I figured it out. It's a combination of things.

The launcher is attempting to write INI entries to the operaprefs_default.ini so Opera can find its settings. Unfortunately, Opera's INI file is in UTF-8 format, which means it isn't a valid INI file. INI files can only be ANSI or UCS-2LE. If you try and write a valid Unicode string to the file using the proper Windows API calls, it will corrupt the string, as you see in your results. It's actually trying to write it as either UCS-2LE or ANSI with codepage.

So, what if we convert the files to UCS-2LE so it's a valid INI? Then the launcher writes to it and the string is properly written, but Opera can't read it, so it fails. Opera can't read a valid INI. So, Opera is obviously using its own custom code internally to read/write INI files and not the standard Windows APIs.

Now, we could try writing the values using ConfigWrite. But, again, ConfigWrite doesn't handle UTF-8. So, we'd be left with the same thing.

Finally, we could try a replace, but that would mean that the OperaPortableSettings.ini and operaprefs_default.ini would need to stay in sync, and would break if someone copies their own version of Opera in (say the 64-bit version) or similar.

I have another workaround I've come up with that should work. I'm testing it now and will release it as Rev 2.

Sometimes, the impossible can become possible, if you're awesome!

John T. Haller
John T. Haller's picture
Online
Last seen: 4 min 1 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Fixed in Opera Portable 12.14 Rev 2

This is fixed in Opera Portable 12.14 Rev 2.

Sometimes, the impossible can become possible, if you're awesome!

veyselcelik
Offline
Last seen: 2 days 9 hours ago
Joined: 2009-05-26 11:18
Thank you very much. It works

Thank you very much. It works perfectly.

Aluísio A. S. G.
Offline
Last seen: 8 years 4 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
How did you fix it?

WideCharToMultiByte or something like that?

Previously known as kAlug.

John T. Haller
John T. Haller's picture
Online
Last seen: 4 min 1 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Cheated

I have it copy a fresh version of the file (in custom code) with placeholders for the full path to the OperaPortable directory that I do a Replace on (in the launcher.ini in place of the 6 INI writes that were there before).

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments