scripts/uninstall.py

Thu, 22 Apr 2021 18:02:47 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 22 Apr 2021 18:02:47 +0200
changeset 8260
2161475d9639
parent 8254
259484b0fc75
child 8314
e3642a6a1e71
permissions
-rw-r--r--

Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).

12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1 #!/usr/bin/env python3
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7836
diff changeset
4 # Copyright (c) 2002 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5 #
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
6 # This is the uninstall script for eric.
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
7 #
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
10 Uninstallation script for the eric IDE and all eric related tools.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 import sys
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 import shutil
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import glob
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import distutils.sysconfig
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
18 import contextlib
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 # Define the globals.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 progName = None
5433
e1c50b88fc43 Little fix for the uninstall script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
22 currDir = os.getcwd()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 pyModDir = None
3468
869d0b6e1e16 Added an API file for QSS and corrected an issue in the APIs manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
24 progLanguages = ["Python", "Ruby", "QSS"]
3714
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
25 defaultMacAppBundleName = "eric6.app"
4080395e3426 Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3697
diff changeset
26 defaultMacAppBundlePath = "/Applications"
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
27 settingsNameOrganization = "Eric6"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
28 settingsNameGlobal = "eric6"
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
29
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 908
diff changeset
30
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
31 def exit(rcode=0):
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
32 """
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
33 Exit the uninstall script.
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
34
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
35 @param rcode result code to report back (integer)
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
36 """
5055
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
37 global currDir
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
38
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
39 # restore the local eric6config.py
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
40 if os.path.exists("eric6config.py.orig"):
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
41 if os.path.exists("eric6config.py"):
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
42 os.remove("eric6config.py")
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
43 os.rename("eric6config.py.orig", "eric6config.py")
5055
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
44
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
45 if sys.platform.startswith(("win", "cygwin")):
8243
cc717c2ae956 Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7960
diff changeset
46 with contextlib.suppress():
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
47 input("Press enter to continue...") # secok
5055
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
48
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
49 os.chdir(currDir)
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
50
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
51 sys.exit(rcode)
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
52
7211
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
53 # get a local eric6config.py out of the way
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
54 if os.path.exists("eric6config.py"):
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
55 os.rename("eric6config.py", "eric6config.py.orig")
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
56 try:
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
57 from eric6config import getConfig
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
58 except ImportError:
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
59 print("The eric IDE doesn't seem to be installed. Aborting.")
7211
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
60 exit(1)
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
61 except SyntaxError:
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
62 # an incomplete or old config file was found
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
63 print("The eric IDE seems to be installed incompletely. Aborting.")
7211
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
64 exit(1)
1c97f3142fa8 install/uninstall: implemented code to cope with the situation that the names contained in the eric6config.py file were generated with a non-utf8 encoding.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7203
diff changeset
65
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
66
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 908
diff changeset
67 def usage(rcode=2):
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
68 """
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
69 Display a usage message and exit.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
71 @param rcode return code passed back to the calling process (integer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 global progName
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
75 print("Usage:")
428
58405c24aa09 Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 146
diff changeset
76 print(" {0} [-h]".format(progName))
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
77 print("where:")
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
78 print(" -h display this help message")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
80 exit(rcode)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 def initGlobals():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
85 Set the values of globals that need more than a simple assignment.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 global pyModDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 pyModDir = distutils.sysconfig.get_python_lib(True)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91
6495
6e73d31af3af Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6365
diff changeset
92 def wrapperNames(dname, wfile):
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
93 """
6495
6e73d31af3af Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6365
diff changeset
94 Create the platform specific names for the wrapper script.
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
95
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
96 @param dname name of the directory to place the wrapper into
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
97 @param wfile basename (without extension) of the wrapper script
6495
6e73d31af3af Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6365
diff changeset
98 @return the names of the wrapper scripts
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 """
8260
2161475d9639 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8254
diff changeset
100 wnames = (
2161475d9639 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8254
diff changeset
101 (dname + "\\" + wfile + ".cmd", dname + "\\" + wfile + ".bat")
2161475d9639 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8254
diff changeset
102 if sys.platform.startswith(("win", "cygwin")) else
2161475d9639 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8254
diff changeset
103 (dname + "/" + wfile, )
2161475d9639 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8254
diff changeset
104 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105
6495
6e73d31af3af Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6365
diff changeset
106 return wnames
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 def uninstallEric():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 Uninstall the eric files.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 global pyModDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
146
afeb742e7148 Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 107
diff changeset
115 # Remove the menu entry for Linux systems
6214
89a53d80e729 install, uninstall: Modified the install and uninstall scripts such, that they can be used without being administrator (i.e. if installing into a virtual environment).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6188
diff changeset
116 if sys.platform.startswith("linux"):
6500
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
117 uninstallLinuxSpecifics()
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
118 # Remove the Desktop and Start Menu entries for Windows systems
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
119 elif sys.platform.startswith(("win", "cygwin")):
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
120 uninstallWindowsLinks()
146
afeb742e7148 Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 107
diff changeset
121
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 # Remove the wrapper scripts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 rem_wnames = [
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
124 "eric6_api", "eric6_compare",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
125 "eric6_configure", "eric6_diff",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
126 "eric6_doc", "eric6_qregularexpression",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
127 "eric6_qregexp", "eric6_re",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
128 "eric6_trpreviewer", "eric6_uipreviewer",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
129 "eric6_unittest", "eric6",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
130 "eric6_tray", "eric6_editor",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
131 "eric6_plugininstall", "eric6_pluginuninstall",
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
132 "eric6_pluginrepository", "eric6_sqlbrowser",
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
133 "eric6_iconeditor", "eric6_snap", "eric6_hexeditor",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
134 "eric6_browser", "eric6_shell",
7203
2079ccbfa335 install, uninstall scripts: re-added the removal of the obsolete eric6_webbrowser stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
135 # from Python2 era
2079ccbfa335 install, uninstall scripts: re-added the removal of the obsolete eric6_webbrowser stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
136 "eric6_webbrowser",
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 ]
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
139 try:
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
140 for rem_wname in rem_wnames:
6495
6e73d31af3af Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6365
diff changeset
141 for rwname in wrapperNames(getConfig('bindir'), rem_wname):
6e73d31af3af Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6365
diff changeset
142 if os.path.exists(rwname):
6e73d31af3af Changed the extension of the generated script files for Windows from '.bat' to '.cmd'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6365
diff changeset
143 os.remove(rwname)
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
144
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
145 # Cleanup our config file(s)
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
146 for name in ['eric6config.py', 'eric6config.pyc', 'eric6.pth']:
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
147 e5cfile = os.path.join(pyModDir, name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
148 if os.path.exists(e5cfile):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
149 os.remove(e5cfile)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
150 e5cfile = os.path.join(pyModDir, "__pycache__", name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
151 path, ext = os.path.splitext(e5cfile)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
152 for f in glob.glob("{0}.*{1}".format(path, ext)):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
153 os.remove(f)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
154
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
155 # Cleanup the install directories
3621
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
156 for name in ['ericExamplesDir', 'ericDocDir', 'ericDTDDir',
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
157 'ericCSSDir', 'ericIconDir', 'ericPixDir',
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
158 'ericTemplatesDir', 'ericCodeTemplatesDir',
15f23ed3f216 Fixed a few source code style issues found by the updated pe8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3597
diff changeset
159 'ericOthersDir', 'ericStylesDir', 'ericDir']:
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
160 dirpath = getConfig(name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
161 if os.path.exists(dirpath):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
162 shutil.rmtree(dirpath, True)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
163
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
164 # Cleanup translations
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
165 for name in glob.glob(
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
166 os.path.join(getConfig('ericTranslationsDir'), 'eric6_*.qm')):
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
167 if os.path.exists(name):
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
168 os.remove(name)
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
169
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
170 # Cleanup API files
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
171 apidir = getConfig('apidir')
3948
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
172 if apidir:
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
173 for progLanguage in progLanguages:
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
174 for name in getConfig('apis'):
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
175 apiname = os.path.join(apidir, progLanguage.lower(), name)
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
176 if os.path.exists(apiname):
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
177 os.remove(apiname)
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
178 for apiname in glob.glob(
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
179 os.path.join(apidir, progLanguage.lower(), "*.bas")):
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
180 if os.path.basename(apiname) != "eric6.bas":
6c3720179d6b Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3943
diff changeset
181 os.remove(apiname)
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
182
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
183 if sys.platform == "darwin":
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
184 # delete the Mac app bundle
6500
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
185 uninstallMacAppBundle()
4559
5af0cda900b3 Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
186
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
187 # remove plug-in directories
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
188 removePluginDirectories()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
189
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
190 # remove the eric data directory
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
191 removeDataDirectory()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
192
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
193 # remove the eric configuration directory
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
194 removeConfigurationData()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
195
4559
5af0cda900b3 Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
196 print("\nUninstallation completed")
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
197 except OSError as msg:
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
198 sys.stderr.write(
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
199 'Error: {0}\nTry uninstall with admin rights.\n'.format(msg))
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
200 exit(7)
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
201
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 908
diff changeset
202
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
203 def uninstallWindowsLinks():
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
204 """
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
205 Clean up the Desktop and Start Menu entries for Windows.
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
206 """
6510
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
207 try:
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
208 from pywintypes import com_error # __IGNORE_WARNING__
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
209 except ImportError:
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
210 # links were not created by install.py
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
211 return
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
212
7257
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
213 regPath = (
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
214 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" +
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
215 "\\User Shell Folders"
c4d0cac9b5c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
216 )
6510
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
217
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
218 # 1. cleanup desktop links
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
219 regName = "Desktop"
6510
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
220 desktopEntry = getWinregEntry(regName, regPath)
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
221 if desktopEntry:
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
222 desktopFolder = os.path.normpath(os.path.expandvars(desktopEntry))
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
223 for linkName in windowsDesktopNames():
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
224 linkPath = os.path.join(desktopFolder, linkName)
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
225 if os.path.exists(linkPath):
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
226 try:
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
227 os.remove(linkPath)
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
228 except OSError:
6510
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
229 # maybe restrictions prohibited link removal
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
230 print("Could not remove '{0}'.".format(linkPath))
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
231
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
232 # 2. cleanup start menu entry
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
233 regName = "Programs"
6510
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
234 programsEntry = getWinregEntry(regName, regPath)
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
235 if programsEntry:
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
236 programsFolder = os.path.normpath(os.path.expandvars(programsEntry))
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
237 eric6EntryPath = os.path.join(programsFolder, windowsProgramsEntry())
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
238 if os.path.exists(eric6EntryPath):
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
239 try:
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
240 shutil.rmtree(eric6EntryPath)
7836
2f0d208b8137 Changed code to not use the OSError aliases (IOError, EnvironmentError, socket.error and select.error) anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7628
diff changeset
241 except OSError:
6510
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
242 # maybe restrictions prohibited link removal
d8fd663f86ef install, uninstall: added code to create and remove Desktop and Start Menu entries on Windows systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6509
diff changeset
243 print("Could not remove '{0}'.".format(eric6EntryPath))
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
244
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
245
6500
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
246 def uninstallLinuxSpecifics():
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
247 """
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
248 Uninstall Linux specific files.
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
249 """
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
250 if os.getuid() == 0:
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
251 for name in [
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
252 "/usr/share/applications/eric6.desktop",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
253 "/usr/share/appdata/eric6.appdata.xml",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
254 "/usr/share/metainfo/eric6.appdata.xml",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
255 "/usr/share/applications/eric6_browser.desktop",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
256 "/usr/share/pixmaps/eric.png",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
257 "/usr/share/pixmaps/ericWeb.png",
8254
259484b0fc75 install.py, uninstall.py: changed the Linux path where our icons get installed
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
258 "/usr/share/icons/eric.png",
259484b0fc75 install.py, uninstall.py: changed the Linux path where our icons get installed
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
259 "/usr/share/icons/ericWeb.png",
7203
2079ccbfa335 install, uninstall scripts: re-added the removal of the obsolete eric6_webbrowser stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
260 # from Python2 era
2079ccbfa335 install, uninstall scripts: re-added the removal of the obsolete eric6_webbrowser stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
261 "/usr/share/applications/eric6_webbrowser.desktop",
6500
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
262 ]:
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
263 if os.path.exists(name):
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
264 os.remove(name)
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
265 elif os.getuid() >= 1000:
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
266 # it is assumed that user ids start at 1000
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
267 for name in [
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
268 "~/.local/share/applications/eric6.desktop",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
269 "~/.local/share/appdata/eric6.appdata.xml",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
270 "~/.local/share/metainfo/eric6.appdata.xml",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
271 "~/.local/share/applications/eric6_browser.desktop",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
272 "~/.local/share/pixmaps/eric.png",
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
273 "~/.local/share/pixmaps/ericWeb.png",
8254
259484b0fc75 install.py, uninstall.py: changed the Linux path where our icons get installed
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
274 "~/.local/share/icons/eric.png",
259484b0fc75 install.py, uninstall.py: changed the Linux path where our icons get installed
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8243
diff changeset
275 "~/.local/share/icons/ericWeb.png",
7203
2079ccbfa335 install, uninstall scripts: re-added the removal of the obsolete eric6_webbrowser stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
276 # from Python2 era
2079ccbfa335 install, uninstall scripts: re-added the removal of the obsolete eric6_webbrowser stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
277 "/usr/share/applications/eric6_webbrowser.desktop",
6500
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
278 ]:
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
279 path = os.path.expanduser(name)
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
280 if os.path.exists(path):
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
281 os.remove(path)
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
282
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
283
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
284 def uninstallMacAppBundle():
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
285 """
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
286 Uninstall the macOS application bundle.
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
287 """
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
288 if os.path.exists("/Developer/Applications/Eric6"):
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
289 shutil.rmtree("/Developer/Applications/Eric6")
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
290 try:
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
291 macAppBundlePath = getConfig("macAppBundlePath")
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
292 macAppBundleName = getConfig("macAppBundleName")
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
293 except AttributeError:
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
294 macAppBundlePath = defaultMacAppBundlePath
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
295 macAppBundleName = defaultMacAppBundleName
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
296 for bundlePath in [os.path.join(defaultMacAppBundlePath,
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
297 macAppBundleName),
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
298 os.path.join(macAppBundlePath,
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
299 macAppBundleName),
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
300 ]:
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
301 if os.path.exists(bundlePath):
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
302 shutil.rmtree(bundlePath)
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
303
0373580fc86c install.py, uninstall.py: performed some refactorings and prepared to create links on Windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6495
diff changeset
304
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
305 def removePluginDirectories():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
306 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
307 Remove the plug-in directories.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
308 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
309 pathsToRemove = []
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
310
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
311 globalPluginsDir = os.path.join(getConfig('mdir'), "eric6plugins")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
312 if os.path.exists(globalPluginsDir):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
313 pathsToRemove.append(globalPluginsDir)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
314
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
315 localPluginsDir = os.path.join(getConfigDir(), "eric6plugins")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
316 if os.path.exists(localPluginsDir):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
317 pathsToRemove.append(localPluginsDir)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
318
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
319 if pathsToRemove:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
320 print("Found these plug-in directories")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
321 for path in pathsToRemove:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
322 print(" - {0}".format(path))
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
323 answer = "c"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
324 while answer not in ["y", "Y", "n", "N", ""]:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
325 answer = input("Shall these directories be removed (y/N)? ")
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
326 # secok
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
327 if answer in ["y", "Y"]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
328 for path in pathsToRemove:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
329 shutil.rmtree(path)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
330
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
331
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
332 def removeDataDirectory():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
333 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
334 Remove the eric data directory.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
335 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
336 cfg = getConfigDir()
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
337 if os.path.exists(cfg):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
338 print("Found the eric data directory")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
339 print(" - {0}".format(cfg))
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
340 answer = "c"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
341 while answer not in ["y", "Y", "n", "N", ""]:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
342 answer = input("Shall this directory be removed (y/N)? ")
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
343 # secok
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
344 if answer in ["y", "Y"]:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
345 shutil.rmtree(cfg)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
346
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
347
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
348 def removeConfigurationData():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
349 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
350 Remove the eric configuration directory.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
351 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
352 try:
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
353 from PyQt5.QtCore import QSettings
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
354 except ImportError:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
355 print("No PyQt variant installed. The configuration directory")
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
356 print("cannot be determined. You have to remove it manually.\n")
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
357 return
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
358
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
359 settings = QSettings(QSettings.IniFormat, QSettings.UserScope,
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
360 settingsNameOrganization, settingsNameGlobal)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
361 settingsDir = os.path.dirname(settings.fileName())
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
362 if os.path.exists(settingsDir):
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
363 print("Found the eric configuration directory")
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
364 print(" - {0}".format(settingsDir))
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
365 answer = "c"
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
366 while answer not in ["y", "Y", "n", "N", ""]:
7192
a22eee00b052 Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
367 answer = input("Shall this directory be removed (y/N)? ")
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
368 # secok
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
369 if answer in ["y", "Y"]:
4746
bd60f10ff4ec Fixed an issue causing the uninstall script to crash.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4673
diff changeset
370 shutil.rmtree(settingsDir)
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
371
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
372
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
373 def getConfigDir():
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
374 """
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
375 Module function to get the name of the directory storing the config data.
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
376
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
377 @return directory name of the config dir (string)
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
378 """
6303
ec9ebaf206fb Got rid of the Windows "DotNet"-Hack (i.e. using _ instead of . as first character of special directories).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6214
diff changeset
379 cdn = ".eric6"
5823
70dfe6a4aa03 Fixed an issue getting the home directory during uninstallation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5711
diff changeset
380 return os.path.join(os.path.expanduser("~"), cdn)
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
381
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
382
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
383 def getWinregEntry(name, path):
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
384 """
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
385 Function to get an entry from the Windows Registry.
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
386
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
387 @param name variable name
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
388 @type str
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
389 @param path registry path of the variable
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
390 @type str
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
391 @return value of requested registry variable
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
392 @rtype any
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
393 """
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
394 # From http://stackoverflow.com/a/35286642
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
395 import winreg
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
396 try:
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
397 registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path, 0,
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
398 winreg.KEY_READ)
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
399 value, _ = winreg.QueryValueEx(registryKey, name)
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
400 winreg.CloseKey(registryKey)
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
401 return value
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
402 except WindowsError:
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
403 return None
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
404
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
405
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
406 def windowsDesktopNames():
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
407 """
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
408 Function to generate the link names for the Windows Desktop.
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
409
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
410 @return list of desktop link names
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
411 @rtype list of str
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
412 """
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
413 majorVersion, minorVersion = sys.version_info[:2]
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
414 linkTemplates = [
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
415 "eric6 (Python {0}.{1}).lnk",
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
416 "eric6 Browser (Python {0}.{1}).lnk",
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
417 ]
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
418
7628
f904d0eef264 Checked the reported security related issue reports generated by the new security checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
419 return [ll.format(majorVersion, minorVersion) for ll in linkTemplates]
6509
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
420
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
421
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
422 def windowsProgramsEntry():
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
423 """
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
424 Function to generate the name of the Start Menu top entry.
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
425
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
426 @return name of the Start Menu top entry
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
427 @rtype str
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
428 """
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
429 majorVersion, minorVersion = sys.version_info[:2]
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
430 return "eric6 (Python {0}.{1})".format(majorVersion, minorVersion)
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
431
884182bfd25c install, uninstall: started to add capability to generate Desktop and Start Menu entries on Windows platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6500
diff changeset
432
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 def main(argv):
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
434 """
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2736
diff changeset
435 The main function of the script.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436
3019
7912530a33e2 Fixed a few documentation strings that got broken while doing the line shortening job. That concludes the later.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2992
diff changeset
437 @param argv list of command line arguments
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 import getopt
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 initGlobals()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 # Parse the command line.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 global progName
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 progName = os.path.basename(argv[0])
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 try:
3597
137370f7114b Added the '-y' switch to the install script to allow to install Python2 and Python3 variants of eric5 in parallel by giving the startup script a '_py2' or '_py3' postfix.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3515
diff changeset
448 optlist, args = getopt.getopt(argv[1:], "hy")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 except getopt.GetoptError:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450 usage()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 global platBinDir
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453
6188
5a6ae3be31e6 Fixed some loop related coding issues detected by the extended code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
454 for opt, _arg in optlist:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 if opt == "-h":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 usage(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457
7960
e8fc383322f7 Harmonized some user visible strings and changed the term 'eric6' to the more generic 'eric'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
458 print("\nUninstalling eric ...")
5055
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
459 uninstallEric()
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
460 print("\nUninstallation complete.")
7db1b9496e52 Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4806
diff changeset
461 print()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462
2654
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
463 exit(0)
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
464
df2c3218cc5e Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2383
diff changeset
465
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 if __name__ == "__main__":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 try:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 main(sys.argv)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 except SystemExit:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 raise
4561
5bc6ed226471 Extended the uninstall script to remove the plug-ins directories, the data directory and the configuration directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4559
diff changeset
471 except Exception:
3039
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3019
diff changeset
472 print("""An internal error occured. Please report all the output of"""
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3019
diff changeset
473 """ the program,\n"""
8dd0165d805d Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3019
diff changeset
474 """including the following traceback, to"""
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3621
diff changeset
475 """ eric-bugs@eric-ide.python-projects.org.\n""")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 raise
4566
a2e8f3c420ec Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4561
diff changeset
477
a2e8f3c420ec Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4561
diff changeset
478 #
a2e8f3c420ec Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4561
diff changeset
479 # eflag: noqa = M801

eric ide

mercurial