Bootstrap then launch with administrative rights

View: New views
9 Messages — Rating Filter:   Alert me  

Bootstrap then launch with administrative rights

by Julien Ponge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I have been thinking lately about a new feature that would be terrific ;-)

Some installers would need privileged rights to run properly. It turns
out that the means to do that vary a lot depending on the operating
systems.

* Windows: there is apparently a way to ask the UAC on Vista to pop-up
a message to elevate the rights. It more or less boils down to writing
a JScript somewhere that would re-launch the installer, see
http://blogs.msdn.com/aaron_margosis/archive/2007/07/01/scripting-elevation-on-vista.aspx.

* Linux / Unix: sudo is not scriptable, but there exists kdesu on KDE
and gksu on Ubuntu that provide graphical means to do that. Again, the
installer would need to relaunch itself.

* Mac OS X: I could not find the documentation for this, but some
applications ask for elevation on some occasions.

What do you guys think? In particular, I am very interested on
experiences / documentation on scripting those systems for asking the
user to elevate rights.

Cheers

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Bootstrap then launch with administrative rights

by ODB MIRA :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Julien,

This sounds like a good idea.
I remember  a while back Hal Vaughan wrote something like this (SuperUser),
at that time i was working with him on a bunch of new features which i never
posted... i shall do it asap as i mentioned in an earlier post.
I will look into my archives and found that information.

The SuperUser feature worked on Unix, Mac and Windows basically checking for
root on Unix and Mac and for Administrator for Windows.

I will also check with Hal if it is cool to post it here for review. Or Hal,
if you are still looking at this list from time to time let us know what are
your thoughts about this.
We would probably have to modify it a bit to fit with Vista.

Cheers,
Fabrice

----- Original Message -----
From: "Julien Ponge" <julien.ponge@...>
To: <dev@...>
Sent: Thursday, October 23, 2008 5:53 PM
Subject: [izpack-dev] Bootstrap then launch with administrative rights


> Hi everyone,
>
> I have been thinking lately about a new feature that would be terrific ;-)
>
> Some installers would need privileged rights to run properly. It turns
> out that the means to do that vary a lot depending on the operating
> systems.
>
> * Windows: there is apparently a way to ask the UAC on Vista to pop-up
> a message to elevate the rights. It more or less boils down to writing
> a JScript somewhere that would re-launch the installer, see
> http://blogs.msdn.com/aaron_margosis/archive/2007/07/01/scripting-elevation-on-vista.aspx.
>
> * Linux / Unix: sudo is not scriptable, but there exists kdesu on KDE
> and gksu on Ubuntu that provide graphical means to do that. Again, the
> installer would need to relaunch itself.
>
> * Mac OS X: I could not find the documentation for this, but some
> applications ask for elevation on some occasions.
>
> What do you guys think? In particular, I am very interested on
> experiences / documentation on scripting those systems for asking the
> user to elevate rights.
>
> Cheers
>
> --
> http://izpack.org/
> http://jpz-log.info/
> http://julien.ponge.info/
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Bootstrap then launch with administrative rights

by Julien Ponge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I have made significant progress on this topic :-)

On Windows Vista, the installer extracts a WSH JScript that relaunches
a JVM with elevated privileges. I suspect that it works on XP too but
I couldn't test it.

On *nix (Linux, etc), it uses a "least-common denominator" approach by
relying on xterm + sudo.

On Mac OS X, the installer extracts a very small universal binary that
uses the Security framework, again to ask for elevation.

In my limited experimentations this worked well.

It can be enabled through a <run-privileged/> tag in the
<info>(...)</info> section.

The code is currently available from
http://github.com/jponge/izpack/tree/exec-admin through Git. I would
appreciate to get some feedback on it. I can upload a testing
installer if some of you need. Otherwise you can easily get the code
from Git. (Windows users, http://code.google.com/p/msysgit/ provides a
very good Git build that works out of the box).

I'd love to merge that for IzPack 4.2.

Cheers

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Bootstrap then launch with administrative rights

by Julien Ponge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have uploaded an installer at
http://snapshots.dist.codehaus.org/izpack/test-exec-admin.jar for
testing.

I would appreciate if you could test it. I expect it to work on OSX,
Linux and other Unix variants and Windows Vista. I have absolutely no
idea if it works on Windows XP though ;-)

Cheers

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Bootstrap then launch with administrative rights

by Julien Ponge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For those who might test it, there is a failure when doing a chmod on
OS X and Linux.

This is normal, the file being chmod'ed is at the wrong place :-)
(this is packaging error, not an error by the proposed elevation
system).

On Tue, Oct 28, 2008 at 10:44 PM, Julien Ponge <julien.ponge@...> wrote:

> I have uploaded an installer at
> http://snapshots.dist.codehaus.org/izpack/test-exec-admin.jar for
> testing.
>
> I would appreciate if you could test it. I expect it to work on OSX,
> Linux and other Unix variants and Windows Vista. I have absolutely no
> idea if it works on Windows XP though ;-)
>
> Cheers
>
> --
> http://izpack.org/
> http://jpz-log.info/
> http://julien.ponge.info/
>



--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Bootstrap then launch with administrative rights

by Julien Ponge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Latest news: a friend tested on Windows XP.

A dialog pops-up asking you wether you want to run the application as
yourself or as an administrator, and then it just works fine.

Sounds good...

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



RE: Bootstrap then launch with administrative rights

by BB Warm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Julien,

I like what I am seeing.  This is a must-have for installers nowadays.  One issue though, at least on the Mac, we have lost the ability to debug with -DTRACE=true since (I am guessing) the privilege elevation mechanism restarts the installer without the system properties.

Tao


-----Original Message-----
From: Julien Ponge [mailto:julien.ponge@...]
Sent: Tuesday, October 28, 2008 7:44 AM
To: dev@...
Subject: Re: [izpack-dev] Bootstrap then launch with administrative rights

Hi everyone,

I have made significant progress on this topic :-)

On Windows Vista, the installer extracts a WSH JScript that relaunches
a JVM with elevated privileges. I suspect that it works on XP too but
I couldn't test it.

On *nix (Linux, etc), it uses a "least-common denominator" approach by
relying on xterm + sudo.

On Mac OS X, the installer extracts a very small universal binary that
uses the Security framework, again to ask for elevation.

In my limited experimentations this worked well.

It can be enabled through a <run-privileged/> tag in the
<info>(...)</info> section.

The code is currently available from
http://github.com/jponge/izpack/tree/exec-admin through Git. I would
appreciate to get some feedback on it. I can upload a testing
installer if some of you need. Otherwise you can easily get the code
from Git. (Windows users, http://code.google.com/p/msysgit/ provides a
very good Git build that works out of the box).

I'd love to merge that for IzPack 4.2.

Cheers

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Bootstrap then launch with administrative rights

by Julien Ponge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

>  I like what I am seeing.  This is a must-have for installers nowadays.  One issue though, at least on the Mac, we have lost the ability to debug with -DTRACE=true since (I am guessing) the privilege elevation mechanism restarts the installer without the system properties.

Cool!

I'll make some further changes to clone the environment variables
(useful for the -D flags). I'm not sure that console output will apear
from the launched process though...

Cheers

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Bootstrap then launch with administrative rights

by Julien Ponge-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I have just merged the feature back into SVN trunk.

Cheers

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email