Module org.scijava.desktop
Class WindowsSchemeInstaller
- java.lang.Object
-
- org.scijava.desktop.platform.windows.WindowsSchemeInstaller
-
- All Implemented Interfaces:
SchemeInstaller
public class WindowsSchemeInstaller extends Object implements SchemeInstaller
Windows implementation ofSchemeInstallerusing the Windows Registry.This implementation uses the
regcommand-line tool to manipulate the Windows Registry underHKEY_CURRENT_USER\Software\Classes. No administrator privileges are required.- Author:
- Curtis Rueden, Marwan Zouinkhi
-
-
Constructor Summary
Constructors Constructor Description WindowsSchemeInstaller(org.scijava.log.LogService log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetInstalledPath(String scheme)Gets the executable path registered for a given scheme.voidinstall(String scheme, String executablePath)Installs a URI scheme handler in the operating system.booleanisInstalled(String scheme)Checks if a URI scheme is already registered.booleanisSupported()Checks if this installer is supported on the current platform.voiduninstall(String scheme)Uninstalls a URI scheme handler from the operating system.
-
-
-
Method Detail
-
isSupported
public boolean isSupported()
Description copied from interface:SchemeInstallerChecks if this installer is supported on the current platform.- Specified by:
isSupportedin interfaceSchemeInstaller- Returns:
- true if the installer can run on this OS
-
install
public void install(String scheme, String executablePath) throws IOException
Description copied from interface:SchemeInstallerInstalls a URI scheme handler in the operating system.- Specified by:
installin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to register (e.g., "myapp")executablePath- The absolute path to the executable to launch- Throws:
IOException- if installation fails
-
isInstalled
public boolean isInstalled(String scheme)
Description copied from interface:SchemeInstallerChecks if a URI scheme is already registered.- Specified by:
isInstalledin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to check- Returns:
- true if the scheme is already registered
-
getInstalledPath
public String getInstalledPath(String scheme)
Description copied from interface:SchemeInstallerGets the executable path registered for a given scheme.- Specified by:
getInstalledPathin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to query- Returns:
- The registered executable path, or null if not registered
-
uninstall
public void uninstall(String scheme) throws IOException
Description copied from interface:SchemeInstallerUninstalls a URI scheme handler from the operating system.- Specified by:
uninstallin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to unregister- Throws:
IOException- if uninstallation fails
-
-