File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to launch a command that requires elevated privileges Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to launch a command that requires elevated privileges" Watch "how to launch a command that requires elevated privileges" New topic
Author

how to launch a command that requires elevated privileges

Joe Areeda
Ranch Hand

Joined: Apr 15, 2011
Posts: 318
    
    2

I'm just starting a cross-platform installer project. I suppose a bigger question is why do it as a Java app rather than a native installer. I'll discuss that after my question.

The concept is a javaws app that scans the system for the needed apps, libraries and directories needed, and then creates, installs or downloads what is needed.

My problem is that if a prerequisite is missing that has an installer, I'd like to launch a program that asks for the required password and runs the installer. I've seen it done but don't know how to do it.

Why my own installer?

  • I'm not sure that it's the only way to get this done but I can't figure out how to do what I need with macports, msi, deb and rpm installers
  • My app is written in Matlab, and installing it is just a tar or unzip
  • There may be multiple versions of Matlab and the user has to choose which one to use. Matlab is not installed by a package manager and so require a package is not an option
  • There are environment variables that may need to be set, and a good GUI is easier than package options as far as I can tell
  • It needs to run on Mac, a few flavors of Linux, and Windows and while I know how to almost everything I need in Java, I know almost nothing about the native package managers


  • I'm not against doing this with native package managers. I've been reading up on them but keep running into the need for non-standard kludges (I think) to do this kind of stuff.

    Any discussion of the problems would be greatly appreciated.

    Thanks,
    Joe


    It's not what your program can do, it's what your users do with the program.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: how to launch a command that requires elevated privileges