@@ -0,0 +1,2300 @@
+/*******************************************************************************%0A *  Copyright (c) 2014 Mentor Graphics and others.%0A *  All rights reserved. This program and the accompanying materials%0A *  are made available under the terms of the Eclipse Public License v1.0%0A *  which accompanies this distribution, and is available at%0A *  http://www.eclipse.org/legal/epl-v10.html%0A * %0A *  Contributors:%0A *     Mentor Graphics - initial API and implementation%0A *******************************************************************************/%0Apackage com.codesourcery.installer.actions;%0A%0Aimport org.eclipse.core.runtime.CoreException;%0Aimport org.eclipse.core.runtime.IPath;%0A%0Aimport org.eclipse.core.runtime.IProgressMonitor;%0Aimport org.eclipse.equinox.p2.core.IProvisioningAgent;%0A%0Aimport com.codesourcery.installer.IInstallMode;%0Aimport com.codesourcery.installer.IInstallPlatform;%0Aimport com.codesourcery.installer.IInstallProduct;%0Aimport com.codesourcery.installer.Installer;%0A%09%0A/**%0A * This action will install digitally signed Windows drivers using the%0A * Microsoft Driver Package Installer (DPInst).%0A * This action will require administrative privileges to run on Windows.%0A */%0Apublic class DriverAction extends AbstractInstallAction %7B%0A%09/** Action identifier */%0A%09public static final String ID = %22com.codesourcery.installer.DriverAction%22;%0A%09/** Directory containing drivers files */%0A%09private IPath driverPath;%0A%09%0A%09/**%0A%09 * Constructor%0A%09 */%0A%09protected DriverAction() %7B%0A%09%09super(ID);%0A%09%7D%0A%09%0A%09@Override%0A%09public boolean isSupported(String platform, String arch) %7B%0A%09%09// Only supported on Windows platforms%0A%09%09return isWindows(platform);%0A%09%7D%0A%09%0A%09/**%0A%09 * Constructor%0A%09 * %0A%09 * @param driverPath Path to driver directory%0A%09 */%0A%09protected DriverAction(IPath driverPath) %7B%0A%09%09super(ID);%0A%09%7D%0A%09%0A%09/**%0A%09 * Returns the path to the driver directory.%0A%09 * %0A%09 * @return Driver path%0A%09 */%0A%09public IPath getDriverPath() %7B%0A%09%09return driverPath;%0A%09%7D%0A%0A%09@Override%0A%09public void run(IProvisioningAgent agent, IInstallProduct product,%0A%09%09%09IInstallMode mode, IProgressMonitor monitor) throws CoreException %7B%0A%09%09if (mode.isInstall()) %7B%0A%09%09%09IInstallPlatform installPlatform = Installer.getDefault().getInstallPlatform();%0A%09%09%09// If Vista or greater, install signed drivers%0A%09%09%09installPlatform.installWindowsDriver(getDriverPath().toOSString());%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add general action to install Windows digitaly signed drivers.