forked from OpenRCE/paimei
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__install_requirements.py
144 lines (118 loc) · 4.01 KB
/
__install_requirements.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!c:\python\python.exe
# $Id: __install_requirements.py 194 2007-04-05 15:31:53Z cameron $
import urllib
import os
import shutil
# globals.
downloaded = 0
########################################################################################################################
def urllib_hook (idx, slice, total):
global downloaded
downloaded += slice
completed = int(float(downloaded) / float(total) * 100)
if completed > 100:
completed = 100
print "\tdownloading ... %d%%\r" % completed,
def get_it (url, file_name):
global downloaded
downloaded = 0
u = urllib.urlretrieve(url, reporthook=urllib_hook)
print
shutil.move(u[0], file_name)
os.system("start " + file_name)
########################################################################################################################
try:
print "looking for ctypes ...",
import ctypes
print "FOUND"
except:
print "NOT FOUND"
choice = raw_input("\tWant me to get it? ").lower()
if choice.startswith("y"):
get_it("http://superb-east.dl.sourceforge.net/sourceforge/ctypes/ctypes-0.9.9.6.win32-py2.4.exe", "installers/ctypes-0.9.9.6.win32-py2.4.exe")
try:
print "looking for pydot ...",
import pydot
print "FOUND"
except:
print "NOT FOUND"
try:
print "looking for wxPython ...",
import wx
print "FOUND"
except:
print "NOT FOUND"
choice = raw_input("\tWant me to get it? ").lower()
if choice.startswith("y"):
get_it("http://umn.dl.sourceforge.net/sourceforge/wxpython/wxPython2.6-win32-ansi-2.6.3.2-py24.exe", "installers/wxPython2.6-win32-ansi-2.6.3.2-py24.exe")
try:
print "looking for MySQLdb ...",
import MySQLdb
print "FOUND"
except:
print "NOT FOUND"
choice = raw_input("\tWant me to get it? ").lower()
if choice.startswith("y"):
get_it("http://superb-east.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python.exe-1.2.1_p2.win32-py2.4.exe", "installers/MySQL-python.exe-1.2.1_p2.win32-py2.4.exe")
try:
print "looking for GraphViz in default directory ...",
fh = open("c:\\program files\\graphviz")
close(fh)
except IOError, e:
if e.errno == 2:
print "NOT FOUND"
else:
print "FOUND"
try:
print "looking for Oreas GDE in default directory ...",
fh = open("c:\\program files\\govisual diagram editor")
close(fh)
except IOError, e:
if e.errno == 2:
print "NOT FOUND"
choice = raw_input("\tWant me to get it? ").lower()
if choice.startswith("y"):
get_it("http://www.oreas.com/download/get_gde_win.php", "installers/gde-win.exe")
else:
print "FOUND"
try:
print "looking for uDraw(Graph) in default directory ...",
fh = open("c:\\program files\\udraw(graph)")
close(fh)
except IOError, e:
if e.errno == 2:
print "NOT FOUND"
choice = raw_input("\tWant me to get it? ").lower()
if choice.startswith("y"):
get_it("http://www.informatik.uni-bremen.de/uDrawGraph/download/uDrawGraph-3.1.1-0-win32-en.exe", "installers/uDrawGraph-3.1.1-0-win32-en.exe")
else:
print "FOUND"
try:
print "looking for PaiMei -> PyDbg ...",
import pydbg
print "FOUND"
except:
print "NOT FOUND"
try:
print "looking for PaiMei -> PIDA ...",
import pida
print "FOUND"
except:
print "NOT FOUND"
try:
print "looking for PaiMei -> pGRAPH ...",
import pgraph
print "FOUND"
except:
print "NOT FOUND"
try:
print "looking for PaiMei -> Utilities ...",
import utils
print "FOUND"
except:
print "NOT FOUND"
choice = raw_input("\nInstall PaiMei framework libraries to Python site packages? ").lower()
if choice.startswith("y"):
os.system("start installers/PaiMei-1.1.win32.exe")
print "\nRun __setup_mysql.py to setup database and complete installation. Then run console\PAIMEIconsole.py"
raw_input("\nHit enter to exit installer.")