I am trying to uninstall a version in esky using "app.uninstall_version(v)", but when I do so I get this error:
[Error 5] Access is denied.
Traceback (most recent call last):
File "Example.py", line 35, in EskyUpdate
File "esky\__init__.pyc", line 951, in uninstall_version
File "esky\__init__.pyc", line 1008, in _cleanup_bootstrap_env
File "esky\fstransact\win32txf.pyc", line 200, in remove
File "esky\fstransact\win32txf.pyc", line 214, in _remove
File "esky\fstransact\win32txf.pyc", line 24, in wrapper
WindowsError: [Error 5] Access is denied.
My program installs a new version of the program once available and opens the new version in a different process and then waits for its exit code.
If the exit code equals 0 then it restarts itself to get the new version running, but if the exit code does not equal 0(meaning there is an error in the new version) then the program will delete the new version and continue running normally.
here's the code:
def EskyUpdate():
if getattr(sys,"frozen",False):
app = esky.Esky(sys.executable,"http://example.com/downloads/")
updateVersion = app.find_update()
if(updateVersion != None):
app.fetch_version(updateVersion)
app.install_version(updateVersion)
appexe = esky.util.appexe_from_executable(sys.executable)
exitCode = subprocess.call(appexe)#calls the new version in a different process
if exitCode == 0:
os.execl(appexe, *([appexe]+sys.argv))
else:
app.uninstall_version(updateVersion)#this is where the error occurs
Why am I getting the "Access is denied" error when i try to uninstall the new version, and how can I uninstall the new version?