/// <summary> /// Removes a package from an image. /// </summary> /// <param name="session">A valid DISM Session. The DISM Session must be associated with an image. You can associate a session with an image by using the DismOpenSession Function.</param> /// <param name="packagePath">The package path.</param> /// <param name="progressCallback">A progress callback method to invoke when progress is made.</param> /// <param name="userData">Optional user data to pass to the DismProgressCallback method.</param> /// <exception cref="DismException">When a failure occurs.</exception> /// <exception cref="OperationCanceledException">When the user requested the operation be canceled.</exception> /// <exception cref="DismRebootRequiredException">When the operation requires a reboot to complete.</exception> public static void RemovePackageByPath(DismSession session, string packagePath, Dism.DismProgressCallback progressCallback, object userData) { DismApi.RemovePackage(session, packagePath, DismPackageIdentifier.Path, progressCallback, userData); }