Skip to content

Commit 986b997

Browse files
author
Chris Jakeman
committed
installing VS and Demo Model 1
1 parent aa9c76b commit 986b997

24 files changed

+141
-0
lines changed

Docs/Building.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Building Open Rails
2+
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+
21+
22+
## Overview
23+
24+
To work with the code, you will need an installation of Microsoft Visual Studio and also content that is standalone (doesn't rely on sharing files from 3rd parties).
25+
26+
Visual Studio provides the Git tools to clone the Open Rails repository and submit your changes as a pull request.
27+
28+
Any new features will also require matching changes to the Open Rails Manual, so a Docker container is provided that works with Visual Studio Code to build the manual in either HTML or PDF.
29+
30+
## Windows
31+
32+
Use any Windows from version 7 with Service Pack 1 upwards. Open Rails can also be developed on a virtual machine.
33+
34+
## Visual Studio
35+
36+
![](images/downloading_visual_studio_installer.png)
37+
38+
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.)
40+
41+
![](images/authorising_visual_studio_installer.png)
42+
43+
![](images/prompt_from_visual_studio_installer.png)
44+
45+
### VS Installation
46+
47+
![](images/configure_visual_studio_installer.png)
48+
49+
The only "workload" needed is .NET desktop development. Some optional tools which may be useful are also checked.
50+
51+
![](images/run_visual_studio_installer.png)
52+
53+
![](images/sign_in_to_microsoft.png)
54+
55+
You don't have to create an Microsoft account for 2019, but there is little downside.
56+
57+
![](images/start_visual_studio.png)
58+
59+
### Open Rails Repository
60+
61+
![](images/cloning_repo.png)
62+
63+
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)
65+
66+
![](images/downloading_repo.png)
67+
68+
![](images/orts_solution.png)
69+
70+
On completion, the Solution Explorer view will list the solution ORTS.sln. Pick it to receive a prompt:
71+
72+
![](images/framework_not_installed.png)
73+
74+
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.
75+
76+
However the framework needed to build that project is not installed automatically, so choose the option highlighted in the image above.
77+
78+
![](images/open_rails_projects.png)
79+
80+
Finally we get to see a list of the projects in the Open Rails solution.
81+
82+
Note: There is no project called OpenRails. Instead, the Launcher project builds an executable called OpenRails.exe.
83+
84+
## Compiling
85+
86+
![](images/build_projects.png)
87+
88+
Use Build > Rebuild Solution to compile and link the source code into executable and DLL files.
89+
90+
![](images/successful_build.png)
91+
92+
Initially, your local repository contrains an empty folder Programs. The executable files just created are saved in this folder.
93+
94+
## Executing
95+
96+
![](images/executable_files.png)
97+
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.
99+
100+
![](images/startup_project.png)
101+
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.
103+
104+
![](images/debug_project.png)
105+
106+
Now pressing F5, Start or Debug > Start Debugging will launch the project Menu.exe in debugging mode.
107+
108+
## Content
109+
110+
Without content, all you can run is Menu.exe (or OpenRails.exe which runs Menu.exe) and some of the contributed tools.
111+
112+
![](images/menu_option_content.png)
113+
114+
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.
116+
117+
![](images/unzip_demo_model_1.png)
118+
119+
Unzip into a new folder.
120+
121+
![](images/add_demo_model_1.png)
122+
123+
Start Open Rails Menu.exe, and use Options > Content > Add to add the folder "Demo Model 1" to the list of installation profiles.
124+
125+
![](images/installation_profiles.png)
126+
127+
Select Demo model 1 as the Installation profile.
128+
129+
![](images/start_activity.png)
130+
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.
132+
133+
![](images/copy_arguments.png)
134+
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.
136+
137+
![](images/launching_runactivity.png)
138+
139+
## Installing Tools for Open Rails Manual
140+
141+
## Submitting Changes

Docs/images/add_demo_model_1.png

41.4 KB
Loading
29.6 KB
Loading

Docs/images/cloning_repo.png

67.1 KB
Loading
122 KB
Loading

Docs/images/copy_arguments.png

22.7 KB
Loading

Docs/images/debug_project.png

32.3 KB
Loading

Docs/images/downloading_repo.png

12.5 KB
Loading
100 KB
Loading

Docs/images/executable_files.png

40.3 KB
Loading

0 commit comments

Comments
 (0)