Sun, 31 May 2020 17:26:14 +0200
Merged with default branch to prepare new release.
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 | |
7360
9190402e4505
Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7257
diff
changeset
|
4 | # Copyright (c) 2002 - 2020 Detlev Offenbach <detlev@die-offenbachs.de> |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | # |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
6 | # This is the uninstall script for eric6. |
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 | """ |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
10 | Uninstallation script for the eric6 IDE and all eric6 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 |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | # Define the globals. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | progName = None |
5433
e1c50b88fc43
Little fix for the uninstall script.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5389
diff
changeset
|
21 | currDir = os.getcwd() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | 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
|
23 | progLanguages = ["Python", "Ruby", "QSS"] |
3714
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
24 | defaultMacAppBundleName = "eric6.app" |
4080395e3426
Changed the uninstall code for Mac platforms.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3697
diff
changeset
|
25 | 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
|
26 | 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
|
27 | 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
|
28 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
29 | |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
30 | def exit(rcode=0): |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
31 | """ |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
32 | 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
|
33 | |
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 | @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
|
35 | """ |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
36 | global currDir |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
37 | |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
38 | # restore the local eric6config.py |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
39 | 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
|
40 | if os.path.exists("eric6config.py"): |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
41 | os.remove("eric6config.py") |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
42 | 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
|
43 | |
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
|
44 | if sys.platform.startswith(("win", "cygwin")): |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
45 | try: |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
46 | input("Press enter to continue...") |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
47 | except (EOFError, SyntaxError): |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
48 | pass |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
49 | |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
50 | os.chdir(currDir) |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
51 | |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
52 | sys.exit(rcode) |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
53 | |
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
|
54 | # 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
|
55 | 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
|
56 | 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
|
57 | 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
|
58 | 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
|
59 | except ImportError: |
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 | print("The eric6 IDE doesn't seem to be installed. Aborting.") |
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 | 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
|
62 | 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
|
63 | # an incomplete or old config file was found |
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 | print("The eric6 IDE seems to be installed incompletely. Aborting.") |
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 | 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
|
66 | |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
67 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
68 | 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
|
69 | """ |
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2736
diff
changeset
|
70 | Display a usage message and exit. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
71 | |
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
|
72 | @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
|
73 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | global progName |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | |
12
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
76 | print("Usage:") |
428
58405c24aa09
Did some more string format conversions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
146
diff
changeset
|
77 | 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
|
78 | print("where:") |
1d8dd9706f46
First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
0
diff
changeset
|
79 | print(" -h display this help message") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
81 | exit(rcode) |
0
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 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | def initGlobals(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | """ |
2965
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2736
diff
changeset
|
86 | 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
|
87 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | global pyModDir |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | pyModDir = distutils.sysconfig.get_python_lib(True) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | |
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
|
93 | 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
|
94 | """ |
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
|
95 | 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
|
96 | |
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 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
|
98 | @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
|
99 | @return the names of the wrapper scripts |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | """ |
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
|
101 | if sys.platform.startswith(("win", "cygwin")): |
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
|
102 | wnames = (dname + "\\" + wfile + ".cmd", |
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
|
103 | dname + "\\" + wfile + ".bat") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
104 | else: |
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
|
105 | wnames = (dname + "/" + wfile, ) |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | |
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
|
107 | return wnames |
0
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 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
110 | def uninstallEric(): |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | Uninstall the eric files. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | global pyModDir |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | |
146
afeb742e7148
Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
107
diff
changeset
|
116 | # 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
|
117 | 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
|
118 | 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
|
119 | # 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
|
120 | 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
|
121 | uninstallWindowsLinks() |
146
afeb742e7148
Added installation of a .desktop file for Linux systems.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
107
diff
changeset
|
122 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | # Remove the wrapper scripts |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | rem_wnames = [ |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
125 | "eric6_api", "eric6_compare", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
126 | "eric6_configure", "eric6_diff", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
127 | "eric6_doc", "eric6_qregularexpression", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
128 | "eric6_qregexp", "eric6_re", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
129 | "eric6_trpreviewer", "eric6_uipreviewer", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
130 | "eric6_unittest", "eric6", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
131 | "eric6_tray", "eric6_editor", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
132 | "eric6_plugininstall", "eric6_pluginuninstall", |
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
133 | "eric6_pluginrepository", "eric6_sqlbrowser", |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
134 | "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
|
135 | "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
|
136 | # 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
|
137 | "eric6_webbrowser", |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | ] |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
139 | |
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
|
140 | 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
|
141 | 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
|
142 | 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
|
143 | 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
|
144 | 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
|
145 | |
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
|
146 | # Cleanup our config file(s) |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
147 | 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
|
148 | 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
|
149 | 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
|
150 | 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
|
151 | 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
|
152 | 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
|
153 | 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
|
154 | 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
|
155 | |
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
|
156 | # 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
|
157 | 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
|
158 | '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
|
159 | '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
|
160 | '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
|
161 | 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
|
162 | 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
|
163 | 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
|
164 | |
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 | # 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
|
166 | for name in glob.glob( |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
167 | 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
|
168 | 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
|
169 | 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
|
170 | |
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 | # 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
|
172 | apidir = getConfig('apidir') |
3948
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
173 | if apidir: |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
174 | for progLanguage in progLanguages: |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
175 | 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
|
176 | 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
|
177 | 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
|
178 | os.remove(apiname) |
6c3720179d6b
Extended the install script to improve cooperation with packagers.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3943
diff
changeset
|
179 | 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
|
180 | 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
|
181 | 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
|
182 | 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
|
183 | |
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 | 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
|
185 | # 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
|
186 | uninstallMacAppBundle() |
4559
5af0cda900b3
Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
187 | |
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
|
188 | # 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
|
189 | 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
|
190 | |
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 | # 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
|
192 | 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
|
193 | |
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 | # 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
|
195 | 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
|
196 | |
4559
5af0cda900b3
Changed unistall.py to end with a message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4021
diff
changeset
|
197 | print("\nUninstallation completed") |
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 | except (IOError, OSError) as 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
|
199 | 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
|
200 | '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
|
201 | exit(7) |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
202 | |
945
8cd4d08fa9f6
Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
908
diff
changeset
|
203 | |
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
|
204 | 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
|
205 | """ |
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 | 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
|
207 | """ |
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
|
208 | 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
|
209 | 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
|
210 | 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
|
211 | # 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
|
212 | 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
|
213 | |
7257
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
214 | regPath = ( |
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
215 | "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" + |
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
216 | "\\User Shell Folders" |
c4d0cac9b5c9
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
217 | ) |
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
|
218 | |
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
|
219 | # 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
|
220 | 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
|
221 | 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
|
222 | 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
|
223 | 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
|
224 | 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
|
225 | 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
|
226 | 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
|
227 | 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
|
228 | os.remove(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
|
229 | except EnvironmentError: |
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 | # 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
|
231 | 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
|
232 | |
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 | # 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
|
234 | 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
|
235 | 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
|
236 | 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
|
237 | 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
|
238 | 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
|
239 | 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
|
240 | 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
|
241 | shutil.rmtree(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
|
242 | except EnvironmentError: |
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 | # 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
|
244 | 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
|
245 | |
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
|
246 | |
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
|
247 | 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
|
248 | """ |
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 | 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
|
250 | """ |
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 | 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
|
252 | for name in ["/usr/share/pixmaps/eric.png", |
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
|
253 | "/usr/share/pixmaps/ericWeb.png"]: |
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
|
254 | 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
|
255 | 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
|
256 | for name in [ |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
257 | "/usr/share/applications/eric6.desktop", |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
258 | "/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
|
259 | "/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
|
260 | "/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
|
261 | "/usr/share/pixmaps/eric.png", |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
262 | "/usr/share/pixmaps/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
|
263 | # 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
|
264 | "/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
|
265 | ]: |
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 | 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
|
267 | 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
|
268 | 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
|
269 | # 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
|
270 | for name in ["~/.local/share/pixmaps/eric.png", |
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
|
271 | "~/.local/share/pixmaps/ericWeb.png"]: |
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
|
272 | 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
|
273 | 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
|
274 | 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
|
275 | for name in [ |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
276 | "~/.local/share/applications/eric6.desktop", |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
277 | "~/.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
|
278 | "~/.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
|
279 | "~/.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
|
280 | "~/.local/share/pixmaps/eric.png", |
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
281 | "~/.local/share/pixmaps/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
|
282 | # 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
|
283 | "/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
|
284 | ]: |
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 | 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
|
286 | 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
|
287 | 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
|
288 | |
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 | |
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 | 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
|
291 | """ |
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 | 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
|
293 | """ |
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 | 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
|
295 | 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
|
296 | 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
|
297 | 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
|
298 | 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
|
299 | 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
|
300 | 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
|
301 | 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
|
302 | 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
|
303 | 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
|
304 | 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
|
305 | 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
|
306 | ]: |
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
|
307 | 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
|
308 | 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
|
309 | |
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
|
310 | |
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
|
311 | 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
|
312 | """ |
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 | 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
|
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 | 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
|
316 | |
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 | 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
|
318 | 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
|
319 | 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
|
320 | |
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 | 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
|
322 | 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
|
323 | 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
|
324 | |
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
|
325 | 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
|
326 | 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
|
327 | 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
|
328 | 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
|
329 | 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
|
330 | 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
|
331 | answer = input("Shall these directories be removed (y/N)? ") |
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
|
332 | 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
|
333 | 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
|
334 | 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
|
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 | |
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 | 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
|
338 | """ |
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 | 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
|
340 | """ |
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 | 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
|
342 | 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
|
343 | 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
|
344 | 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
|
345 | 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
|
346 | 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
|
347 | answer = input("Shall this directory be removed (y/N)? ") |
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
|
348 | 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
|
349 | 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
|
350 | |
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 | 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
|
353 | """ |
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 | 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
|
355 | """ |
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
|
356 | 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
|
357 | 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
|
358 | except ImportError: |
7192
a22eee00b052
Started removing runtime support for Python2 and PyQt4.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6942
diff
changeset
|
359 | 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
|
360 | 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
|
361 | 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
|
362 | |
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 | 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
|
364 | 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
|
365 | 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
|
366 | 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
|
367 | 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
|
368 | 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
|
369 | 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
|
370 | 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
|
371 | answer = input("Shall this directory be removed (y/N)? ") |
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
|
372 | 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
|
373 | 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
|
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 | |
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 | 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
|
377 | """ |
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 | 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
|
379 | |
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
|
380 | @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
|
381 | """ |
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
|
382 | cdn = ".eric6" |
5823
70dfe6a4aa03
Fixed an issue getting the home directory during uninstallation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5711
diff
changeset
|
383 | 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
|
384 | |
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
|
385 | |
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
|
386 | 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
|
387 | """ |
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 | 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
|
389 | |
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 | @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
|
391 | @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
|
392 | @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
|
393 | @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
|
394 | @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
|
395 | @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
|
396 | """ |
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 | # 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
|
398 | 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
|
399 | 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
|
400 | 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
|
401 | 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
|
402 | 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
|
403 | 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
|
404 | 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
|
405 | 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
|
406 | 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
|
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 | |
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 | 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
|
410 | """ |
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 | 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
|
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 | @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
|
414 | @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
|
415 | """ |
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 | 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
|
417 | 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
|
418 | "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
|
419 | "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
|
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 | return [l.format(majorVersion, minorVersion) for l in 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
|
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 | |
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 | 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
|
426 | """ |
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 | 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
|
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 | @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
|
430 | @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
|
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 | 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
|
433 | 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
|
434 | |
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
|
435 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
436 | 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
|
437 | """ |
d133c7edd88a
Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2736
diff
changeset
|
438 | The main function of the script. |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
439 | |
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
|
440 | @param argv list of command line arguments |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
441 | """ |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
442 | import getopt |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
443 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
444 | initGlobals() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
445 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
446 | # Parse the command line. |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
447 | global progName |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
448 | progName = os.path.basename(argv[0]) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
449 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
450 | 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
|
451 | optlist, args = getopt.getopt(argv[1:], "hy") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
452 | except getopt.GetoptError: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
453 | usage() |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
454 | |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
455 | global platBinDir |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
456 | |
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
|
457 | for opt, _arg in optlist: |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
458 | if opt == "-h": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
459 | usage(0) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
460 | |
5055
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
461 | print("\nUninstalling eric6 ...") |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
462 | uninstallEric() |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
463 | print("\nUninstallation complete.") |
7db1b9496e52
Some enhancements to the install and uninstall scripts.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4806
diff
changeset
|
464 | print() |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
465 | |
2654
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
466 | exit(0) |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
467 | |
df2c3218cc5e
Fixed an issue uninstalling eric5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
2383
diff
changeset
|
468 | |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
469 | if __name__ == "__main__": |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
470 | try: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
471 | main(sys.argv) |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
472 | except SystemExit: |
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
473 | 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
|
474 | except Exception: |
3039
8dd0165d805d
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
475 | 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
|
476 | """ the program,\n""" |
8dd0165d805d
Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3019
diff
changeset
|
477 | """including the following traceback, to""" |
3670
f0cb7579c0b4
Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
3621
diff
changeset
|
478 | """ eric-bugs@eric-ide.python-projects.org.\n""") |
0
de9c2efb9d02
Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
479 | raise |
4566
a2e8f3c420ec
Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4561
diff
changeset
|
480 | |
a2e8f3c420ec
Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4561
diff
changeset
|
481 | # |
a2e8f3c420ec
Dealt with the M801 code style checker messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
4561
diff
changeset
|
482 | # eflag: noqa = M801 |