How to build EventGhost from source code

Tutorials & Guides
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 3113
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

How to build EventGhost from source code

Post by kgschlosser » Sun Nov 27, 2016 6:45 am

Tutorial on how to build EventGhost from source code without using VirtualEnv in 10 Steps


There are not going to be any pictures in this. and it is not really that difficult. I have made a python code file you can run that will install the majority of the modules required to be able to build EG from source code.

The directions are laid out in a specific order and should be followed in that order.. You will have to go into you already installed programs and check and see if you have any of the bits needed and you can skip that step unless told to do otherwise. there are links to various pieces needed that are not python modules and are actual independent pieces of software and they have to be downloaded and installed.

Step 1:

You will only have to do this step if you have had or currently have any Python Interpreter installed.

Uninstall any version of python you have installed. and also remove any left overs from the uninstalls. specifically directories and any environment variables. the environment variables can be accessed by going into your start menu and right clicking on "My Computer" and in the context menu that appears then click on properties. this will bring up the System Properties dialog. You can also access this dialog via Control Panel/System, you want to specifically go into the variable for "path" or "PATH" and edit it.. read through the line of directories. they are seperated by a ";" semicolon. if you have an entry that is pointing to a version of pythin that has now been uninstalled, delete the entry including the trailing semicolon. then you also look for an variable called "PYTHONPATH" and delete that one.

if this is not done it can cause a lot of headaches further down the road. this is due to the "flavor" of python that EventGhost uses.

Step 2:

Install the "Stackless" flavor of python 2.7 x32

i am going to be referencing the directory for stackless as c:\Python but if you install it into a different directory make note and change out my reference for the directory you installed it in

there is no re4al special instructions on the install. except the one above,

Link to download Stackless Python
http://www.stackless.com/binaries/pytho ... ckless.msi

Step 3:

In this step you will want to go into you installed program list and make not of any Visual C++ programs installed. you will not have to download and install one that is listed here if you already have it. unless you have an older version of it. You should upgrade any/all of them to the latest versions. the link below are direct links to Microsoft to download the redistributable versions of the Visual C++ Redists. not web installers.
both x86 and x64 links are here. me personally i just went ahead and downloaded them all and installed them all because at some point or another somehting is going to use it and have to install it anyway so may as well get it all done since the links are here. I do not know which ones are specifically used.

all the visual crap below is because python relies very heavily on c++ well specifically python wx (this is what makes all the menus and graphics) for python to compile the c++ code it uses the visual crap below.

I installed the x86 and x64 of each one. if you have a 32 bit version of windows then you will only be able to use the x32 (i think :shock:)
all the visual c++ redists

2015
https://download.microsoft.com/download ... st.x86.exe
https://download.microsoft.com/download ... st.x64.exe

2013
http://download.microsoft.com/download/ ... st_x86.exe
http://download.microsoft.com/download/ ... st_x64.exe

2012
http://download.microsoft.com/download/ ... st_x86.exe
http://download.microsoft.com/download/ ... st_x64.exe

2010
http://download.microsoft.com/download/ ... st_x86.exe
http://download.microsoft.com/download/ ... st_x64.exe

2008
http://download.microsoft.com/download/ ... st_x86.exe
http://download.microsoft.com/download/ ... st_x64.exe

2005
http://download.microsoft.com/download/ ... st_x86.exe
http://download.microsoft.com/download/ ... st_x64.exe

Step 4:
Install Microsoft Visual Studio 2015 Community Edition
This is free as well. but it does require that you have a Microsoft account. and account is any of the e-mail providers that microsoft offers. or office 360 basically anything that you use to login to anything of Microsoft's that is online. Hotmail, Outlook, Live, MSN

Visual studio 2015
https://www.visualstudio.com/post-downl ... 9&telem=ga

Step 5:

as stated before because of the heavy use of c++ code you need to add a python compiler to Visual Studio

Visual c++ compiler package for python 2.7
https://www.microsoft.com/en-us/downloa ... x?id=44266

Step 6:
InnoSetup

Innosetup is used during the build process for what i cannot remember. but i believe it has something to do with making the installer for EG
http://www.jrsoftware.org/download.php/is.exe?site=1


Step 7:
HTML Help Workshop

well this should be pretty self explanatory. this makes all the help files for EventGhost

https://www.microsoft.com/en-us/downloa ... x?id=21138

and that concludes the executable installs


Step 8:
now you will want to go back into your system settings, environment variables

under system variables

add variable = PYTHONPATH, value = C:\Python\;C:\Python\Lib\
and add to your Path C:\Python\;C:\Python\Scripts\;

the first variable is so it knows where to look for installed libraries
the second is so you can run python and it's scripts from a command prompt without the long CLI expressions

Step 9:
and now the packages.

attached to this forum post is a zip file you will need to download and extract

I have made this really nice handy dandy package installer. and it comes pre-bundled with all of the packages that are needed to build EG. all you need do is decompress to your desktop go into the Modules Install folder left click on some white space off the file side of the split window deselecting anything that is selected then hold down the left shift key and right click and in the context menu select open command window here.

the command prompt should indicate you are in the Module Install directory
then key in

python EGModules.py

and let er rip
that will install everything else that is required for EG to build properly. and it could take a little bit to do depending on your computer

and that is everything you will need to be able to build EG except for the source code without VirtualEnv.


Step 10:
Now i am going to tell you 2 ways. this is due to the way the builder has been made.

Way 1:
If you go to the EventGhost GitHub page and simply download the code as a zip and decompress it. you can build EG this way. but you will not be able to build the installer. EG will run after you build it. but you will not have the ability to "install" it onto a different computer. Now you can simply zip up the build version and copy and past it and unzip it. and it will run.

