\documentclass[a4paper, 11pt]{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{a4wide}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{color}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{ulem}
\usepackage{listings}
\usepackage{float}
\usepackage[rflt]{floatflt}
\usepackage{tabularx}
\setlength{\parindent}{0pt}
\title{Install Lazarus &amp; Free Pascal From Source Batch-File}
\usepackage[
pdftitle={Install Lazarus &amp; Free Pascal From Source Batch-File}
pdfsubject={This Batch-File does anything for you to get Lazarus and Free Pascal from SVN-Source and compile it, only SilkSvn must be installed and you have to change the path in Line 6 of the Batch-File.}
pdfauthor={Udo Schmal}
pdfkeywords={Lazarus, SVN}
]{hyperref}
\definecolor{darkblue}{rgb}{0,0,.5}
\hypersetup{pdftex=true, colorlinks=true, breaklinks=true, linkcolor=darkblue, menucolor=darkblue, pagecolor=darkblue, urlcolor=darkblue}
\begin{document}Install Lazarus \&amp; Free Pascal From Source Batch-File
\singlespacing
{\LARGE \textbf{\label{sec:title}Lazarus \&amp; Free Pascal}}

\singlespacing
{\large \textbf{\label{sec:subtitle}Install From Source Batch-File}}

This Batch-File does anything for you to get Lazarus and Free Pascal from SVN-Source and compile it, only SilkSvn must be installed and you have to change the path in Line 6 of the Batch-File. You can take this Batch-File for updates too.

To get a large Win32 development environment with Win64- and linux- Cross-compiler and some additional packages you have only to start the following Batch-File. If you want only a Win32 development environment without any additional packages you call the Batch-File with parameter \&quot;min\&quot;!
\begin{lstlisting}[breaklines]\newline
@echo off\newline
echo Install/Update Lazarus\newline
cd \textbackslash\newline
set THUMBDRIVE=\%CD:\textasciitilde0,2\%\newline
set fpcVersion=2.5.1\newline
set silkSvn=\%THUMBDRIVE\%\textbackslashSlikSvn\newline
set svnPath=\%silkSvn\%\textbackslashbin\newline
if not exist \%silkSvn\%\textbackslashNUL (\newline
  md \%silkSvn\% \newline
  echo be shure you have downloaded SilkSvn from http://www.sliksvn.com/en/download to dir \%silkSvn\% pause \newline
)\newline
set PATH=\%svnPath\%;\%PATH\%\newline
set lazPath=\%THUMBDRIVE\%\textbackslashlazarus\newline
if exist \%lazPath\%\textbackslashNUL (\newline
  echo Lazarus svn update, please wait ...\newline
  cd \%lazPath\%\newline
  svn update\newline
) else ( \newline
  echo Lazarus svn checkout, please wait ...\newline
  svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus\newline
) \newline
if \%errorlevel\% NEQ 0 (\newline
  echo be shure you have downloaded SilkSvn from http://www.sliksvn.com/en/download to dir \%silkSvn\%\newline
  pause\newline
  goto Cleanup\newline
) \newline
set lazDataPath=\%lazPath\%\textbackslashAppData\newline
if not exist \%lazDataPath\%\textbackslashNUL\newline
  md \%lazDataPath\%\newline
set fpcPath=\%lazPath\%\textbackslashfpc\newline
if not exist \%fpcPath\%\textbackslashNUL\newline
  md \%fpcPath\%\newline
set fpcVersionPath=\%fpcPath\%\textbackslash\%fpcVersion\%\newline
set fpcBinPath=\%fpcVersionPath\%\textbackslashbin\textbackslashi386-win32\newline
set PATH=\%fpcVersionPath\%;\%lazDataPath\%;\%fpcBinPath\%;\%PATH\%\newline
if exist \%fpcVersionPath\%\textbackslashNUL (\newline
  echo Free Pascal svn update, please wait ...\newline
  cd \%fpcVersionPath\% svn update\newline
) else (\newline
  echo Free Pascal svn checkout, please wait ...\newline
  cd \%fpcPath\%\newline
  svn checkout http://svn.freepascal.org/svn/fpc/trunk \%fpcVersion\% \newline
)\newline
if \%errorlevel\% NEQ 0 goto Cleanup\newline
if not exist \%fpcBinPath\%\textbackslashNUL (\newline
  if not exist \%fpcVersionPath\%\textbackslashbin\textbackslashNUL\newline
    md \%fpcVersionPath\%\textbackslashbin\newline
  cd \%fpcVersionPath\%\textbackslashbin\newline
  echo Free Pascal Build Binarys svn checkout, please wait ...\newline
  svn checkout http://svn.freepascal.org/svn/fpcbuild/binaries/i386-win32 i386-win32\newline
  if \%errorlevel\% NEQ 0 echo SVN checkout failed!\newline
  for /F \&quot;tokens=*\&quot; \%\%G IN ('DIR /B /AD /S \%fpcBinPath\%\textbackslash*.svn*') DO RMDIR /S /Q \&quot;\%\%G\&quot;\newline
  echo Free Pascal Bin Utils svn checkout, please wait ...\newline
  svn checkout http://svn.freepascal.org/svn/fpcbuild/branches/fixes\_2\_4/install/binw32 i386-win32\newline
  if \%errorlevel\% NEQ 0\newline
    echo SVN checkout failed! \newline
  for /F \&quot;tokens=*\&quot; \%\%G IN ('DIR /B /AD /S \%fpcBinPath\%\textbackslash*.svn*') DO RMDIR /S /Q \&quot;\%\%G\&quot;\newline
  echo get ppc386-win32.zip \newline
  cd \%fpcBinPath\% \newline
  goto ppc386 \newline
:ppcunzip \newline
  unzip ppc386-win32.zip \newline
  del ppc386-win32.zip\newline
)\newline
if \&quot;\%1\&quot;==\&quot;min\&quot; goto noPackages \newline
if exist \%fpcPath\%\textbackslashfpcprojects\textbackslashNUL (\newline
  echo Free Pascal Projects svn update, please wait ...\newline
  cd \%fpcPath\%\textbackslashfpcprojects svn update\newline
) else ( \newline
  echo Free Pascal Projects svn checkout, please wait ...\newline
  cd \%fpcPath\%\newline
  svn checkout http://svn.freepascal.org/svn/fpcprojects fpcprojects \newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
if exist \%fpcPath\%\textbackslashfpcdocs\textbackslashNUL (\newline
  echo Free Pascal Docs svn update, please wait ...\newline
  cd \%fpcPath\%\textbackslashfpcdocs svn update\newline
) else (\newline
  echo Free Pascal Docs svn checkout, please wait ...\newline
  cd \%fpcPath\% svn checkout http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
if exist \%lazPath\%\textbackslashlazarus-ccr\textbackslashNUL (\newline
  echo Lazarus-CCR svn update, please wait ... \newline
  cd \%lazPath\%\textbackslashlazarus-ccr svn update\newline
) else (\newline
  echo Lazarus-CCR svn checkout, please wait ...\newline
  cd \%lazPath\% svn checkout http://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr lazarus-ccr\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
set packagesPath=\%lazPath\%\textbackslashpackages\newline
if not exist \%lazPath\%\textbackslashpackages\textbackslashNUL\newline
  md \%packagesPath\%\newline
if exist \%packagesPath\%\textbackslashlazupdater\textbackslashNUL (\newline
  echo Lazarus Updater svn update, please wait ...\newline
  cd \%packagesPath\%\textbackslashlazupdater svn update\newline
) else (\newline
  echo Lazarus Updater svn checkout, please wait ...\newline
  cd \%packagesPath\% \newline
  svn checkout http://svn.lazarusforum.de/svn/lazupdater/trunk lazupdater\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
if exist \%packagesPath\%\textbackslashlnet\textbackslashNUL (\newline
  echo lnet svn update, please wait ...\newline
  cd \%packagesPath\%\textbackslashlnet svn update\newline
) else (\newline
  echo lnet svn checkout, please wait ...\newline
  cd \%packagesPath\%\newline
  svn checkout http://svn.freepascal.org/svn/fpcprojects/lnet/trunk lnet\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
if exist \%packagesPath\%\textbackslashpowtils\textbackslashNUL (\newline
  echo Lazarus Powtils svn update, please wait ...\newline
  cd \%packagesPath\%\textbackslashpowtils svn update\newline
) else ( \newline
  echo Lazarus Powtils svn update, please wait ...\newline
  cd \%packagesPath\% svn checkout http://powtils.googlecode.com/svn powtils\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
if exist \%packagesPath\%\textbackslashIndy\textbackslashNUL (\newline
  echo Indy svn update, please wait ...\newline
  cd \%packagesPath\%\textbackslashIndy \newline
  svn update\newline
) else (\newline
  echo Indy svn checkout, please wait ...\newline
  cd \%packagesPath\% svn checkout https://svn.atozed.com:444/svn/Indy10/trunk Indy --username Indy-Public-RO\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
if exist \%packagesPath\%\textbackslashJedi\_jcl\textbackslashNUL (\newline
  echo Jedi JCL svn update, please wait ...\newline
  cd \%packagesPath\%\textbackslashJedi\_jcl\newline
  svn update\newline
) else (\newline
  echo Jedi JCL svn checkout, please wait ...\newline
  cd \%packagesPath\%\newline
  svn checkout http://jcl.svn.sourceforge.net/svnroot/jcl/trunk/jcl Jedi\_jcl \newline
)\newline
if \%errorlevel\% NEQ 0 \newline
  echo SVN update/checkout failed!\newline
if exist \%packagesPath\%\textbackslashJedi\_jvcl\textbackslashNUL (\newline
  echo Jedi JVCL svn update, please wait ...\newline
  cd \%packagesPath\%\textbackslashJedi\_jvcl\newline
  svn update\newline
) else (\newline
  echo Jedi JVCL svn checkout, please wait ...\newline
  cd \%packagesPath\%\newline
  svn checkout http://jvcl.svn.sourceforge.net/svnroot/jvcl/trunk/jvcl Jedi\_jvcl\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
if exist \%packagesPath\%\textbackslashOverbyteIcs\textbackslashNUL (\newline
  echo Overbyte ICS svn update, please wait ...\newline
  cd \%packagesPath\%\textbackslashOverbyteIcs\newline
  svn update\newline
) else (\newline
  echo Overbyte ICS svn checkout, please wait ...\newline
  cd \%packagesPath\%\newline
  svn checkout http://svn.overbyte.be:8443/svn/ics/branches/icsv7/Delphi/Vc32 OverbyteIcs --username ics --password ics\newline
)\newline
if \%errorlevel\% NEQ 0 echo SVN update/checkout failed!\newline
:noPackages\newline
  echo install fpc i386-win32, please wait ...\newline
  cd \%fpcVersionPath\%\newline
  if exist \%fpcBinPath\%\textbackslashfpc.exe (\newline
    set compiler=fpc.exe\newline
  ) else (\newline
    set compiler=ppc386.exe\newline
  )\newline
  make clean all install OS\_TARGET=win32 CPU\_TARGET=i386 INSTALL\_PREFIX=\%fpcVersionPath\% PP=\%compiler\% \&gt; NUL \newline
  if not exist \%fpcBinPath\%\textbackslashfpc.cfg (\newline
    echo create fpc.cfg\newline
    cd \%fpcBinPath\%\newline
    fpcmkcfg -d basepath=\%fpcVersionPath\% -o fpc.cfg\newline
  ) cd \%fpcVersionPath\%\newline
  if \&quot;\%1\&quot;==\&quot;min\&quot; goto noFpcCross\newline
  echo crossinstall fpc x86\_64-win64, please wait ...\newline
  make clean all crossinstall OS\_TARGET=win64 CPU\_TARGET=x86\_64 INSTALL\_PREFIX=\%fpcVersionPath\% PP=fpc.exe \&gt; NUL\newline
  echo crossinstall fpc i386-linux, please wait ...\newline
  make clean all crossinstall OS\_TARGET=linux CPU\_TARGET=i386 INSTALL\_PREFIX=\%fpcVersionPath\% PP=fpc.exe \&gt; NUL\newline
:noFpcCross echo cleanup, please wait ...\newline
  make clean \&gt; NUL FOR /F \&quot;tokens=*\&quot; \%\%G IN ('DIR /B /AD /S \%fpcVersionPath\%\textbackslashexamples\textbackslash*.svn*') DO RMDIR /S /Q \&quot;\%\%G\&quot;\newline
  echo install lazarus win32, please wait ...\newline
  cd \%lazPath\%\newline
  make clean all OPT=\&quot;-glw2\&quot; \&gt; NUL\newline
  echo make lcl / ide win32, please wait ...\newline
  make lazbuilder OPT=\&quot;-Xs -XX\&quot; PP=fpc.exe \&gt; NUL\newline
  if \&quot;\%1\&quot;==\&quot;min\&quot; goto noLazCross \newline
  echo make lcl win64, please wait ...\newline
  make lcl OPT=\&quot;-Xs -XX\&quot; LCL\_PLATFORM=win32 PP=fpc.exe CPU\_TARGET=x86\_64 OS\_TARGET=win64 \&gt; NUL\newline
  make lcl OPT=\&quot;-Xs -XX\&quot; LCL\_PLATFORM=nogui PP=fpc.exe CPU\_TARGET=x86\_64 OS\_TARGET=win64 \&gt; NUL\newline
  echo make lcl linux, please wait ... \newline
  rem make lcl OPT=\&quot;-Xs -XX\&quot; LCL\_PLATFORM=gtk2 PP=fpc.exe CPU\_TARGET=i386 OS\_TARGET=linux \&gt; NUL\newline
  make lcl OPT=\&quot;-Xs -XX\&quot; LCL\_PLATFORM=nogui PP=fpc.exe CPU\_TARGET=i386 OS\_TARGET=linux \&gt; NUL\newline
:noLazCross\newline
  echo build ide\newline
  if exist lazarus.exe (\newline
    if exist lazarus.old.exe (\newline
      del lazarus.old.exe\newline
    )\newline
    ren lazarus.exe lazarus.old.exe\newline
  )\newline
  lazbuild -B --primary-config-path=\%lazDataPath\% --build-ide= \&gt; NUL\newline
  ren lazarus.new.exe lazarus.exe\newline
  echo strip and upx, please wait ...\newline
  strip --strip-all lazarus.exe \&gt; NUL\newline
  upx lazarus.exe \&gt; NUL\newline
  strip --strip-all startlazarus.exe \&gt; NUL\newline
  upx startlazarus.exe \&gt; NUL\newline
  strip --strip-all lazbuild.exe \&gt; NUL\newline
  upx lazbuild.exe \&gt; NUL\newline
  echo make lazarus examples, please wait ...\newline
  cd \%lazPath\%\textbackslashexamples\newline
  make \&gt; NUL goto Exit\newline
:Cleanup\newline
  echo.\newline
  echo Something went wrong, trying to fix any problems if possible ...\newline
  svn cleanup\newline
  if \%errorlevel\% NEQ 0 (\newline
    cd ..\newline
    echo. \newline
    echo Cleanup Failed ! Please check or delete/move/rename the subdirectory ...\newline
    FOR /F \&quot;tokens=*\&quot; \%\%G IN ('DIR /B /AD /S \%fpcVersionPath\%\textbackslashexamples\textbackslash*.svn*') DO RMDIR /S /Q \&quot;\%\%G\&quot;\newline
    goto Exit \newline
  )\newline
  cd \textbackslash echo.\newline
  echo Cleanup complete please run the script again.\newline
:Exit\newline
  echo ---- ENDE ---- \newline
  pause exit /b \newline
:ppc386 \newline
  ftp -i -s:\&quot;\%\textasciitildef0\&quot;\&amp;goto:ppcunzip\newline
  open ftp.freepascal.org anonymous password \newline
  cd pub/fpc/dist/2.4.0/bootstrap binary\newline
  mget ppc386-win32.zip\newline
  disconnect bye\end{lstlisting}
\end{document}