Looks like we might be able to do something like the following windows (ie have the function that does the file copying as a separate script and launch that using admin level). It will presumably then ask for authentication as admin:Also, is there any good reason to require users to run as Administrator to do updates? I do not recall having to do that for any other Windows software.This isn't my choice, it's just that altering files that are within the program files folder seems to require this. it would be ideal to simply ask the user, at the time of upgrade, for permission to elevate to administrator. But I don't know how to do that yet (and don't really see it as a priority right now).
import win32api
win32api.ShellExecute( 0, # parent window
"runas", # need this to force UAC to act
"C:\\python27\\python.exe",
"moveNewZipFileIntoPlace.py",
"C:\\python27", # base dir
1 ) # window visibility - 1: visible, 0: background
http://blog.pythonaro.com/2011/09/python-wmi-services-and-uac.html-- Jonathan Peirce Nottingham Visual Neuroscience http://www.peirce.org.uk
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.