@echo off
set CompileScriptDebug=false
set FrmwrkPath=%windir%\Microsoft.NET\Framework\v2.0.50727\
if /i "%1" == "/?" goto Help
if /i "%1" == "/help" goto Help
if /i "%1" == "/debug" goto SetDebug
if /i "%1" == "/frmwrkpath" goto SetFrmwrkPath
if /i "%1" == "/sourcepath" goto SetSourcePath
if /i "%1" == "/queue" goto SetQueue
if /i "%1" == "/uninstall" goto SetUninstall
echo Nomad.NET assembly accelerator
echo By default this script generates native images for the Nomad.NET assemblies and its dependencies and installs them in the Native Images Cache.
echo You can optionally provide the following additional parameters:
echo./? or /Help This message
echo /Debug DEBUG: messages shown
echo /FrmwrkPath Explicitly specify Microsoft.NET Framework version by path
echo /SourcePath Explicitly specifiy source path rather than runtime path
echo /Queue Compilation job is queued up for deferred processing
echo /Uninstall Delete the native images of the Nomad.NET assemblies and
echo dependencies from the Native Images Cache.
set CompileScriptDebug=true
if %CompileScriptDebug% == true echo DEBUG: messages enabled...
if %CompileScriptDebug% == true echo DEBUG: Framework Path: %FrmwrkPath%
if %CompileScriptDebug% == true echo DEBUG: Source Path: %SourcePath%
if %CompileScriptDebug% == true echo DEBUG: NGen Parameters: %NGenParams%
set Ngen=%FrmwrkPath%ngen.exe
%Ngen% %mode% %sourcepath%Nomad.exe %NGenParams%
if not %errorlevel% == 0 goto Error
%Ngen% %mode% %sourcepath%Nomad.XmlSerializers.dll /ExeConfig:%sourcepath%Nomad.exe %NGenParams%
if not %errorlevel% == 0 goto Error
%Ngen% %mode% %sourcepath%CmdProxy.exe %NGenParams%
if not %errorlevel% == 0 goto Error
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto 64-bit
if not %errorlevel% == 0 goto Error
if %CompileScriptDebug% == true echo DEBUG: 64-bit Architecture detected!
%Ngen% %mode% %sourcepath%Nomad_x86.exe %NGenParams%
if not %errorlevel% == 0 goto Error
echo.Nomad assembly %mode% complete.