There seems to be an issue when creating the def file, so this was removed. Also an absolute path which was included by accident was removed.
Based on @eladsal's code. Location of Microsoft SDK is now retrieved from the registry. Also x86 and x64-bit architectures are included.