Permalink
Browse files

Added installer script and bundle.bat

  • Loading branch information...
1 parent dddba5f commit ead520fdfb4ceafa111830bc1d4aad94a0d4038a @Pjanssen committed Dec 20, 2011
View
@@ -13,7 +13,7 @@ FOR %%C IN %Configs% DO (
FOR %%P IN %Platforms% DO (
ECHO.
ECHO.
- ECHO Building %%C ^| %%P
+ ECHO Building EdgeSmooth %%C ^| %%P
%MSBuild% %Project% /nologo /v:m /p:Configuration=%%C /p:Platform=%%P || goto :error
)
)
@@ -0,0 +1,6 @@
+@ECHO OFF
+
+call build_all.bat
+
+ECHO.
+call bundle.bat
View
@@ -0,0 +1,90 @@
+@ECHO OFF
+
+SET dir=%~dp0
+SET buildDir=%dir%build\
+SET targetDir=%dir%temp\
+SET output=%buildDir%edgesmooth.mzp
+SET exclude_file=tmp_exclude.txt
+
+
+ECHO Checking bundle prerequisites...
+CALL :GetZip zip
+dir "%zip%" > nul || goto :ZipNotFoundError
+
+ECHO Checking build directory...
+dir "%buildDir%" > nul || goto :buildNotFoundError
+
+
+ECHO.
+ECHO Removing old target files and directory...
+
+::Remove target dir if it exists
+IF EXIST %targetDir% (
+ rmdir /Q /S %targetDir% || goto :error
+ ECHO Removed %targetDir%
+)
+
+::Remove output file if it exists
+IF EXIST %output% ( del /Q /S %output% || goto :error )
+
+
+::Copy the installer dir to a temporary directory.
+ECHO.
+ECHO Copying installer to temporary directory...
+ECHO ._ >> %exclude_file%
+ECHO .DS_Store >> %exclude_file%
+ECHO .mzp >> %exclude_file%
+
+xcopy %dir%installer %targetDir% /e /q /EXCLUDE:%exclude_file% || goto :xcopyError
+
+::Copy plugin to temporary directory.
+ECHO.
+ECHO Copying plugin to temporary directory...
+xcopy %buildDir%* %targetDir%plugin\ /e /q /EXCLUDE:%exclude_file% || goto :xcopyError
+
+del %exclude_file%
+
+::Create package from target dir
+ECHO.
+ECHO Packing mzp...
+"%zip%" a -tzip %output% %targetDir%* || goto :error
+
+
+
+::Remove target dir
+rmdir /Q /S %targetDir% || goto :error
+ECHO Removed %targetDir%
+
+
+ECHO Done.
+goto :eof
+
+
+
+:GetZip
+SET KEY_NAME=HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip
+SET KEY_VALUE=Path
+
+FOR /F "tokens=2*" %%A IN ('REG QUERY "%KEY_NAME%" /v %KEY_VALUE% 2^>nul') DO (
+ set %~1=%%B7z.exe
+)
+goto :eof
+
+
+:ZipNotFoundError
+ECHO Could not find 7z.exe.
+goto :error
+
+:buildNotFoundError
+ECHO Use build_all.bat or build_and_bundle.bat first.
+goto :error
+
+:xcopyError
+del %exclude_file%
+goto :error
+
+:error
+ECHO.
+ECHO Bundling failed.
+PAUSE
+EXIT /B %ERRORLEVEL%
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit ead520f

Please sign in to comment.