26 """ |
26 """ |
27 Create Desktop and Start Menu links. |
27 Create Desktop and Start Menu links. |
28 """ |
28 """ |
29 if sys.platform.startswith(("win", "cygwin")): |
29 if sys.platform.startswith(("win", "cygwin")): |
30 regPath = ( |
30 regPath = ( |
31 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer" |
31 "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders" |
32 + "\\User Shell Folders" |
|
33 ) |
32 ) |
34 |
33 |
35 # 1. create desktop shortcuts |
34 # 1. create desktop shortcuts |
36 regName = "Desktop" |
35 regName = "Desktop" |
37 desktopFolder = os.path.normpath( |
36 desktopFolder = os.path.normpath( |
68 @param name variable name |
67 @param name variable name |
69 @type str |
68 @type str |
70 @param path registry path of the variable |
69 @param path registry path of the variable |
71 @type str |
70 @type str |
72 @return value of requested registry variable |
71 @return value of requested registry variable |
73 @rtype any |
72 @rtype Any |
74 """ |
73 """ |
75 try: |
74 try: |
76 registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path) |
75 registryKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, path) |
77 value, _ = winreg.QueryValueEx(registryKey, name) |
76 value, _ = winreg.QueryValueEx(registryKey, name) |
78 winreg.CloseKey(registryKey) |
77 winreg.CloseKey(registryKey) |