Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1629)

Unified Diff: visual_studio/NativeClientVSAddIn/InstallerResources/install.py

Issue 11115018: Better handling of permission errors during install. (Closed) Base URL: http://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: visual_studio/NativeClientVSAddIn/InstallerResources/install.py
diff --git a/visual_studio/NativeClientVSAddIn/InstallerResources/install.py b/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
index f649a2266220268a17d60808b0f2f1601c38f6f3..6898f7535b580d906aa8fb15bb9b7198c948c5d0 100644
--- a/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
+++ b/visual_studio/NativeClientVSAddIn/InstallerResources/install.py
@@ -45,6 +45,9 @@ def UninstallDirectory(directory):
def UninstallFile(file_path):
if os.path.exists(file_path):
+ if not os.access(file_path, os.W_OK):
+ raise InstallError("File is marked as read-only: %s.\n"
+ "Please correct and try again." % file_path)
os.remove(file_path)
print 'Removed: %s' % (file_path)
@@ -249,8 +252,13 @@ if __name__ == '__main__':
print e
except WindowsError as e:
if e.winerror == 5:
- print "Access denied error. Please ensure Visual Studio and MSBuild"
- print "processes are closed."
+ print e
+ print("The install script failed to write to the files mentioned above")
+ if ctypes.windll.shell32.IsUserAnAdmin() != 1:
+ print("Please try running as administrator.")
+ else:
+ print("Please check for any running programs that might "
+ "have them locked.")
binji 2012/10/12 18:43:02 You probably still want to mention Visual studio a
Sam Clegg 2012/10/12 18:51:58 We already check for them explicitly/separately ab
else:
raise
sys.exit(rtn)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698