I realized I never got back to this after promising to take a look.
I don't see anything in the update checker portion (or the rest of the plugin) that could cause the plugin to be removed from the list of installed plugins.
I did notice, however, the exception when on Windows to ignore any errors when attempting to delete the temp directory.
Code:
# delete temp folder
ignore_errors = (sys.platform == 'win32')
shutil.rmtree(temp_dir, ignore_errors)
The reason errors are being raised on Windows is because you're cd'ing into temp directory in the beginning of the plugin.
Code:
# create mimetype file
os.chdir(temp_dir)
mimetype = open("mimetype", "w")
mimetype.write("application/epub+zip")
mimetype.close()
Windows won't let you delete the working directory (which is what 'temp_dir' became when you did the os.chdir call). Either change to a different directory before attempting to delete it, or never cd into it in the first place. That way you won't be leaving temp directories behind on Windows (ignoring the error does just
that).
Something like:
Code:
# create mimetype file
mimetype = open(os.path.join(temp_dir, "mimetype"), "w")
mimetype.write("application/epub+zip")
mimetype.close()
...should work without actually cd'ing into the directory. You could still ignore errors on Windows if you like, but I guarantee there would be a lot less errors to ignore (and a lot less tmp folders left behind).