ManagedDism
ManagedDism copied to clipboard
error message with AddPackage
Immediately I apologize for my English. He's not as good as I would like :) Actually the question itself. From the command line, DISM can add multiple packages to a mounted image. For example: DISM.exe / IMAGE: D: \ Mount / Add-Package / PackagePath: D: \ Packages In dismAPI, it is not possible to specify the folder with packages, it gives an error: "The parameter is specified incorrectly." For example: using (DismSession session = DismApi.OpenOfflineSession ("D: \ Mount")) { DismApi.AddPackage ( session, "D: \ Packages", ignoreCheck: false, preventPending: false, progressCallback: HandleProgress, userData: null); } If you specify the full path to the package, then there are no problems. Is it possible to make changes to the project to indicate the path to the folder with packages, and not to each package separately?
Similar to https://github.com/jeffkl/ManagedDism/issues/36, this API is just a wrapper around the native API. dism.exe has logic to enumerate files in a folder and call AddPackage multiple times. You'll need to mimic this behavior in your app.
foreach (var item in Directory.EnumerateFiles( ... ))
{
DismApi.AddPackage( ... );
}