Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error message with AddPackage #102

Open
Devils0411 opened this issue Sep 7, 2020 · 1 comment
Open

error message with AddPackage #102

Devils0411 opened this issue Sep 7, 2020 · 1 comment

Comments

@Devils0411
Copy link

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?

@jeffkl
Copy link
Owner

jeffkl commented Sep 8, 2020

Similar to #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( ... );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants