firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Support for using it as a portable application

Open vb-03 opened this issue 5 years ago • 13 comments

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?

vb-03 avatar Feb 11 '19 18:02 vb-03

Yes, that could be implemented. What are you trying to achieve?

Vogtinator avatar Feb 11 '19 18:02 Vogtinator

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.

vb-03 avatar Feb 11 '19 18:02 vb-03

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 the QCoreApplication::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?

Vogtinator avatar Feb 11 '19 19:02 Vogtinator

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 😅

vb-03 avatar Feb 11 '19 19:02 vb-03

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.

Vogtinator avatar Feb 11 '19 19:02 Vogtinator

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!

vb-03 avatar Feb 11 '19 19:02 vb-03

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.

Vogtinator avatar Feb 11 '19 19:02 Vogtinator

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).

vb-03 avatar Feb 11 '19 19:02 vb-03

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?

Vogtinator avatar Feb 11 '19 20:02 Vogtinator

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?

vb-03 avatar Feb 11 '19 21:02 vb-03

So at some point will this idea not work?

The idea should work fine, but your issue is independent.

Yup.

Vogtinator avatar Feb 11 '19 21:02 Vogtinator

The issue about the bug is now open, looking foward for developments on this! Once again, ty for all the work!

vb-03 avatar Feb 11 '19 22:02 vb-03

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.

adriweb avatar Feb 12 '19 08:02 adriweb