Manual dependencies

Apr 24, 2015 at 4:14 AM
Hey. I would like to use your API in my project but the requirement of having full ADK offline requires to download 4.1GB of files!

Image

Is there any chance of simply getting required dll's and put them into project directory?

Thanks
Coordinator
Apr 24, 2015 at 1:29 PM
Technically this API is just a wrapper around the Native DLLs created by Microsoft. They haven't provided a .NET API so my project just provides a .NET assembly that P/Invokes into DismApi.dll. The only option before was to write an app in C++ or to include your own DLLIMPORT methods in every app that uses DISM.

Unfortunately, it would be illegal for me to distribute Microsoft's assemblies with this API, hence the requirement. If you were writing a C++ app or wrapping the API yourself, you would still need the ADK per Microsoft's requirement: Using the DISM API.

Also, when you install the Windows ADK, the only component you need for DISM is "Deployment Tools" which indicates will only take up 54.4 MB.

Is your development computer running Windows 7 or Windows 8?
Apr 24, 2015 at 1:51 PM
It's Windows 7. Reducing it to 54.4MB is already good :)

I understand that it's API around the native DLLs and I thought I can just separate those DLLs from this "Deployment Tools" package to the app.

Perhaps you understand my concerns. You're writing 5MB app and your app weights extra 500MB to carry out the dependencies (usually .msi installers) where in reality you need only 1 or 2 DLLs.

Thx
Apr 26, 2015 at 12:21 AM
Strange. I installed only the deployment tools and still getting the same error.
Unable to load DLL 'DismApi': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I'll see if I can figure out what is actually missing.
Apr 26, 2015 at 4:22 AM
Edited Apr 26, 2015 at 4:25 AM
Okey so the list of required libraries is as following. Also it's worth mentioning that ADK doesn't add itself to the PATH(!) I already have some of those libs in my system32 installed but they differ from the one from ADK and are NOT compatible.
api-ms-win-downlevel-advapi32-l1-1-0.dll
api-ms-win-downlevel-advapi32-l1-1-1.dll
api-ms-win-downlevel-advapi32-l2-1-0.dll
api-ms-win-downlevel-advapi32-l2-1-1.dll
api-ms-win-downlevel-advapi32-l3-1-0.dll
api-ms-win-downlevel-advapi32-l4-1-0.dll
api-ms-win-downlevel-kernel32-l1-1-0.dll
api-ms-win-downlevel-kernel32-l2-1-0.dll
api-ms-win-downlevel-ole32-l1-1-0.dll
api-ms-win-downlevel-ole32-l1-1-1.dll
api-ms-win-downlevel-shlwapi-l1-1-0.dll
api-ms-win-downlevel-shlwapi-l1-1-1.dll
api-ms-win-downlevel-user32-l1-1-0.dll
api-ms-win-downlevel-user32-l1-1-1.dll
api-ms-win-downlevel-version-l1-1-0.dll
compatprovider.dll
dismapi.dll
dismapi86.dll
dismcore.dll
dismcoreps.dll
dismprov.dll
folderprovider.dll
imagingprovider.dll
logprovider.dll
vhdprovider.dll
wimprovider.dll
I encountered different problem though. When I try to install a feature, I get an error (exception).
Object reference not set to an instance of an object.
It is quite vague though.. I tried to debug it and apparently the hr that returns from DismEnableFeature is 1. It's not 0 (as expected) but shouldn't it be more like 0x8........ instead of just 1?

this is my code
DismApi.Initialize(DismLogLevel.LogErrors);
DismSession session = DismApi.OpenOnlineSession();
DismApi.EnableFeatureByPackageName(session, rolename, null, true, false);
DismApi.CloseSession(session);
DismApi.Shutdown();
If I run this command from PS 2.0 it works fine
dism /online /enable-feature /featurename:IIS-NetFxExtensibility
ALSO when I try to run the same code again, it fails on Initialize() with same exception as above.