I know it is possible to start geany in "portable settings mode" via the `-config` param.
However, on Windows it would be better if the main exe is able to autostart in portable mode without passing any args, by simply checking the existence of a `portable` subfolder or file.
If by "portable mode" you mean like [Vscode](https://code.visualstudio.com/docs/editor/portable) then no, Geany does not have a portable mode.
The `--config=` option sets where the user config data goes, its not related to a "portable mode".
I note that the link above says VS portable is not supported on installed versions of the the app, and Geany is only available as installed so it is the same. The default startup reads the users configuration, that is the condition that needs to work without options.
Of course nothing stops you "porting" the config directory between machines, but it has to be used with locally installed versions of Geany started with `--config=`, and be aware it is only forward compatible, ie we always try to make newer Geany versions read what older versions wrote, but can't guarantee older Geany versions will read what newer ones write.
The default startup reads the users configuration, that is the condition that needs to work without options.
The idea is to check whenever a "portable" file exists within the main exe install path before reading the actual `geany.conf` file. If it exists, it should overwrite `app->configdir` and **then** read `geany.conf`.
As alternative, [avidemux and other programs simply check if the main exe was renamed as "avidemux_portable.exe"](https://github.com/mean00/avidemux2/blob/291b7d7aab70b7457a743e96e803f9fa071...).
be aware it is only forward compatible, ie we always try to make newer Geany versions read what older versions wrote, but can't guarantee older Geany versions will read what newer ones write.
no problem with that limitation.
I think you have the wrong idea what the config directory is. It is the user configuration, not the Geany configuration. Files like `geany.conf` and `session.conf` are the settings the user changes during editing, nothing to do with the installation of Geany. It has to be a writable directory, which it is unlikely to be if it is within a system install directory.
First let me repeat, Geany is not designed as a portable app, it uses absolute paths in many places and is just as likely to not work if it or its data is moved. That is pretty unlikely to change.
As I said you can move the config directory about, between machines with Geany installed, but it will need the files the user was editing to be in the same absolute path on the new machine for it to be very useful. Things like which drive letter a plugin device is assigned will break it.
Actually on Windows, Geany is binary relocatable. So what the OP requests should be possible in theory.
But I don't think it's necessary to add anything to Geany itself. @eadmaster I suggest to test just putting the Geany installation directory to an USB drive or whatever medium you prefer and add a little batch file in the directory to execute "bin/geany.exe --config=portable_config" or something like this. Would this be suffice?
a little batch file in the directory to execute "bin/geany.exe --config=portable_config" or something like this.
the idea was to avoid using a launcher to have the editor in portable mode, i know currently this is the only option.
Actually on Windows, Geany is binary relocatable.
For linux it may be worth adding another switch to override the `/usr/share/geany` hardcoded paths. This could make easier to run different versions of Geany witohut resorting to chrooted environments or similar tricks.
Actually on Windows, Geany is binary relocatable.
@eht16 Is windows build with a relative PREFIX?
a little batch file in the directory to execute "bin/geany.exe --config=portable_config" or something like this.
the idea was to avoid using a launcher to have the editor in portable mode, i know currently this is the only option.
Why? Using a little batch script is easy and can be implemented by you immediately. Hacking some magic logic into Geany requires coding, testing, a new release and so in summary lots of times.
Actually on Windows, Geany is binary relocatable.
For linux it may be worth adding another switch to override the `/usr/share/geany` hardcoded paths. This could make easier to run different versions of Geany witohut resorting to chrooted environments or similar tricks.
This is already possible at compile time using `./configure --enable-binreloc`. Please be careful with running different Geany versions with the same configuration directory, especially between 1.38 and 2.0 the handling and storage of session files and loaded plugins has changed and is only forwards compatible.
Actually on Windows, Geany is binary relocatable.
@eht16 Is windows build with a relative PREFIX?
No, it's even dirtier like in https://github.com/geany/geany/blob/88a0bfcb3618b2533a5e7e253c7ef7af3c0b0590.... I'm not proud of this, on Windows we use a different file directory layout (e.g. `data` instead of `usr/share/geany`). Either this was necessary in the past or I was just unable to find the right solution to not invent a new layout. This could be changed theorethically but probably isn't worth now.
No, it's even dirtier like in https://github.com/geany/geany/blob/88a0bfcb3618b2533a5e7e253c7ef7af3c0b0590....
Ok, so its effectively relative to the installation dir, which means its ok if the OPs USB drive shows up as F: instead of G: when moved from machine to machine. Geany will still find its system files.
And I see below Macos emulates that :-)
github-comments@lists.geany.org