@echo off\r
::\r
-:: Prebuild generator for the Radegast Library\r
+:: Prebuild generator for the Radegast\r
::\r
:: Command Line Options:\r
:: (none) - create solution/project files and create compile.bat file to build solution\r
echo Parameters: %1 %2\r
echo ##########################################\r
\r
+if not exist bin mkdir bin\r
+\r
:: run prebuild to generate solution/project files from prebuild.xml configuration file\r
-Radegast\Prebuild.exe /target vs2008\r
+Radegast\prebuild.exe /target vs2008\r
\r
:: build compile.bat file based on command line parameters\r
echo @echo off > compile.bat\r
-if(.%1)==(.) echo C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild Radegast.sln >> compile.bat\r
+if(.%1)==(.) echo %SystemRoot%\Microsoft.NET\Framework\v3.5\msbuild Radegast.sln >> compile.bat\r
\r
if(.%1)==(.msbuild) echo echo ==== COMPILE BEGIN ==== >> compile.bat\r
if(.%1)==(.msbuild) echo %SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe /p:Configuration=Release Radegast.sln >> compile.bat\r
\r
if(.%2)==(.runtests) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat\r
\r
-:: nsis compiler needs to be in path\r
-if(.%3)==(.dist) echo echo ==== GENERATE DISTRIBUTION BEGIN ==== >> compile.bat\r
-if(.%3)==(.dist) echo makensis.exe /DPlatform=test docs\Radegast-installer.nsi >> compile.bat\r
-if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat\r
-if(.%3)==(.dist) echo 7z.exe a -tzip dist\Radegast-dist.zip @docs\distfiles.lst >> compile.bat\r
-if(.%3)==(.dist) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat\r
+if not (.%2)==(.dist) goto NODIST\r
+echo echo ==== GENERATE DISTRIBUTION BEGIN ==== >> compile.bat\r
+copy Radegast\radegast.nsi bin\r
+echo del /q Radegast-*-installer.exe >> compile.bat\r
+echo del /q radegast-latest.zip >> compile.bat\r
+\r
+if not exist "%PROGRAMFILES%\NSIS\Unicode\makensis.exe" goto NOUNINSIS\r
+echo "%PROGRAMFILES%\NSIS\Unicode\makensis.exe" bin\radegast.nsi >> compile.bat\r
+goto NONSIS\r
+:NOUNINSIS\r
+\r
+if not exist "%PROGRAMFILES%\NSIS\makensis.exe" goto NONSIS\r
+echo "%PROGRAMFILES%\NSIS\makensis.exe" bin\radegast.nsi >> compile.bat\r
+:NONSIS\r
+\r
+echo cd bin >> compile.bat\r
+echo 7z.exe a -r -tzip ..\radegast-latest.zip *.* >> compile.bat\r
+echo cd .. >> compile.bat\r
+\r
+:NODIST\r
\r
echo :SUCCESS >> compile.bat\r
echo echo Build Successful! >> compile.bat\r