Way 2:
create a Github account and "fork" EG from the EventGhost Github. this will create a copy of EventEhost on your github account. if you now go into your github settings and on the very bottom left you will see "Personal access tokens", you need to create one. I would name it EventGhost. but name it whatever you want. This token will only be displayed one time. so copy and paste it to a text file and save it somewhere.

You will also need to download the github desktop software and have it download the fork of EG to your local computer
once you have that done you need to open a command prompt where that download is located (this is called a repository)

once you have that command prompt open

key this in replacing the YOURUSERNAMEHERE with the username that you used to sign up for the github account
and press enter

git config --global user.name YOURUSERNAMEHERE

then you will need to get that access token handy and key this in replacing the ENTERYOURTOKENHERE with your access token.

git config --global user.token ENTERYOURTOKENHERE

the purpose for this is so that the builder can access your EventGhost Github fork for some information it uses during the building of the changelog and other various pieces


once you have done either of the 2 steps above. go to your local EventGhost repository. you will want to open a Command Prompt in the _build directory

and key this in

python build.py

and away it goes.

just remember that you will not be able to build the Setup (installer) or the change log if you did not go by route of Way 2

if you did go by route of Way 2 and you did build the installer. it will create the installer in the _build/output folder

one of the features that is built into EG is that it will use any modules that you have installed into your Python Interpreter. so if there is something specific that you require it can be done. I would recommend using something like PyCharm as it is an easy to use Python IDE but also has a feature to list available modules you can download and install in a nice easy to use point and click interface.

if there is something that is not correct or some step i have forgotten please let me know.


and do remember the attached file
Attachments
Modules Install.zip
(26.09 MiB) Downloaded 85 times
If you like the work I have been doing then feel free to Image

eirik226
Experienced User
Posts: 134
Joined: Wed Nov 07, 2012 5:22 pm

Re: How to build EventGhost from source code

Post by eirik226 » Sun Nov 27, 2016 12:29 pm

kgschlosser wrote:Tutorial on how to build EventGhost from source code without using VirtualEnv in 10 Steps
Sorry if this is mentioned, but what do you gain by doing this?

User avatar
kgschlosser
Site Admin
Posts: 3113
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: How to build EventGhost from source code

Post by kgschlosser » Wed Nov 30, 2016 12:39 pm

gain?

EventGhost is an open source project. I am not trying to gain anything.

Well.... maybe someone interested in learning and might become an asset to the project in the future.

Or maybe someone that knows how to code in python and will appreciate having the process outlined and not having to dig through the code to figure it out (like i did) and might decide to help out

Or maybe just because there is no documentation on it. And it should be documented.


I have a question for you......

Why would your question to me be under the assumption that I am benefiting from providing this information??? :shock:
If you like the work I have been doing then feel free to Image

eirik226
Experienced User
Posts: 134
Joined: Wed Nov 07, 2012 5:22 pm

Re: How to build EventGhost from source code

Post by eirik226 » Wed Nov 30, 2016 4:01 pm

kgschlosser wrote:gain?

EventGhost is an open source project. I am not trying to gain anything.

Well.... maybe someone interested in learning and might become an asset to the project in the future.

Or maybe someone that knows how to code in python and will appreciate having the process outlined and not having to dig through the code to figure it out (like i did) and might decide to help out

Or maybe just because there is no documentation on it. And it should be documented.


I have a question for you......

Why would your question to me be under the assumption that I am benefiting from providing this information??? :shock:
Well i'm sorry - a language barrier hit here. I did not mean gain the way you understood the question :P

I was wondering why would I do this, build eventghost from source code? Like what would it do? Whats the difference between this and installing normal.

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: How to build EventGhost from source code

Post by krambriw » Wed Nov 30, 2016 7:01 pm

I think it is great that this has been outlined and documented. Even though not every developer will do it, it is good practice to document the process. Personally, I will most likely not build myself since I have not that deep knowledge in EG inner secrets. But it is good and appreciated that this now is described.

Kind regards, Walter

User avatar
kgschlosser
Site Admin
Posts: 3113
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: How to build EventGhost from source code

Post by kgschlosser » Tue Dec 06, 2016 7:07 am

if you build for source you do not have to wait until an official release of EG is made. so you will get the most up to date with all the bug fixes and modifications as soon as they are released.

and if you do elect to build from source you have to understand that there may be modifications or upgrades that have not been completely bug tested. it is impossible to try and duplicate every single possible setup. and if you report the issue then the powers that be will be able to correct it. before it gets released. which is a HUGE help. so the more people that know how to would make the project move along
If you like the work I have been doing then feel free to Image

pearbear
Experienced User
Posts: 150
Joined: Mon Apr 02, 2012 10:28 pm
Contact:

Re: How to build EventGhost from source code

Post by pearbear » Mon Dec 12, 2016 4:14 am

kgschlosser wrote: git config --global user.name YOURUSERNAMEHERE

then you will need to get that access token handy and key this in replacing the ENTERYOURTOKENHERE with your access token.

git config --global user.token ENTERYOURTOKENHERE
I think this should be github.user and github.token instead of user.name and user.token.
From https://github.com/EventGhost/EventGhos ... #L114-L117:

Code: Select all

                "WARNING: To change version or release to GitHub, you must:\n"
                "    $ git config --global github.user <your github username>\n"
                "    $ git config --global github.token <your github token>\n"
                "To create a token, go to: https://github.com/settings/tokens\n"

User avatar
kgschlosser
Site Admin
Posts: 3113
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: How to build EventGhost from source code

Post by kgschlosser » Mon Dec 12, 2016 6:03 am

You could be correct I would have to test it. I just had to do those commands recently and j do not recallg typing in git.user. or you could give it a test. And i think I had to make sure I was in the root of the repo before keying the command.
If you like the work I have been doing then feel free to Image

Post Reply