@@ -83,8 +83,9 @@ FOR /F "usebackq tokens=1* delims==" %%A IN (`CALL GetVersion.cmd %Mode%`) DO SE
8383REM Restore NuGet packages.
8484nuget restore Source\ORTS.sln || GOTO :error
8585
86- REM Recreate Program directory for output.
86+ REM Recreate Program directory for output and delete previous build files .
8787CALL :recreate " Program" || GOTO :error
88+ CALL :delete " OpenRails-%Mode% *" || GOTO :error
8889
8990REM Build main program.
9091REM Disable warning CS1591 "Missing XML comment for publicly visible type or member".
@@ -126,11 +127,14 @@ IF NOT "%Mode%" == "Unstable" (
126127 NET stop ClickToRunSvc
127128 NET start ClickToRunSvc
128129
129- REM Recreate Documentation folder for output.
130- CALL :recreate " Program\Documentation" || GOTO :error
130+ REM Create the documentation folders for output.
131+ CALL :create " Program\Documentation" || GOTO :error
132+ CALL :create " Program\Documentation\Online" || GOTO :error
133+ CALL :create " Program\Documentation\es" || GOTO :error
131134
132135 REM Compile the documentation.
133136 FOR %%E IN (doc docx docm xls xlsx xlsm odt) DO FOR %%F IN (" Source\Documentation\*.%%E " ) DO ECHO %%~F && OfficeToPDF.exe /bookmarks /print " %%~F " " Program\Documentation\%%~nF .pdf" || GOTO :error
137+ FOR %%E IN (doc docx docm xls xlsx xlsm odt) DO FOR %%F IN (" Source\Documentation\Online\*.%%E " ) DO ECHO %%~F && OfficeToPDF.exe /bookmarks /print " %%~F " " Program\Documentation\Online\%%~nF .pdf" || GOTO :error
134138 > " Source\Documentation\Manual\version.py" ECHO version = '%OpenRails_Version% ' || GOTO :error
135139 >> " Source\Documentation\Manual\version.py" ECHO release = '%OpenRails_Revision% ' || GOTO :error
136140 PUSHD " Source\Documentation\Manual" && CALL make.bat clean & POPD || GOTO :error
@@ -139,13 +143,13 @@ IF NOT "%Mode%" == "Unstable" (
139143 REM Copy the documentation.
140144 FOR %%F IN (" Source\Documentation\*.pdf" ) DO CALL :copy " %%~F " " Program\Documentation\%%~nF .pdf" || GOTO :error
141145 CALL :copy " Source\Documentation\Manual\_build\latex\Manual.pdf" " Program\Documentation\Manual.pdf" || GOTO :error
142- CALL :create " Program\Documentation\es"
143146 CALL :copy " Source\Documentation\Manual\es\Manual.pdf" " Program\Documentation\es\Manual.pdf" || GOTO :error
144147 ROBOCOPY /MIR /NJH /NJS " Source\Documentation\SampleFiles" " Program\Documentation\SampleFiles"
145148 IF %ERRORLEVEL% GEQ 8 GOTO :error
146149
147150 REM Copy the documentation separately.
148151 FOR %%F IN (" Program\Documentation\*.pdf" ) DO CALL :copy " %%~F " " OpenRails-%Mode% -%%~nxF " || GOTO :error
152+ FOR %%F IN (" Program\Documentation\Online\*.pdf" ) DO CALL :copy " %%~F " " OpenRails-%Mode% -%%~nxF " || GOTO :error
149153)
150154
151155IF " %Mode% " == " Stable" (
@@ -161,8 +165,7 @@ IF "%Mode%" == "Stable" (
161165)
162166
163167REM Create binary and source zips.
164- CALL :delete " OpenRails-%Mode% *.zip" || GOTO :error
165- PUSHD " Program" && 7za.exe a -r -tzip -x^^! *.xml " ..\OpenRails-%Mode% .zip" . && POPD || GOTO :error
168+ PUSHD " Program" && 7za.exe a -r -tzip -x^^! *.xml -x^^! Online " ..\OpenRails-%Mode% .zip" . && POPD || GOTO :error
1661697za.exe a -r -tzip -x^^! .* -x^^! obj -x^^! lib -x^^! _build -x^^! *.bak " OpenRails-%Mode% -Source.zip" " Source" || GOTO :error
167170
168171ENDLOCAL
0 commit comments