问题
I have a precompiled c++ dll that I need to remove or replace the embedded manifest from. Is there a way that I can do this from the command line? I know it is possible to open the dll in VS and simply delete the manifest, but I would like to automate this process if possible.
回答1:
Unfortunately, it seems the standard tool to deal with manifests mt.exe shipped with VS cannot delete them. But if you are familiar with c++ it's quite easy to write your own tool for this purpose.
You just need to call BeginUpdateResource with given dll name, then UpdateResource with lpData = NULL and cbData = 0 to delete given resource type (RT_MANIFEST) and EndUpdateResource to commit changes.
来源:https://stackoverflow.com/questions/26037848/how-do-i-remove-a-manifest-from-a-precompiled-dll