Wątek: Building Elten client from code - step by step tutorial
Wróć do listy wątków1 z 1
1 z 3: pajper
Dear Users!
In this tutorial, I would like to explain how to get Elten running from source code.
I strongly encourage you to make such an attempt - programmers to ask for help, but also other more technical users - just to try. Or maybe you will discover that you have a flair for it? Or just out of curiosity you will see what it looks like?
I tried to write everything in the simplest possible language, so please do not be afraid of the post length. It is due to the fact that I tried to explain every single step.
I have a big request that people who manage to run Elten from the code boast about it in this thread. We'll see if I explained everything correctly.
Thank you very much in advance!
Table of Contents
1. Installing Ruby.
2. Installing Visual Studio.
3. Installing Git.
4. Initializing the Elten repository.
5. Building and running code.
6. Code modification.
7. Updating the code.
8. A word at the end.
1. Installing Ruby.
Installing Ruby is an almost typical process, you only need to check the configuration and version number. At the time of writing this article, Elten uses Ruby 2.7 and no older or newer versions will work, the number after 2.7 does not count for that, i.e. 2.7.0, 2.7.1, 2.7.2 and the following will be supported versions, but 2.6.3 or 2.8.0 will not.
Elten is a 32-bit application, so Ruby 32-bit will be required.
So go to the Ruby installer for Windows page
https://rubyinstaller.org/downloads/
and select the latest version from branch 2.7 in the 32-bit version, this is important, which includes devkit, which is under the heading "With devkit". At the time of writing this article, it is the Ruby + Devkit 2.7.2-1 (x86) version.
During installation, after accepting the license, select the following options: "Add Ruby executables to your PATH", "Use UTF-8 as default external encoding.". The "Associate .rb and .rbw files with this Ruby installation" option is not required, but I personally recommend checking it as well.
In the next window, select the following components: "Ruby {version number} base files", and "MSYS2 development toolchain {version number}". The third option is documentation, the installation of which is optional, although if you want to get to know Ruby, it certainly won't hurt.
After the installation is completed, select the "Run 'ridk install' to set up MSYS2 and development toolchain." Check box. and select "Finish".
A console window will appear which will throw out a lot of text, and at the bottom there will be the information "Which components shall be installed? If unsure press ENTER [1,3]". In Elten's case, there's nothing to change here, so just hit enter. At this point, the preparation of the Ruby development platform will begin, no interaction will be necessary here. When the process is finished, "Which components shall be installed? If unsure press ENTER []" appears at the bottom once more. Hit enter again and the window will disappear.
Ruby has been installed.
You can verify the installation by opening the console, for example by pressing WINDOWS + R, typing "cmd" and pressing enter. In the console type "ruby -v", for which you should get an output similar to this:
"ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [i386-mingw32]".
Ruby is installed and running, we are ready to install Visual Studio.
2. Installing Visual Studio.
Visual Studio can be downloaded here
https://visualstudio.microsoft.com/en/downloads/
For Elten's needs, the basic version is more than enough, so you can select the link "Download Visual Studio Community 2019 for free" under the heading "Community" and run the downloaded file.
After initializing the installation, which will take a while, you will get a huge list of packages that we can add. Depending on what we want to do, it is worth selecting various packages, I will list here only those necessary for Elten's development.
In the "Work packages" tab, in the "Computers and mobile devices" section, select the "Desktop development with C++" option.
Then tab to the "Installation Details" section, where you'll find an entry that NVDA will read as "Desktop development with C++, Collapsed". Expand it with a right arrow and check in it: "MSVC v142 - VS 2019 C++ x64/x86 build tools version {latest available, currently 14.27}", "Windows 10 SDK 10.0.18362.0", "C++ CMake tools for Windows ", "C++ ATL for v142 build tools (x86 & x64)", and" C++ Clang tools for Windows".
If you are not going to build anything else, my advice is to remove other packages (packages, not individual components).
Installing Visual Studio will definitely take a while, especially if your internet is slower.
3. Installing the git.
Git for Windows can be downloaded here.
https://git-scm.com/download/win
Select the "Click here to download manually" link, the correct version for your computer should be downloaded automatically, it will probably be a 64-bit version. During installation, you will be asked to choose a few parameters, below are my suggestions and a short explanatory note:
A. Which editor would you like Git to use?
Use the Nano editor by default
The proposed Vim is a great editor, but it is not at all simple and about its use (completely different from what Windows users are used to) I could write 10 times longer tutorial than this one.
B. What would you like Git to name the initial branch after "git init"?
Let Git decide
It's such a minor setting, a branch name, that I don't really know why Git allows it to be selected during installation.
C. How would you like to use Git from the command line?
Git from the command line and also from 3rd-party software
If you don't want to integrate all of bash and I don't feel like you do, this is the best option.
The third option, "Use git from git bash only" is not recommended by me, it complicates everything.
D. Which SSL / TLS library would you like Git to use for HTTPS connections?
Use the OpenSSL library
OpenSSL is much better than native Windows SSL.
E. How should Git treat line endings in text files?
Checkout Windows-style, commit Unix-style line endings
If you are using Notepad ++ or VS Code, you can easily select "Checkout as-is, commit Unix-style line endings" here, but as this is also a tutorial for novice programmers, the recommended option will allow you to edit files from a Windows notepad .
F. Which terminal emulator do you want to use with your Git Bash?
Use Windows' default console window
Very important setting!
Git proposes MinTTY by default, which has accessibility issues with NVDA.
G. What should `git pull` do by default?
Default (fast-forward or merge)
If you don't know what it is, feel free to leave it at the default, and if you do, you know your preferences anyway.
This is the principle of merging branches when updating the repository.
H. Which credential helper should be configured?
Git Credential Manager Core
But the version without Core is ok too, basically I have been using Core myself very recently and haven't noticed any significant differences.
I. Which features would you like to enable?
Both, ie "Enable file system caching" and "Enable symbolic links".
J. Which bleeding-edge features would you like to enable?
Please uncheck the "Enable experimental support for pseudo consoles." checkbox, has problems working with NVDA.
After the installation is complete, you can check that everything is working by running the console as described in the first section and typing "git --version". Sample output - "git version 2.29.1.windows.1".
Whew, everything is ready, we can proceed.
4. Initializing the Elten repository.
Please start the console. I recommend that you press WINDOWS + R and enter "cmd" in the opened window, confirm with enter.
In the console you should navigate to the folder where you want to put Elten's code, for example, if you want to put it in documents, just type
cd% userprofile% \ documents
and if on the C drive in the Codes folder
cd c: \ codes
Then type the following command, which will download the Elten code to disk
git clone https://github.com/dawidpieper/elten2.git
After completing the operation, enter the downloaded repository
cd elten2
and initialize the submodules, i.e. the libraries used by Elten
git submodule update --init
This process will take a while. After its completion, you only need to generate the key of this application, it is used to identify the version on the server. To do this, just type the "rake key" command.
If everything went well, you'll hear "New app key generated.".
5. Building and running code.
To build the Elten code, just enter the command "rake". The first time, a bunch of different packages for Ruby will be downloaded. It should look something like this
"
Signature generated.
Using Visual Studio Community 2019
Library compiled.
RGSS data saved.
http-2 not found, trying to install
Fetching http-2-0.10.2.gem
Successfully installed http-2-0.10.2
Parsing documentation for http-2-0.10.2
Installing ri documentation for http-2-0.10.2
Done installing documentation for http-2 after 1 seconds
1 gem installed
Data saved agent.
Gettext not found, trying to install
Fetching locale-2.1.3.gem
Fetching gettext-3.3.6.gem
Fetching text-1.3.1.gem
Successfully installed locale-2.1.3
Successfully installed text-1.3.1
Successfully installed gettext-3.3.6
Parsing documentation for locale-2.1.3
Installing ri documentation for locale-2.1.3
Parsing documentation for text-1.3.1
Installingri documentation for text-1.3.1
Parsing documentation for gettext-3.3.6
Installing ri documentation for gettext-3.3.6
Done installing documentation for locale, text, gettext after 2 seconds
3 gems installed
Locale files compiled.
rubyzip not found, trying to install
Fetching rubyzip-2.3.0.gem
Successfully installed rubyzip-2.3.0
Parsing documentation for rubyzip-2.3.0
Installing ri documentation for rubyzip-2.3.0
Done installing documentation for rubyzip after 1 seconds
1 gem installed
NVDA addon packed.
Elten build completed.
"
After the build of Elten is finished, you can finally try to run it from sources after all these operations. To do this, enter "rake run".
6. Code modification.
If you decide to change something in the code, you may not need to do anything and just type "rake run" to run the changed version. This includes changing any files in the "src" folder.
However, if you changed the agent code in the "agent" folder or, even more so, the translation files or C++ code, you will have to issue the command "rake buildall".
7. Updating the code.
When a new version of Elten is released, luckily you don't have to repeat these steps to get the code. Just in the console, in the folder with the code, give three commands, these are "git pull", "git submodule update --remote" and "rake buildall".
They will automatically update the code from the server, download new versions of libraries and recompile components. Just enough.
8. A word at the end.
In this tutorial, I have covered how to download and run the Elten code. I am aware of the fact that it all looks like a complicated process, but I am sure that after reading the content thoroughly, everything will be explained.
Thank you very much to everyone who made it all the way here!
In case of problems or questions, feel free to write in this thread!
#StandWithUkraine
Shoot for the Moon. Even if you miss, you'll land among the stars.
31.10.2020 21:11
2 z 3: bomberman29
hello! how to compile ios version!
my github: https://github.com/denizsincar29
16.06.2021 11:57
3 z 3: JamesPotter
LoadError: cannot load such file -- zstd-ruby
Tasks: TOP => agent
<internal:C:/Ruby31/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
09.04.2022 23:21