Closed mfrasca closed 6 years ago
can we use the __file__
automatic variable, to distinguish whether running in a virtual environment, in an installed package, or from a stick?
C:\Users\TEMP.Gebruiker-TOSH.042\AppData\Local\ghini.desktop\library.zip\bauble\__init__.pyo
C:\Program Files\ghini.desktop\library.zip\bauble\__init__.pyo
<git_clone_root>\ghini.desktop\ghini-runtime\library.zip\bauble\__init__.pyo
F:\ghini-runtime\library.zip\bauble\__init__.pyo
there doesn't seem to be much difference, and the differences are mostly a matter of choice at the moment of installing or copying.
I think all we can do is to check if the drive is removable media. I would not want to add dependencies though, and all hints go through win32
, which we don't use yet.
after letting NSIS pack the compiled software for the installer, we create an Appdata
directory. if the running ghini finds it in the main_dir
, it concludes it's running on a USB stick.
had to alter the configuration logic, replacing any leading appdata
string with a .
Expected behaviour
when running ghini-on-a-stick, all configurations should consider the stick as the home, the attachment point for all relative paths.
Actual behaviour
as it is now, run your trusted ghini-on-a-stick on a new computer computer, and it will tell you that this is the first time you're using it.
Opinions and suggestions
ghini-on-a-stick is just the pre-packaged ghini, before NSIS compresses it for distribution. We do not prepare it separately, and I don't think I would like to do that. There is one step that is performed after NSIS compression, namely copying
win_gtk.bat
to the same directory as the ghini executable. the initializing ghini could test for presence of that file next to itself, and if found, compute the paths correspondingly.