Mar-18-2020, 09:52 AM
Like the original poster, I have written a Blender addon which requires a dll (.pyd for Windows). When 'Remove' is clicked within Blender to remove this addon, a function is called which deletes the files from their path in Blender's AppData. The issue is that if the dll is not unloaded before this remove process is attempted, os.unlink cannot act on the dll as access is denied. The addon I am developing is a commercial addon and so not being able to remove it after installation impacts on customer experience. I have been looking for a way to unload the dll using python for a while now but have had no luck.