Skip to content

Commit e08c088

Browse files
author
Chris Jakeman
committed
installing tools for Manual
1 parent 986b997 commit e08c088

19 files changed

+122
-36
lines changed

Docs/Building.md

Lines changed: 122 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
# Building Open Rails
22

3-
This document will take you through the steps needed to build Open Rails from the source code and to run and start debugging it.
4-
5-
Line ending in two spaces.
6-
7-
dummy line
8-
9-
Line ending in br.<br/>
10-
11-
dummy line
12-
13-
Line ending in pspace/p.<p>&nbsp;</p>
14-
15-
dummy line
16-
17-
Line ending in p/p.<p></p>
18-
19-
dummy line
20-
3+
This document (Feb 2022) will take you through the steps needed to build Open Rails from the source code and to run and start debugging it.
214

225
## Overview
236

@@ -29,30 +12,30 @@ Any new features will also require matching changes to the Open Rails Manual, so
2912

3013
## Windows
3114

32-
Use any Windows from version 7 with Service Pack 1 upwards. Open Rails can also be developed on a virtual machine.
15+
64-bit Windows from version 7 with Service Pack 1 upwards. Open Rails can also be developed on a virtual machine. If you want to use 32-bit Windows, then Visual Studio Code will not be available to you for editing the manual, so please ask for help on [the Elvas Tower forum]([http://www.elvastower.com/forums/).
3316

3417
## Visual Studio
3518

3619
![](images/downloading_visual_studio_installer.png)
3720

3821
Download and install Visual Studio 2019 Community Edition from Microsoft.
39-
(Other editions will work but this one is free. Version 2022 will also work, but this is reported as significantly slower. Version 2017 is not recommended as in Feb 2022 we are moving towards .Net 5 which is incompatible.)
22+
(Other editions will work but this one is free. Version 2022 will also work, but this is reported as significantly slower. Version 2017 is not recommended as in Feb 2022 we are moving towards .Net 5 which is incompatible.)<p>&nbsp;</p>
4023

4124
![](images/authorising_visual_studio_installer.png)
4225

43-
![](images/prompt_from_visual_studio_installer.png)
26+
![](images/prompt_from_visual_studio_installer.png)<br />
4427

4528
### VS Installation
4629

4730
![](images/configure_visual_studio_installer.png)
4831

49-
The only "workload" needed is .NET desktop development. Some optional tools which may be useful are also checked.
32+
The only "workload" needed is .NET desktop development. Some optional tools which may be useful are also checked.<p>&nbsp;</p>
5033

5134
![](images/run_visual_studio_installer.png)
5235

5336
![](images/sign_in_to_microsoft.png)
5437

55-
You don't have to create an Microsoft account for 2019, but there is little downside.
38+
You don't have to create an Microsoft account for 2019, but there is little downside.<p>&nbsp;</p>
5639

5740
![](images/start_visual_studio.png)
5841

@@ -61,7 +44,7 @@ You don't have to create an Microsoft account for 2019, but there is little down
6144
![](images/cloning_repo.png)
6245

6346
You will be prompted to "Get started" and should "Clone a repository" from
64-
[https://github.com/openrails/openrails.git](https://github.com/openrails/openrails.git)
47+
[https://github.com/openrails/openrails.git](https://github.com/openrails/openrails.git) <p>&nbsp;</p>
6548

6649
![](images/downloading_repo.png)
6750

@@ -73,7 +56,7 @@ On completion, the Solution Explorer view will list the solution ORTS.sln. Pick
7356

7457
The purpose of the Launcher project is to check whether the user's PC has the software libraries installed to run Open Rails. It uses libraries which are installed on even old PCs, so that it can run on them without error and report any problems.
7558

76-
However the framework needed to build that project is not installed automatically, so choose the option highlighted in the image above.
59+
However the framework needed to build that project is not installed automatically, so choose the option highlighted in the image above. <p>&nbsp;</p>
7760

7861
![](images/open_rails_projects.png)
7962

@@ -85,7 +68,7 @@ Note: There is no project called OpenRails. Instead, the Launcher project builds
8568

8669
![](images/build_projects.png)
8770

88-
Use Build > Rebuild Solution to compile and link the source code into executable and DLL files.
71+
Use *Build > Rebuild Solution* to compile and link the source code into executable and DLL files.
8972

9073
![](images/successful_build.png)
9174

@@ -95,47 +78,150 @@ Initially, your local repository contrains an empty folder Programs. The executa
9578

9679
![](images/executable_files.png)
9780

98-
At this point you can switch to the Windows File Explorer or the command line and run OpenRails.exe. This will carry out some checks and then run Menu.exe.
81+
At this point you can switch to the Windows File Explorer or the command line and run OpenRails.exe. This will carry out some checks and then run Menu.exe.<p>&nbsp;</p>
9982

10083
![](images/startup_project.png)
10184

102-
When debugging, it will be easier to start the program from within Visual Studio. First, set the desired project to be the Startup Project which will run when you press Debug > Start Debugging.
85+
When debugging, it will be easier to start the program from within Visual Studio. First, set the desired project to be the Startup Project which will run when you press *Debug > Start Debugging*.<p>&nbsp;</p>
10386

10487
![](images/debug_project.png)
10588

106-
Now pressing F5, Start or Debug > Start Debugging will launch the project Menu.exe in debugging mode.
89+
Now pressing F5, Start or *Debug > Start Debugging* will launch the project Menu.exe in debugging mode.
10790

10891
## Content
10992

110-
Without content, all you can run is Menu.exe (or OpenRails.exe which runs Menu.exe) and some of the contributed tools.
93+
Without content, all you can run is Menu.exe (or OpenRails.exe which runs Menu.exe) and some of the contributed tools.<p>&nbsp;</p>
11194

11295
![](images/menu_option_content.png)
11396

11497
The easiest content to install is [Demo Model 1](http://openrails.org/download/content/).
115-
Another recommendation is the [test track from Coals To Newcastle](9https://www.coalstonewcastle.com.au/physics/route/) as its small size makes it quick to load and it is designed for testing.
98+
Another recommendation is the [test track from Coals To Newcastle](9https://www.coalstonewcastle.com.au/physics/route/) as its small size makes it quick to load and it is designed for testing.<p>&nbsp;</p>
11699

117100
![](images/unzip_demo_model_1.png)
118101

119-
Unzip into a new folder.
102+
Unzip into a new folder.<p>&nbsp;</p>
120103

121104
![](images/add_demo_model_1.png)
122105

123-
Start Open Rails Menu.exe, and use Options > Content > Add to add the folder "Demo Model 1" to the list of installation profiles.
106+
Start Open Rails Menu.exe, and use *Options > Content > Add* to add the folder "Demo Model 1" to the list of installation profiles.<p>&nbsp;</p>
124107

125108
![](images/installation_profiles.png)
126109

127110
Select Demo model 1 as the Installation profile.
128111

129112
![](images/start_activity.png)
130113

131-
Pressing Start will run the simulation program RunActivity.exe. You can also run this from the command line by providing appropriate arguments. If you hold down the Alt key while pressing the Start button, these arguments are copied into the Windows paste buffer.
114+
Pressing Start will run the simulation program RunActivity.exe. You can also run this from the command line by providing appropriate arguments. If you hold down the Alt key while pressing the Start button, these arguments are copied into the Windows paste buffer.<p>&nbsp;</p>
132115

133116
![](images/copy_arguments.png)
134117

135-
From Visual Studio, using Project > Properties > Debug > Command line arguments, these arguments can be pasted into the RunActivity project. If this is the set to be the Startup Project for the solution, pressing F5 will launch RunActivity.exe on the selected activity with debugging in place.
118+
From Visual Studio, using *Project > Properties > Debug > Command line arguments*, these arguments can be pasted into the RunActivity project. If this is the set to be the Startup Project for the solution, pressing F5 will launch RunActivity.exe on the selected activity with debugging in place.<p>&nbsp;</p>
136119

137120
![](images/launching_runactivity.png)
138121

139122
## Installing Tools for Open Rails Manual
140123

141-
## Submitting Changes
124+
Note: This section is based on this [Pull Request](https://github.com/openrails/openrails/pull/557)
125+
There are several components to install but after that producing a revised manual is just a click away.
126+
127+
### Install Visual Studio Code
128+
129+
This interactive development environment (IDE) is unrelated to the Visual Studio IDE. The Open Rails manual is written in [ReStructuredText](https://docutils.sourceforge.io/rst.html) which is processed into a [multi-page HTML document](https://open-rails.readthedocs.io/en/latest/) or a [single-page PDF document](http://openrails.org/files/OpenRails-Testing-Manual.pdfvmw).
130+
131+
### Download and install Visual Code
132+
133+
Download from [Download Visual Studio Code - Mac, Linux, Windows](https://code.visualstudio.com/download) and run the installer.
134+
135+
### Add Extension - Remote Containers
136+
137+
![](images/add_vs_extension.png)
138+
139+
Use the icon to add a new extension.
140+
141+
![](images/search_for_remote_containers.png)
142+
143+
Search for the extension "Remote Containers".
144+
145+
![](images/install_remote_containers.png)
146+
147+
And install it into Visual Studio Code.
148+
149+
### Download and install Docker Desktop
150+
151+
![](images/download_docker_desktop.png)
152+
153+
Download from [https://docs.docker.com/desktop/windows/install/](https://docs.docker.com/desktop/windows/install/) and run the installer.
154+
155+
Docker provides a closed environment so that our script to build the manual can be run knowing that it will not be broken by any subsequent changes on the PC.
156+
157+
![](images/settings_for_docker_desktop.png)
158+
159+
Use the default settings.
160+
161+
![](images/progress_for_docker_desktop.png)
162+
163+
Installation takes a few minutes.
164+
165+
You will be prompted to close and restart your PC.
166+
167+
![](images/wsl2_for_docker_desktop.png)
168+
169+
You may receive a prompt to install WSL 2 separately. Click the link.
170+
171+
![](images/enable_virtual_machine.png)
172+
173+
The link takes you to Step 3 and 4.
174+
175+
![](images/run_powershell.png)
176+
177+
Run PowerShell as Administrator.
178+
179+
![](images/enable_virtual_machine_feature.png)
180+
181+
Enter the command provided.
182+
183+
![](images/download_wsl_2.png)
184+
185+
Return to the webpage for Step 4 and download WSL 2 and install it.
186+
187+
![](images/install_wsl_2.png)
188+
189+
Once this is installed, return to the Docker Desktop prompt and press Restart.
190+
191+
![](images/restart_docker_desktop.png)
192+
193+
This re-starts Docker Desktop, not your PC.
194+
195+
Now that Docker Desktop is running, start Visual Studio Code.
196+
197+
![](images/find_vsc_commands.png)
198+
199+
Press F1 to find the command list and search for Remote Containers: Open Folder in Container...
200+
201+
![](images/find_manual_folder.png)
202+
203+
Using Windows File Explorer, search your repository for Source\Documentation\Manual
204+
205+
![](images/manual_file_list.png)
206+
207+
All the manual files will be listed.
208+
209+
![](images/build_html_manual.png)
210+
211+
To build the manual, enter a command in the Terminal pane of Visual Studio Code. The default command is "make html" which builds the file Source\Documentation\Manual\_build\html\index.html
212+
213+
![](images/html_manual.png)
214+
215+
There is a shortcut for this command: Ctrl+Shift+B.
216+
217+
![](images/pdf_manual.png)
218+
219+
The PDF at Source\Documentation\Manual\_build\latex\Manual.pdf can be built with the command: _make latexpdf_
220+
221+
## Git and Contributing to Open Rails
222+
223+
Open Rails uses Git for source code control. In addition to using Git from the command line, there are many programs that provide a graphical front-end.
224+
225+
Visual Studio 2019 includes facilities for working with Git, see [https://docs.microsoft.com/en-gb/visualstudio/version-control/?view=vs-2019](https://docs.microsoft.com/en-gb/visualstudio/version-control/?view=vs-2019)
226+
227+
For guidance on contributing, see [https://github.com/openrails/openrails/blob/master/Docs/Contributing.md](https://github.com/openrails/openrails/blob/master/Docs/Contributing.md)

Docs/images/add_vs_extension.png

43.4 KB
Loading

Docs/images/build_html_manual.png

211 KB
Loading
101 KB
Loading

Docs/images/download_wsl_2.png

30.2 KB
Loading
62.7 KB
Loading
68.6 KB
Loading

Docs/images/find_manual_folder.png

51.3 KB
Loading

Docs/images/find_vsc_commands.png

152 KB
Loading

Docs/images/html_manual.png

45.1 KB
Loading

0 commit comments

Comments
 (0)