Issues with Installer written in Python for Linux

D

dwelch91

c.l.p-

I am undertaking writing an installer for a software package using
Python. It is exclusively for Linux. Because this is an installer and
has to run on numerous Linux distros, it is presenting some unique
challenges.

First off, I have begun this project by writing a text mode only
interface. I would like to provide a GUI as an alternative, but I ran
into problems in my early tests. Thinking that Tkinter would be the
most universal GUI framework on Linux in Python, I wrote some test
screens. Well, after trying the code on several distros (Mandriva,
Ubuntu, Fedora, SUSE, etc), I discovered that Tkinter is not as
universal as I had thought. On about 50% of the distros, it is not
installed with the system copy of Python. So much for the "standard"
library! :) So, this leaves me with the problem that I don't know
what else might work. I am assuming that PyQt and PyGTK are both not
preinstalled on all Linux distros. I could ship and install a package
of my own if it were very small and an "easy" installation. I can't use
package managers because I need to work on systems that use apt, rpm,
portage, etc. Does anyone have any suggestions?

My next issue is a usability issue, that really isn't strictly a Python
issue, but since the members of c.l.p are some of the most intelligent
and knowledgable people around, I thought I'd give it a try. My
installer is part of a tarball that is subsequently wrapped up into a
self extracting archive (SFX) using 'makeself'. This all works great.
The user can download the SFX (which is in the form of a .run file) in
a _terminal_ and the package will self extract and then run my
installer. The problem is that I would like the user to be able to
download the file to their desktop or whereever, and then simply
doubleclick on it to make the installer execute. When I do this now,
the installer refuses to run, I guess because it has no terminal to
output to.

So, the question is, from a Python program, can I detect that I am not
running in a terminal/console and somehow get one going? (I tried
playing with things like 'xterm' to force the install into a console,
but, of course, xterm is missing on some distros too).

Thanks,

Don
 
S

Stephan Kuhagen

I am undertaking writing an installer for a software package using
Python. It is exclusively for Linux. Because this is an installer and
has to run on numerous Linux distros, it is presenting some unique
challenges.

I had the same problem to solve as you, and I hope, my answer is not too
offtopic to you, since I wrote the solution in Tcl/Tk. I needed the
installer to work in text-mode, if no X is available and with a GUI, if X
can be used. The Installer works in both modes. It is not very fancy, but
allows to run additional scripts after installation, shows some info and
License-Agreement, Logo and so on. The "trick" was to pack all in a single
script, that first runs as a shell script, checks if Tcl is available at
all (for you python), the starting up Tcl, feeding it the same file as a
Tcl-Script, then checking inside of Tcl, if Tk can be loaded (for you
TkInter, which is the same thing) and if so, run the GUI, otherwise run in
a text-mode, which I implemented using only basic shell-commands (cat,
md5sum for validity-check, bzip2, but gzip would also work, and sed, the
other commands are bash-builtins) so they should be on every distro. But
that part possibly can better also be implemented in python or Tcl. - If
you are interested, how it works and think, it would help you, tell me. You
can look at the installer at www.mevislab.de -> Downloads, take one of the
Linux-Installers. If you want, I can also give you the scripts, that create
such a installer. They are a little bit confused written, since they had to
be finished yesterday, as ever (and laying around since, annoying me, when
I look at the code). But may be they help or at least inspire you, doing
the same thing but better.

Regards
Stephan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top