-
Notifications
You must be signed in to change notification settings - Fork 0
Building an APAF application on Windows
This how-to will guide you in the preparation of build environment for Apaf applications for Windows with all it's own dependencies.
- Windows XP SP3 (or superior)
- Python 2.7+
- Twisted 12.0
- Setuptools 0.6-c11
- Psutils 0.4.1
- Py2exe 0.6.9
- PyWin Build 20217
- 7zip 9.20
- http://downloads.sourceforge.net/sevenzip/7z920.exe
- Gpg 4 win 2.1.1
- http://www.gpg4win.org/download.html
TODO: Hellais to setup
http://files.gpg4win.org/Beta/gpg4win-2.1.1-34299-beta.exe
Launch kleopatra
Settings -> Configure Kleopatra -> New
Lookup on certificates server:
Import key: 0x7D9DC8D2
File -> Decrypt/Verify files -> Find the file of python-2.7.3.msi -> Input file python-2.7.3.msi.asc -> Decrypt/Verify
Download
http://www.python.org/download/releases/2.7.3/
http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi
Verify signature of application:
http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi.asc
Install the software.
http://downloads.sourceforge.net/sevenzip/7z920.exe
This will install 7zip in "C:\Program Files\7-Zip\7z.exe"
http://twistedmatrix.com/trac/
http://pypi.python.org/packages/2.7/T/Twisted/Twisted-12.0.0.win32-py2.7.msi
Now start a cmd and install Zope core dependancy:
C:\Python27\Scripts\easy_install.exe zope.interface
Now start a cmd and install pip:
C:\Python27\Scripts\easy_install.exe pip
Required for txtorconn
http://code.google.com/p/psutil/ http://psutil.googlecode.com/files/psutil-0.4.1.win32-py2.7.exe
Now start a cmd and install PyGeoIP txtorconn's dependancy:
C:\Python27\Scripts\pip.exe install pygeoip
Now start a cmd and install IpAddr txtorconn's dependancy:
C:\Python27\Scripts\pip.exe install ipaddr
http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download
Twisted have a bug that prevent it from working fine with TxTorcon
To fix it, edit the file "C:\Python27\lib\site-packages\twisted\internet\process.py" and comment out the call to the following function:
''- detectLinuxBrokenPipeBehavior()''
''+ # detectLinuxBrokenPipeBehavior()''
https://github.com/meejah/txtorcon/
Download Apaf ZIP archive and extract the file meejah-txtorcon-XXXXX into your working directory: https://github.com/meejah/txtorcon/zipball/master
To install txtorcon use it's setup.py rather than easy_install (there's a bug).
Move on the working directory where it has been downloaded. For example in path "C:\Documents and Settings\VM\Desktop\apaf\meejah-txtorcon-v0[1].1-40-g8132bce\meejah-txtorcon-8132bce" start:
cd "C:\Documents and Settings\VM\Desktop\apaf\meejah-txtorcon-v0[1].1-40-g8132bce\meejah-txtorcon-8132bce"
start now:
c:\Python27\python.exe setup.py install
C:\Documents and Settings\VM\Desktop\apaf\meejah-txtorcon-v0[1].1-40-g8132bce\me
ejah-txtorcon-8132bce>c:\Python27\python.exe setup.py install
Now test that twisted and py2exe can be successfully imported: Start -> All Programs -> Python 2.7 -> Python
import twisted
import py2exe
import psutil
import txtorcon
import ipaddr
import pygeoip
import pywin32
Download Apaf ZIP archive and extract the file mmaker-APAF-XXXXX into your working directory: https://github.com/mmaker/APAF/zipball/master
Enter into the working directory, for example:
cd "C:\Documents and Settings\VM\Desktop\apaf\mmaker-APAF-f059782\mmaker-APAF-f059782"
Download the latest version of Tor binaries for Windows.
Go to download page https://www.torproject.org/download/download.html.en and download "Expert Bundle": https://www.torproject.org/dist/win32/tor-0.2.2.35-win32-1.exe
Now decompress the tor binary with 7zip and move it to contrib/tor/ directory of APAF:
c:\Program Files\7-Zip\7z.exe" x tor-0.2.2.35-win32-1.exe tor.exe
move tor.exe PATH_WHERE_IS_BUILD_ENVIRONMENT/contrib/tor
Then to build the .exe:
C:\Python27\python.exe setup.py py2exe
C:\Documents and Settings\VM\Desktop\apaf\mmaker-APAF-f059782\mmaker-APAF-f059782> dir dist\run.exe
Volume in drive C has no label.
Volume Serial Number is 80B6-BA0E
Directory of C:\Documents and Settings\Administrator\dist
05/18/2012 12:14 AM 19,456 run.exe
Test by loading http://127.0.0.1:4242