Skip to content
Snippets Groups Projects
Verified Commit ee0cf350 authored by André's avatar André
Browse files

Portable: Move config path parameter to application

If a user called bin/Gajim.exe directly config_path parameter was ignored,
which could lead to problems with non-portable user settings.
parent d5d99c66
No related branches found
No related tags found
No related merge requests found
......@@ -105,13 +105,14 @@ def __init__(self) -> None:
self.custom_config_root = None # type: Optional[Path]
if os.name == 'nt':
try:
if gajim.IS_PORTABLE:
application_path = Path(sys.executable).parent
self.config_root = self.cache_root = self.data_root = \
application_path.parent / 'UserData'
else:
# Documents and Settings\[User Name]\Application Data\Gajim
self.config_root = self.cache_root = self.data_root = \
Path(os.environ['appdata']) / 'Gajim'
except KeyError:
# win9x, in cwd
self.config_root = self.cache_root = self.data_root = Path('.')
else:
self.config_root = Path(GLib.get_user_config_dir()) / 'gajim'
self.cache_root = Path(GLib.get_user_cache_dir()) / 'gajim'
......
......@@ -105,9 +105,9 @@ Section "Gajim" SecGajim
SetOutPath "$INSTDIR\bin"
CreateShortCut "$INSTDIR\Gajim-Portable.lnk" "$INSTDIR\bin\Gajim.exe" \
"-c ..\UserData" "" "" SW_SHOWNORMAL "" "Gajim Portable"
"" "" "" SW_SHOWNORMAL "" "Gajim Portable"
CreateShortCut "$INSTDIR\Gajim-Portable-Debug.lnk" "$INSTDIR\bin\Gajim-Debug.exe" \
"-c ..\UserData" "" "" SW_SHOWNORMAL "" "Gajim Portable Debug"
"" "" "" SW_SHOWNORMAL "" "Gajim Portable Debug"
FileOpen $0 "is_portable" w
FileClose $0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment