firebird
firebird copied to clipboard
Support for using it as a portable application
Is it posible to Firebird look for the files (Boot1, Flash, Snapshot) in the folder where it's running or even in a subfolder inside it?
Yes, that could be implemented. What are you trying to achieve?
The idea is to me to have the emulator in a USB flash drive (to use it in multiple pcs) and run it from there without having to relocate all the required files. Would be also useful for people like math teachers p.e.
I see, so it would also need to search for a config file in that location.
So two parts are needed:
- If there's a
firebird-emu.ini
file in theQCoreApplication::applicationFilePath()
, use it for reading and writing settings - If the path to a boot1, flash or snapshot file begins with the path to the firebird executable, it's saved as relative path (my first thought was CWD, but that's unreliable)
Then all you would need to do is create an empty firebird-emu.ini
file in the same directory as firebird-emu.exe
and add all kits back manually (to convert them to the new relative paths).
Does this sound like a plan?
So i don't understand much about coding, if i understood the firebird-emu.ini
file will be used as settings file and then when adding the kits back manually one kit=one "relative folder"?
Sorry for the lack of knowledge 😅
Almost, currently if you have D:\fb\firebird-emu.exe
and D:\fb\flash.img
it would save D:\fb\flash.img
as path.
With this change it would save ./flash.img
instead.
Yeah that's what I meant. So to use it with all the files in the parent directory =one kit and to use it with all the files in a subfolder=another kit? Btw thanks for creating this emulator, it's really useful!
So to use it with all the files in the parent directory =one kit and to use it with all the files in a subfolder=another kit?
Not necessary - you can place the files wherever you want, as long as they are inside the same folder hierarchy as the firebird executable file.
Oh, that's nice! I believe that would also solve a bug that makes Firebird not getting an error when saving a snapshot in folders with º (that's the one that's in the folder that i'm the having the bug with, i could open another issue if necessary).
It might not fix that - it'll most likely use an absolute path at some point again.
I can't reproduce that issue here on wine, maybe @adriweb can on actual windows?
it'll most likely use an absolute path at some point again
So at some point will this idea not work? About the error, i'll open antoher issue so I can provide more info and screenshots on the error. Sounds good to you?
So at some point will this idea not work?
The idea should work fine, but your issue is independent.
Yup.
The issue about the bug is now open, looking foward for developments on this! Once again, ty for all the work!
Portable mode in CEmu took a while to get "right", but it seems OK now: https://github.com/CE-Programming/CEmu/blob/v1.2/gui/qt/settings.cpp#L110-L112 Could serve as inspiration.