Chromium Code Reviews| 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) |