Skip to content

Commit c392026

Browse files
authored
2 parents a911f7c + 27a39a6 commit c392026

File tree

16 files changed

+266
-473
lines changed

16 files changed

+266
-473
lines changed

Build.cmd

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ECHO [UTS] indicates which build modes need the tool: unstable, testing, and sta
2626
SET CheckToolInPath.Missing=0
2727
SET CheckToolInPath.Check=0
2828
:check-tools
29-
CALL :list-or-check-tool "svn.exe" "[UTS] Subversion tool"
29+
CALL :list-or-check-tool "git.exe" "[UTS] Git version control tool"
3030
CALL :list-or-check-tool "nuget.exe" "[UTS] .NET package manager tool"
3131
CALL :list-or-check-tool "MSBuild.exe" "[UTS] Microsoft Visual Studio build tool"
3232
CALL :list-or-check-tool "lazbuild.exe" "[UTS] Lazarus compiler"
@@ -70,19 +70,10 @@ IF NOT EXIST "Source\ORTS.sln" (
7070
)
7171

7272
IF "%Mode%" == "Stable" (
73-
CALL :create "Microsoft .NET Framework Redistributable 3.5 SP1"
74-
CALL :create "Microsoft .NET Framework Redistributable 3.5 SP1 download manager"
75-
CALL :create "Microsoft XNA Framework Redistributable 3.1"
76-
IF NOT EXIST "Microsoft .NET Framework Redistributable 3.5 SP1\dotnetfx35.exe" (
77-
>&2 ECHO ERROR: Missing required file for "%Mode%" build: "Microsoft .NET Framework Redistributable 3.5 SP1\dotnetfx35.exe".
78-
EXIT /B 1
79-
)
80-
IF NOT EXIST "Microsoft .NET Framework Redistributable 3.5 SP1 download manager\dotnetfx35setup.exe" (
81-
>&2 ECHO ERROR: Missing required file for "%Mode%" build: "Microsoft .NET Framework Redistributable 3.5 SP1 download manager\dotnetfx35setup.exe".
82-
EXIT /B 1
83-
)
84-
IF NOT EXIST "Microsoft XNA Framework Redistributable 3.1\xnafx31_redist.msi" (
85-
>&2 ECHO ERROR: Missing required file for "%Mode%" build: "Microsoft XNA Framework Redistributable 3.1\xnafx31_redist.msi".
73+
CALL :create ".NET Framework 4.7.2 web installer"
74+
IF NOT EXIST ".NET Framework 4.7.2 web installer\ndp472-kb4054531-web.exe" (
75+
>&2 ECHO ERROR: Missing required file for "%Mode%" build: ".NET Framework 4.7.2 web installer\ndp472-kb4054531-web.exe".
76+
>&2 ECHO "Download from http://go.microsoft.com/fwlink/?LinkId=863262"
8677
EXIT /B 1
8778
)
8879
)
@@ -118,13 +109,12 @@ IF "%ERRORLEVEL%" == "9009" GOTO :error
118109

119110
CALL :copy "Program\RunActivity.exe" "Program\RunActivityLAA.exe" || GOTO :error
120111
editbin /NOLOGO /LARGEADDRESSAWARE "Program\RunActivityLAA.exe" || GOTO :error
121-
copy "Program\RunActivity.exe.config" "Program\RunActivityLAA.exe.config" || GOTO :error
112+
CALL :copy "Program\RunActivity.exe.config" "Program\RunActivityLAA.exe.config" || GOTO :error
122113
ECHO Created large address aware version of RunActivity.exe.
123114

124-
REM Copy the Web content, empty the destination folder first
125-
IF EXIST "Program\Content\Web" RMDIR "Program\Content\Web" /S /Q
126-
IF NOT EXIST "Program\Content\Web" MKDIR "Program\Content\Web"
127-
XCOPY "Source\RunActivity\Viewer3D\WebServices\Web" "Program\Content\Web" /S /Y || GOTO :error
115+
REM Copy the web content
116+
ROBOCOPY /MIR /NJH /NJS "Source\RunActivity\Viewer3D\WebServices\Web" "Program\Content\Web"
117+
IF %ERRORLEVEL% GEQ 8 GOTO :error
128118

129119
REM Copy version number from OpenRails.exe into all other 1st party files
130120
FOR %%F IN ("Program\*.exe", "Program\Orts.*.dll", "Program\Contrib.*.dll", "Program\Tests.dll") DO (
@@ -153,7 +143,9 @@ IF NOT "%Mode%" == "Unstable" (
153143
PUSHD "Source\Documentation\Manual" && CALL make.bat latexpdf && POPD || GOTO :error
154144

155145
REM Copy the documentation.
156-
FOR /R "Source\Documentation" %%F IN (*.pdf *.txt) DO CALL :copy "%%~F" "Program\Documentation\%%~nF.pdf" || GOTO :error
146+
FOR /R "Source\Documentation" %%F IN (*.pdf) DO CALL :copy "%%~F" "Program\Documentation\%%~nF.pdf" || GOTO :error
147+
CALL :create "Program\Documentation\es"
148+
CALL :copy "Source\Documentation\Manual\es\Manual.pdf" "Program\Documentation\es\Manual.pdf" || GOTO :error
157149
ROBOCOPY /MIR /NJH /NJS "Source\Documentation\SampleFiles" "Program\Documentation\SampleFiles"
158150
IF %ERRORLEVEL% GEQ 8 GOTO :error
159151

@@ -166,14 +158,11 @@ IF "%Mode%" == "Stable" (
166158
IF %ERRORLEVEL% GEQ 8 GOTO :error
167159
ROBOCOPY /MIR /NJH /NJS "Program\Documentation" "Open Rails\Documentation"
168160
IF %ERRORLEVEL% GEQ 8 GOTO :error
169-
>"Source\Installer\OpenRails shared\Version.iss" ECHO #define MyAppVersion "%Version%" || GOTO :error
170-
iscc "Source\Installer\OpenRails from download\OpenRails from download.iss" || GOTO :error
171-
iscc "Source\Installer\OpenRails from DVD\OpenRails from DVD.iss" || GOTO :error
172-
CALL :move "Source\Installer\OpenRails from download\Output\OpenRailsTestingSetup.exe" "OpenRails-%Mode%-Setup.exe" || GOTO :error
173-
CALL :move "Source\Installer\OpenRails from DVD\Output\OpenRailsTestingDVDSetup.exe" "OpenRails-%Mode%-DVDSetup.exe" || GOTO :error
161+
>"Source\Installer\Version.iss" ECHO #define MyAppVersion "%Version%" || GOTO :error
162+
iscc "Source\Installer\Installer.iss" || GOTO :error
163+
CALL :move "Source\Installer\Output\OpenRailsSetup.exe" "OpenRails-%Mode%-Setup.exe" || GOTO :error
174164
REM *** Special build step: signs binaries ***
175165
IF NOT "%JENKINS_TOOLS%" == "" CALL "%JENKINS_TOOLS%\sign.cmd" "OpenRails-%Mode%-Setup.exe" || GOTO :error
176-
IF NOT "%JENKINS_TOOLS%" == "" CALL "%JENKINS_TOOLS%\sign.cmd" "OpenRails-%Mode%-DVDSetup.exe" || GOTO :error
177166
)
178167

179168
REM Create binary and source zips.

Source/Installer/Installer.iss

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
;Open Rails installer
2+
;12-Jul-2021
3+
;Chris Jakeman
4+
5+
; Assuming that Build.cmd is run from its directory then, in the same directory, this installer for "stable" requires file:
6+
; ".NET Framework 4.7.2 web installer\ndp472-kb4054531-web.exe"
7+
; which can be downloaded from:
8+
; http://go.microsoft.com/fwlink/?LinkId=863262
9+
; and creates:
10+
; Open Rails/Program/*
11+
; Source/Installer/Output/OpenRailsSetup.exe
12+
; Build.cmd for "stable" will move OpenRailSetup.exe back into .\OpenRails-<mode>-Setup.exe.
13+
14+
#define MyAppName "Open Rails"
15+
#include "Version.iss" ; provides the version number
16+
#define MyAppPublisher "Open Rails Project"
17+
#define MyAppManualName "Open Rails manual"
18+
#define MyAppSourceName "Download Open Rails source code"
19+
#define MyAppBugName "Report a bug in Open Rails"
20+
21+
#define DotNETName "Microsoft .NET Framework 4.7.2"
22+
23+
#define MyAppURL "http://openrails.org" ; Not yet HTTPS
24+
#define MyAppSourceURL "http://openrails.org/download/source/"
25+
#define MyAppSupportURL "https://launchpad.net/or"
26+
27+
#define MyAppExeName "OpenRails.exe"
28+
#define MyAppManual "Documentation\Manual.pdf"
29+
30+
#define MyAppProgPath "..\..\Program"
31+
#define MyAppDocPath "..\..\Program\Documentation"
32+
33+
#define NetRedistPath "..\..\.NET Framework 4.7.2 web installer"
34+
#define NetRedist "NDP472-KB4054531-Web.exe"
35+
36+
[Setup]
37+
; NOTE: The value of AppId uniquely identifies this application.
38+
; Do not use the same AppId value in installers for other applications.
39+
; (To generate a new GUID, use Tools > Generate GUID.)
40+
AppId={{94E15E08-869D-4B69-B8D7-8C82075CB51C} ; Generated for OpenRails pre-v1.0
41+
42+
AppName ={#MyAppName}
43+
AppVersion ={#MyAppVersion}
44+
AppVerName ={#MyAppName} {#MyAppVersion}
45+
AppPublisher ={#MyAppPublisher}
46+
AppPublisherURL ={#MyAppURL}
47+
AppSupportURL ={#MyAppSupportURL}
48+
AppUpdatesURL ={#MyAppURL}
49+
DefaultDirName ={commonpf}\{#MyAppName}
50+
DefaultGroupName={#MyAppName}
51+
AllowNoIcons =yes
52+
LicenseFile ={#MyAppProgPath}\Copying.txt
53+
InfoBeforeFile ={#MyAppProgPath}\Prerequisites.txt
54+
InfoAfterFile ={#MyAppProgPath}\Readme.txt
55+
56+
; Remove the following line to run in administrative install mode (install for all users.)
57+
; PrivilegesRequired=lowest ; Cannot create the directory C:\Program Files\Open Rails
58+
59+
Compression =lzma
60+
SolidCompression=yes
61+
WizardStyle=modern
62+
Uninstallable =yes
63+
UninstallDisplayIcon={app}\{#MyAppExeName}
64+
OutputBaseFilename=OpenRailsSetup
65+
66+
; Windows 7 SP1
67+
MinVersion =6.1sp1
68+
69+
[Languages]
70+
Name: "english"; MessagesFile: "compiler:Default.isl"
71+
Name: "armenian"; MessagesFile: "compiler:Languages\Armenian.isl"
72+
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
73+
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
74+
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
75+
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
76+
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
77+
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
78+
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
79+
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
80+
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
81+
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
82+
Name: "icelandic"; MessagesFile: "compiler:Languages\Icelandic.isl"
83+
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
84+
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
85+
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
86+
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
87+
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
88+
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
89+
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
90+
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
91+
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
92+
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
93+
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
94+
95+
[Tasks]
96+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
97+
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
98+
99+
[Files]
100+
; Don't install these prerequisites until after the licence file has been accepted.
101+
; .NET Framework redistributable
102+
Source: {#NetRedistPath}\{#NetRedist}; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFrameworkNet472; Check: IsNotInstalledFrameworkNet472
103+
104+
; The game itself
105+
; Readme.txt is copied from Source\RunActivity\Readme.txt
106+
Source: {#MyAppProgPath}\*; Excludes: Readme*.txt; DestDir: {app}; Flags: ignoreversion recursesubdirs
107+
Source: ..\..\Program\Readme.txt; DestDir: {app}; Flags: ignoreversion
108+
Source: {#MyAppDocPath}\*; DestDir: {app}\Documentation; Flags: ignoreversion recursesubdirs
109+
110+
[Icons]
111+
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
112+
Name: "{group}\{#MyAppManualName}"; Filename: "{app}\{#MyAppManual}"
113+
Name: "{group}\{#MyAppSourceName}"; Filename: "{#MyAppSourceURL}"
114+
Name: "{group}\{#MyAppBugName}"; Filename: "{#MyAppSupportURL}"
115+
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
116+
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
117+
118+
[Run]
119+
Filename: "{app}\{#MyAppExeName}"; StatusMsg: "Installing Open Rails ..."; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
120+
121+
122+
[Code]
123+
function IsNotInstalledFrameworkNet472: Boolean;
124+
var
125+
data: Cardinal;
126+
StatusText: string;
127+
begin
128+
// Gets left on screen while file is unpacked.
129+
StatusText := WizardForm.StatusLabel.Caption;
130+
WizardForm.StatusLabel.Caption := 'Checking for prerequisite {#DotNETName}...';
131+
Result := true; // Result is a pre-declared return value
132+
if (RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', data)) then begin
133+
// "or" operator doesn't work
134+
if (IntToStr(data) = '461808') then Result := false; // v4.7.2
135+
if (IntToStr(data) = '461814') then Result := false; // v4.7.2
136+
if (IntToStr(data) = '528040') then Result := false; // v4.8
137+
if (IntToStr(data) = '528372') then Result := false; // v4.8
138+
if (IntToStr(data) = '528049') then Result := false; // v4.8
139+
end;
140+
if (Result = true) then
141+
WizardForm.StatusLabel.Caption := 'Installing Open Rails ...';
142+
end;
143+
144+
procedure InstallFrameworkNet472;
145+
var
146+
StatusText: string;
147+
ResultCode: Integer;
148+
begin
149+
StatusText := WizardForm.StatusLabel.Caption;
150+
WizardForm.StatusLabel.Caption := 'Installing {#DotNETName} (takes about 8 mins and downloads 82MB)...';
151+
WizardForm.ProgressGauge.Style := npbstMarquee;
152+
try
153+
begin
154+
// Install the package
155+
if not Exec(ExpandConstant('{tmp}\{#NetRedist}'), ' /q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
156+
begin
157+
// Tell the user why the installation failed
158+
MsgBox('Installing {#DotNETName} failed with code: ' + IntToStr(ResultCode) + '.', mbError, MB_OK);
159+
end;
160+
end;
161+
finally
162+
WizardForm.StatusLabel.Caption := StatusText;
163+
WizardForm.ProgressGauge.Style := npbstNormal;
164+
end;
165+
end;

Source/Installer/OpenRails from DVD/OpenRails from DVD.iss

Lines changed: 0 additions & 31 deletions
This file was deleted.

Source/Installer/OpenRails from download/OpenRails from download.iss

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)