本文整理汇总了Java中com.izforge.izpack.util.OsVersion.IS_UNIX属性的典型用法代码示例。如果您正苦于以下问题:Java OsVersion.IS_UNIX属性的具体用法?Java OsVersion.IS_UNIX怎么用?Java OsVersion.IS_UNIX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.izforge.izpack.util.OsVersion
的用法示例。
在下文中一共展示了OsVersion.IS_UNIX属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultPath
String getDefaultPath(AutomatedInstallData idata) {
String chosenPath = "";
if (idata.getVariable(getVariableName()) != null) {
chosenPath = idata.getVariable(getVariableName());
} else {
if (OsVersion.IS_WINDOWS) {
chosenPath = idata.getVariable(getVariableName()+".windows");
}
if (OsVersion.IS_OSX) {
chosenPath = idata.getVariable(getVariableName()+".mac");
} else {
if (OsVersion.IS_UNIX) {
chosenPath = idata.getVariable(getVariableName()+".unix");
}
}
}
VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables());
chosenPath = vs.substitute(chosenPath, null);
return chosenPath;
}
示例2: itemRequiredForOs
/**
* Verifies if an item is required for the operating system the installer executed. The
* configuration for this feature is: <br/>
* <os family="unix"/> <br>
* <br>
* <b>Note:</b><br>
* If the list of the os is empty then <code>true</code> is always returnd.
*
* @param os The <code>Vector</code> of <code>String</code>s. containing the os names
* @return <code>true</code> if the item is required for the os, otherwise returns
* <code>false</code>.
*/
public boolean itemRequiredForOs(Vector<IXMLElement> os)
{
if (os.size() == 0) { return true; }
for (int i = 0; i < os.size(); i++)
{
String family = (os.elementAt(i)).getAttribute(FAMILY);
boolean match = false;
if ("windows".equals(family))
{
match = OsVersion.IS_WINDOWS;
}
else if ("mac".equals(family))
{
match = OsVersion.IS_OSX;
}
else if ("unix".equals(family))
{
match = OsVersion.IS_UNIX;
}
if (match) { return true; }
}
return false;
}
示例3: getElevator
private List<String> getElevator(String javaCommand, String installer) throws IOException, InterruptedException
{
List<String> elevator = new ArrayList<String>();
if (OsVersion.IS_OSX)
{
elevator.add(extractMacElevator().getCanonicalPath());
elevator.add(javaCommand);
elevator.add("-jar");
elevator.add(installer);
}
else if (OsVersion.IS_UNIX)
{
elevator.add("xterm");
elevator.add("-title");
elevator.add("Installer");
elevator.add("-e");
elevator.add("sudo");
elevator.add(javaCommand);
elevator.add("-jar");
elevator.add(installer);
}
else if (OsVersion.IS_WINDOWS)
{
elevator.add("wscript");
elevator.add(extractVistaElevator().getCanonicalPath());
elevator.add(javaCommand);
elevator.add("-Dizpack.mode=privileged");
elevator.add("-jar");
elevator.add(installer);
}
return elevator;
}
示例4: run
/**
* The run method.
*/
public void run()
{
try
{
// We get the list of uninstaller listeners
List[] listeners = getListenerLists();
// We get the list of the files to delete
ArrayList<ExecutableFile> executables = getExecutablesList();
FileExecutor executor = new FileExecutor(executables);
executor.executeFiles(ExecutableFile.UNINSTALL, this.handler);
ArrayList<File> files = getFilesList();
int size = files.size();
// Custem action listener stuff --- beforeDeletion ----
informListeners(listeners[0], UninstallerListener.BEFORE_DELETION, files, handler);
handler.startAction("destroy", size);
// We destroy the files
for (int i = 0; i < size; i++)
{
File file = files.get(i);
// Custem action listener stuff --- beforeDelete ----
informListeners(listeners[1], UninstallerListener.BEFORE_DELETE, file, handler);
file.delete();
// Custem action listener stuff --- afterDelete ----
informListeners(listeners[1], UninstallerListener.AFTER_DELETE, file, handler);
handler.progress(i, file.getAbsolutePath());
}
// Custem action listener stuff --- afterDeletion ----
informListeners(listeners[0], UninstallerListener.AFTER_DELETION, files, handler);
if (OsVersion.IS_UNIX)
{
ArrayList<String> rootScripts = getRootScripts();
Iterator<String> rsi = rootScripts.iterator();
while (rsi.hasNext())
{
execRootScript((String) rsi.next() );
}
}
// We make a complementary cleanup
handler.progress(size, "[ cleanups ]");
cleanup(new File(installPath));
handler.stopAction();
}
catch (Throwable err)
{
handler.stopAction();
err.printStackTrace();
StringWriter trace = new StringWriter();
err.printStackTrace(new PrintWriter(trace));
handler.emitError("exception caught", trace.toString());
}
}
示例5: isPlatformSupported
/**
* Checks if the current platform is supported.
*
* @return <code>true</code> if the platform is supported, <code>false</code> otherwise.
*/
public boolean isPlatformSupported()
{
return OsVersion.IS_MAC || OsVersion.IS_UNIX || OsVersion.IS_WINDOWS;
}