Portable mode is not implemented correctly #379
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue
if bitmessage runs in portable mode, relative paths are used to store the files, however, these paths are relative to the Currently selected directory and not the application
Example for Windows
Working example
Invalid example
Solution
Two possible approaches:
Here's how you get the right path in a way that works with the source distribution or the executable: http://www.pyinstaller.org/export/develop/project/doc/Manual.html#adapting-to-being-frozen It's easy enough to fix, but since I don't have access to a windows machine, I wouldn't be able to test a potential pull request.
This issue also affects the option "Start BitMessage on user login" because then it saves keys.dat and messages.dat in System32 or SysWOW64 on Windows systems.
The path now works when running it on the checked out directory in terminal, and in bundled Windows and OSX. I haven't tried the portable mode yet or the start on login though.
@AyrA I fixed it the proper way (B), it detects the directory of the executable, or if running from python manually, the directory with the source code (doesn't make much sense but I think it's the correct approach).
@VADemon It works on Windows startup as well.
@grant-olson The same problem probably affected OSX and this probably fixes it too (I'm too lazy to check).
Update re: OSX: if you run it from the DMG archive, portable mode doesn't work, and it's not handled very cleanly. If you run it from the unpacked Bitmessage.app, it will put it into Bitmessage.app/Contents/MacOS. I don't know if that's the correct location but I suppose that's acceptable.
9a789c4e24
disables the "Portable mode" checkbox if the app directory is not writable. This fixes the freezes on OSX, and probably some other cases where it wouldn't work.