Search in sources :

Example 16 with ProcessWrapperImpl

use of net.pms.io.ProcessWrapperImpl in project UniversalMediaServer by UniversalMediaServer.

the class WindowsUtil method installWin32Service.

/**
 * Executes the needed commands in order to install the Windows service
 * that starts whenever the machine is started.
 * This function is called from the General tab.
 *
 * @return true if UMS could be installed as a Windows service.
 * @see net.pms.newgui.GeneralTab#build()
 */
public static boolean installWin32Service() {
    String[] cmdArray = new String[] { "win32/service/wrapper.exe", "-i", "wrapper.conf" };
    ProcessWrapperImpl pwinstall = new ProcessWrapperImpl(cmdArray, true, new OutputParams(PMS.getConfiguration()));
    pwinstall.runInSameThread();
    return pwinstall.isSuccess();
}
Also used : OutputParams(net.pms.io.OutputParams) ProcessWrapperImpl(net.pms.io.ProcessWrapperImpl)

Example 17 with ProcessWrapperImpl

use of net.pms.io.ProcessWrapperImpl in project UniversalMediaServer by UniversalMediaServer.

the class WindowsUtil method uninstallWin32Service.

/**
 * Executes the needed commands in order to remove the Windows service.
 * This function is called from the General tab.
 *
 * TODO: Make it detect if the uninstallation was successful
 *
 * @return true
 * @see net.pms.newgui.GeneralTab#build()
 */
public static boolean uninstallWin32Service() {
    String[] cmdArray = new String[] { "win32/service/wrapper.exe", "-r", "wrapper.conf" };
    OutputParams output = new OutputParams(PMS.getConfiguration());
    output.noexitcheck = true;
    ProcessWrapperImpl pwuninstall = new ProcessWrapperImpl(cmdArray, true, output);
    pwuninstall.runInSameThread();
    return true;
}
Also used : OutputParams(net.pms.io.OutputParams) ProcessWrapperImpl(net.pms.io.ProcessWrapperImpl)

Aggregations

ProcessWrapperImpl (net.pms.io.ProcessWrapperImpl)17 OutputParams (net.pms.io.OutputParams)10 PmsConfiguration (net.pms.configuration.PmsConfiguration)7 ArrayList (java.util.ArrayList)6 PipeProcess (net.pms.io.PipeProcess)3 ProcessWrapper (net.pms.io.ProcessWrapper)3 AudioFile (org.jaudiotagger.audio.AudioFile)3 IOException (java.io.IOException)2 ExifInfo (net.pms.image.ExifInfo)2 ByteArrayReader (com.drew.lang.ByteArrayReader)1 Dimension (java.awt.Dimension)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 RendererConfiguration (net.pms.configuration.RendererConfiguration)1 URLResult (net.pms.external.URLResolver.URLResult)1