88 def wrapperNames(dname, wfile): |
89 def wrapperNames(dname, wfile): |
89 """ |
90 """ |
90 Create the platform specific names for the wrapper script. |
91 Create the platform specific names for the wrapper script. |
91 |
92 |
92 @param dname name of the directory to place the wrapper into |
93 @param dname name of the directory to place the wrapper into |
|
94 @type str |
93 @param wfile basename (without extension) of the wrapper script |
95 @param wfile basename (without extension) of the wrapper script |
94 @return the names of the wrapper scripts |
96 @type str |
|
97 @return list of names of the wrapper scripts |
|
98 @rtype list of str |
95 """ |
99 """ |
96 wnames = ( |
100 wnames = ( |
97 (dname + "\\" + wfile + ".cmd", dname + "\\" + wfile + ".bat") |
101 [dname + "\\" + wfile + ".cmd", dname + "\\" + wfile + ".bat"] |
98 if sys.platform.startswith(("win", "cygwin")) |
102 if sys.platform.startswith(("win", "cygwin")) |
99 else (dname + "/" + wfile,) |
103 else [dname + "/" + wfile] |
100 ) |
104 ) |
101 |
105 |
102 return wnames |
106 return wnames |
103 |
107 |
104 |
108 |
179 "ericDir", |
183 "ericDir", |
180 ]: |
184 ]: |
181 with contextlib.suppress(AttributeError): |
185 with contextlib.suppress(AttributeError): |
182 dirpath = getConfig(name) |
186 dirpath = getConfig(name) |
183 if os.path.exists(dirpath): |
187 if os.path.exists(dirpath): |
184 shutil.rmtree(dirpath, True) |
188 shutil.rmtree(dirpath, ignore_errors=True) |
185 |
189 |
186 # Cleanup translations |
190 # Cleanup translations |
187 for name in glob.glob( |
191 for name in glob.glob( |
188 os.path.join(getConfig("ericTranslationsDir"), "eric7_*.qm") |
192 os.path.join(getConfig("ericTranslationsDir"), "eric7_*.qm") |
189 ): |
193 ): |
241 if importlib.util.find_spec("pywintypes") is None: |
245 if importlib.util.find_spec("pywintypes") is None: |
242 # links were not created by install.py |
246 # links were not created by install.py |
243 return |
247 return |
244 |
248 |
245 regPath = ( |
249 regPath = ( |
246 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" |
250 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" |
247 + "\\User Shell Folders" |
|
248 ) |
251 ) |
249 |
252 |
250 # 1. cleanup desktop links |
253 # 1. cleanup desktop links |
251 regName = "Desktop" |
254 regName = "Desktop" |
252 desktopEntry = getWinregEntry(regName, regPath) |
255 desktopEntry = getWinregEntry(regName, regPath) |
425 @param name variable name |
429 @param name variable name |
426 @type str |
430 @type str |
427 @param path registry path of the variable |
431 @param path registry path of the variable |
428 @type str |
432 @type str |
429 @return value of requested registry variable |
433 @return value of requested registry variable |
430 @rtype any |
434 @rtype Any |
431 """ |
435 """ |
432 # From http://stackoverflow.com/a/35286642 |
436 # From http://stackoverflow.com/a/35286642 |
433 import winreg # __IGNORE_WARNING_I103__ |
437 import winreg # __IGNORE_WARNING_I103__ |
434 |
438 |
435 try: |
439 try: |