Page 1 of 1

Portable Gambas Application (on USB)

Posted: Wednesday 16th May 2018 12:25pm
by alexchernoff
Hello!

I am trying to make an application that runs off a USB stick. Is it possible to inslude all Gambas components and runtimes in one place so it can run an application without installing?

Anyone done that before?

cheers!

Re: Portable Gambas Application (on USB)

Posted: Wednesday 16th May 2018 3:37pm
by cogier
Welcome to the forum

This was fun! ;)

I booted a live DVD of Lubuntu 17.10 from a Linux magazine DVD.

I took a 16GB USB3 pen drive and following the instructions from here https://askubuntu.com/questions/450354/ ... -usb-drive installed Lubuntu on to the USB. Don't rush this bit or it won't work. Make sure you include a swap file, I allowed about 2 GB for this, and that you make the installer install Grub on your USB, not on the default hard drive.

Once I had a working USB I installed Gambas 3.11.2 with

Code: Select all

sudo add-apt-repository -y ppa:gambas-team/gambas3 && sudo apt-get update && sudo apt-get -y install gambas3
Using USB3 ports the install was fast and only used 3.2GB, including Gambas, so I thought I would try the whole process with Mint 18.3 complete with the Cinnamon desktop. This used 6GB but the install felt faster that using a standard hard drive. As I am more familiar with Mint I downloaded a program from the Gambas Farm, set it up to start on booting and it worked just fine.

I hope that helps, let us know how you get on.

Re: Portable Gambas Application (on USB)

Posted: Wednesday 16th May 2018 6:11pm
by alexchernoff
Running an entire OS from USB is fun... But I wanted even leaner than that, so i have only the gambas bytecode application, gbr3 interpreter and the component files, nothing else. Target systems are all Linux Mint or Debian and can run a full Gambas (if installed), but I need to run the application without installing anything on the host OS.

Is that possible?

Re: Portable Gambas Application (on USB)

Posted: Friday 18th May 2018 12:11pm
by cogier
I have had a think about this and whatever you do you will need to install the Gambas runtime code on the target computer and depending on what version of Gambas you are using will depend on which version you will need to install on the target machine.

It seems to me that the best way would be to install Gambas on the target machines using the ppa so that any updated versions of Gambas will update automatically with the normal software updates.

You can then just have the MyProg.gambas file on your USB drive and away you go.

Unless someone else has a better way of doing this...

Re: Portable Gambas Application (on USB)

Posted: Friday 18th May 2018 4:56pm
by alexchernoff
What if all the libs of /usr/lib/gambas3 and the gbr3 interpreter were in same directory on USB as the executable? (and suppose host OS libs are all compliant with the Gambas version)

Or... alternatively... Does one have to install the entire Gambas3 package just to run an application? Maybe thgutere's a smoother, leaner way to do that. Like a "runtime" in the old days.

Cheers and good/bon/gut weekend!

Re: Portable Gambas Application (on USB)

Posted: Saturday 19th May 2018 7:19am
by stevedee
Don't give up hope!

It should be possible to build most programs to run from a memory stick on Linux, just as its possible on Windows with the excellent "PortableApps.com"

In fact I think that some of the apps I'm using on Lubuntu are running OK but not integrated into the system (e.g. Shotcut, WikidPad...).

So I think the program 'just' needs to be built with all dependancies included or references to the right locations. When I say 'just' I'm not implying that this is a trivial task.

I'm a bit pushed for time at the moment, but my starting point would be to download Shotcut to a memory stick and see if it runs. Then take a close look at how its packaged.

Alternatively you could ask Benoit (http://gambas.8142.n7.nabble.com/templa ... des&user=3)

Re: Portable Gambas Application (on USB)

Posted: Saturday 19th May 2018 8:35am
by didier18
Hello

alexchernoff@ if i understand what you want to do, it's create a runtime application, so that it can be executed without gambas3?

To make it simple, you need to put all the gambas3 packages that match the components you used in your application + the runtime package + all dependencies and make one of them the package.

For example if in your application you use the gb.gui.trayicon component, you will need to get the gambas3-gb-dbus-trayicon_3.11.2 package (i386 or armf or amd64).deb + the gambas3-runtime_3.11.2 package (i386 or armf or amd64).deb...
- Uncompress all".deb" packages.
- Satisfy all dependencies...
- then finally create your archive.

I don't hide from you that the search for and satisfaction of addictions is a real nightmare...
I have developed a help for this task (click on me)

Besides this help is a runtime for puppy distributions and does not need gambas3 to work ;-)

Edit
A short video example (click on me)

Have a nice day.

Re: Portable Gambas Application (on USB)

Posted: Monday 21st May 2018 3:07pm
by jornmo
I think that will be a bit like bingo. Gambas depends on a great many libraries, which again depend on even more libraries. So putting Gambas on the stick along with your program will not suffice. But, you could perhaps use some containers or VMs for this purpose.

Re: Portable Gambas Application (on USB)

Posted: Tuesday 22nd May 2018 7:55pm
by jornmo