forked from ChristianMeisenbichler/SAXS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinstall.py
More file actions
61 lines (54 loc) · 2 KB
/
Copy pathpostinstall.py
File metadata and controls
61 lines (54 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import sys
import os
desktop = get_special_folder_path("CSIDL_COMMON_DESKTOPDIRECTORY")
startmenu = get_special_folder_path("CSIDL_COMMON_STARTMENU")
pyw_executable = os.path.join(sys.prefix,'pythonw.exe')
script_file = '"'+os.path.join(sys.prefix,"Scripts","leash-script.pyw")+'"'
w_dir = os.path.expanduser('~')
desktop_path = get_special_folder_path("CSIDL_DESKTOPDIRECTORY")
startmenu_path = get_special_folder_path("CSIDL_STARTMENU")
iconpath= os.path.expanduser(
os.path.join(
sys.prefix,
"Lib",
"site-packages",
"SAXS",
"icons",
"program.ico"))
print(sys.argv)
if sys.argv[1] == '-install':
print('Creating Shortcut')
create_shortcut(
pyw_executable,
'SAXSDogLeash',
os.path.join(startmenu_path,'SAXSLeash.lnk'),
script_file,
w_dir,
iconpath,0)
print('Creating Shortcut')
create_shortcut(
pyw_executable,
'SAXSDogLeash',
os.path.join(desktop_path,'SAXSLeash.lnk'),
script_file,
w_dir,
iconpath,0)
import _winreg as wr
wr.SetValue(wr.HKEY_CURRENT_USER,"Software\Classes\TUG.Leash\shell\open\command",wr.REG_SZ,pyw_executable+" \""+ script_file+ "\" \"%1\"")
wr.SetValue( wr.HKEY_CURRENT_USER,"Software\Classes\TUG.Leash\DefaultIcon",wr.REG_SZ,iconpath)
wr.SetValue( wr.HKEY_CURRENT_USER,"Software\Classes\.saxsconf",wr.REG_SZ, "TUG.Leash");
print "Update Registry:"
from subprocess import call
call(["conda","install","--yes","pip"])
call(["pip","install","numpy",
"scipy",
"matplotlib",
"jsonschema",
"bitarray",
"watchdog",
"sphinxcontrib-programoutput",
"sphinxcontrib-programscreenshot",
"pyzmq",
"brewer2mpl","winshell"])
elif sys.argv[1] == '-remove':
pass