The forum


root password

Author Replies
fekir Sunday 18 July 2010 at 15:29

Hello to everyone,

I was just creating a script for some programs and thought:
it would be nice if (for example by microsoft word) you can print you document to a pdf-file, and I found out that you can do it easily with cups-pdf. (even through wine)
The problem is, that I do not know how I could "implement" something like that in a script.

I thought I could do it so:
Firtsly in the script I should ask if the user would like to install cups-pdf through the script or manually, if he choose through the script I should ask him if he use a debian based system, fedora or suse, so that I can install cups-pdf through apt-get or whatsoever.

The "real" problem is asking the root password I think.
Because I do not know what type of terminal he has installed (for example konsole or gnome-terminal) or if he has gnome, kde, lxde or something else.

Of course I could ask if he uses gnome or kde and then use something like gksudo, but what if he uses another system environment or doesn't have gksudo installed?

Or maybe it's possible installing thourgh wine something similar to cups-pdf without asking for a root password, this would be better, but I do not know if something like that exists...
Do you have any idea of how I could install a virtual printer for wine?

Than you very much
NSLW Wednesday 21 July 2010 at 6:37

You can only check if user has got cups-pdf package in his operating system. Script cannot install any system's package.
fekir Wednesday 21 July 2010 at 15:10

thank you for the advice
You are here: Index > PlayOnLinux > Cups-pdf