[Gambas-user] Software installation under Linux

Rob sourceforge-raindog2 at ...94...
Tue Dec 5 20:47:35 CET 2006


On Tuesday 05 December 2006 10:24, Bob Hodges wrote:
> Dang, the one true "VB for Linux" I find - that works GREAT -
> and it turns out to be an app distribution nightmare.  This is

What Rolf said about Gambas applies equally to programs developed 
in Python, Perl, Java and even C and C++.  All of them have 
libraries and/or interpreters that must be installed to use 
their programs.  

Linux application deployment is simply done differently than 
under Windows.  Under Windows, you make a package that includes 
every library your program needs, and the installer throws them 
into the Windows system directory, sometimes overwriting a 
different version of the library which breaks another program, 
causing "DLL Hell".  Under Linux, you create a package for your 
application, and that package includes a list of dependencies, 
which modern Linux distributions (Fedora, Ubuntu, Debian, 
Mandriva, et al.) automatically download and 
install.  "Dependency hell" only comes into play if you're using 
a newer version of some library than other users of your 
distribution use.

What makes distributing Gambas applications a tougher case at 
present is that Gambas doesn't have up-to-date packages in every 
Linux distribution.  Python had this problem when it was new and 
Java still does, due to its licensing issues.  

Nonetheless, most Linux distributions nowadays have some version 
of Gambas 1.x, which should be good enough to run any Gambas 1.x 
program.  Gambas2 is a different story, but it'll be a while 
before it can even be considered beta, when the language itself 
stops changing.  Under Gambas 1.x, making an RPM or Debian 
package is actually easier than firing up Installshield to 
package a VB app, and chances are your package will work under 
most Linux distributions. (The Gentoo and Slackware guys can 
take care of themselves.)

Now, if the whole Linux package management thing really offends 
you, you can make a statically linked application that includes 
the right version of Qt and all the other dependencies, which 
creates an enormous executable.  That's what Opera does, for 
example, though they still distribute packages for about 10 
different Linux distros.  

In this case, the statically linked application would be Gambas 
itself, or rather, some of the Gambas components.  I tried to do 
this once because of all the VB people coming over and 
going "Hey, how do I make a setup.exe?" but I'm not familiar 
enough with makefiles and whatnot to make it happen.  At any 
rate, it's wasteful... why have 10 copies of Qt installed for 10 
applications?

There is a single-file installation system out there called Klik, 
and someone has packaged Gambas for it so that it should be easy 
to package Gambas applications as well.  But end users have to 
have Klik installed in order for Klik files to work.  Most 
don't.... why have a second installation system installed when 
the one that came with their system works fine?  

I realize Bob may already have left the list, but it's my hope 
that other VB programmers will either come to the same 
realization I did (that Linux package management is usable) or 
contribute to one of the above two distribution mechanisms.  
They did so with Tcl, and as a result you can distribute Tcl 
programs as a single Windows or Linux executable which unpacks 
and runs itself.  Sadly, Tcl sucks, and Gambas is more complex.  
But it can certainly be done if someone cares enough.

One more minor caution.... even if you do come up with a way to 
distribute Gambas applications as a single "setup.exe" type of 
thing, your users would have a simpler time with an RPM or 
Debian package.  Consider the steps to install from an 
executable (a "setup.exe" for example) found on the web:

1. Click the link to the program.
2. Specify a filename to save to, since web browsers won't
   let you run programs straight off of the web.
3. Open a terminal window.
4. Become root (using su or sudo.)
5. Type "chmod a+x setup.exe". (Downloaded files are not
   executable by default, mitigating another trojan attack
   vector.)
6. Run "./setup.exe".
7. Follow the setup procedure.

On the other hand, with an RPM or Debian package, it goes like 
this:

1. Click the link to the program.
2. The browser prompts you to open it in the software installer.
3. The installer prompts you for your root password.
4. Click "Install" in the installer.  If the package is not
   signed, it'll give you a warning and you can decide whether
   you think it's safe before it does anything.

Far from being a problem with Linux, I think the way it handles 
software installation is one of its strengths, and possibly the 
biggest reason there have been no major malware outbreaks so 
far.  It's also the reason no one has ever had to write 
a "system cleaner" program for Linux... every package includes a 
list of files it creates, and that same list can be used to 
uninstall cleanly, every time.

Rob




More information about the User mailing list