forked from robotframework/RIDE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ride_postinstall.py
31 lines (25 loc) · 1.03 KB
/
ride_postinstall.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
import sys
from os.path import exists, join
from Tkinter import Tk
from tkMessageBox import askyesno
def verify_install():
try:
import wxversion
except ImportError:
print "No wxPython installation detected!"
print ""
print "Please ensure that you have wxPython installed before running RIDE."
print "You can obtain wxPython 2.8.12.1 from http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/"
else:
print "Installation successful."
def create_desktop_shortcut():
Tk().withdraw()
link = join(get_special_folder_path("CSIDL_DESKTOPDIRECTORY"), 'RIDE.lnk')
icon = join(sys.prefix, 'Lib', 'site-packages', 'robotide', 'widgets', 'robot.ico')
if exists(link) or askyesno('Setup', 'Create desktop shortcut?'):
create_shortcut('pythonw', "Robot Framework testdata editor", link,
'-c "from robotide import main; main()"', '', icon)
file_created(link)
if sys.argv[1] == '-install':
verify_install()
create_desktop_shortcut()