forked from EdgeBotix/SOAR-Source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupsoar.py
41 lines (34 loc) · 1.31 KB
/
setupsoar.py
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
#!/usr/bin/python
from sys import argv
import os.path
from distutils import sysconfig
def getProgramsMenuPath():
"""getProgramsMenuPath() -> String|None
@return the filesystem location of the common Start Menu.
"""
try:
return get_special_folder_path("CSIDL_COMMON_PROGRAMS")
except OSError: # probably Win98
return get_special_folder_path("CSIDL_PROGRAMS")
if argv[1] == '-install':
try:
print "Installing shortcut"
exec_dir=sysconfig.get_config_var("exec_prefix")
print "Python in "+exec_dir
menu_path=getProgramsMenuPath()
print "Programs menu in "+menu_path
#soar_shortcut_path="SoaR.lnk"
soar_shortcut_path=os.path.join(menu_path, "soar.lnk")
print "soar shortcut installing to "+soar_shortcut_path
soar_shortcut_path=os.path.join(menu_path, "soar.lnk")
create_shortcut(os.path.join(exec_dir, "pythonw.exe"),
"soar",
soar_shortcut_path,
'-Qnew -c "import form.main;import soar;\
import soar.application;form.main.Application(\
soar.application.application)"')
print "Done"
except:
print sys.exc_info()
else:
print "This script is designed to be run from the Windows installer."