2017-04-10 00:59:23 +00:00
rem set PATH=%PATH%;C:\Program Files (x86)\git\bin;C:\Program Files\git\bin
2015-07-15 03:10:47 +00:00
2015-02-02 23:44:48 +00:00
if " %1 " == " " (
SET NAME = BizHawk.zip
) else (
SET NAME = %1
)
2015-07-15 03:10:47 +00:00
git --version > NUL
@ if errorlevel 1 goto MISSINGGIT
2014-09-24 23:53:13 +00:00
2017-04-10 00:59:23 +00:00
reg query " HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 " /v MSBuildToolsPath > nul 2 >& 1
2015-02-02 23:02:37 +00:00
if ERRORLEVEL 1 goto MISSINGMSBUILD
2017-04-10 00:59:23 +00:00
for /f " skip=2 tokens=2,* " %% A in ( 'reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath' ) do SET MSBUILDDIR = %% B
2015-02-02 23:02:37 +00:00
IF NOT EXIST %MSBUILDDIR% nul goto MISSINGMSBUILD
IF NOT EXIST %MSBUILDDIR% msbuild.exe goto MISSINGMSBUILD
call " %MSBUILDDIR% msbuild.exe " ..\BizHawk.sln /p:Configuration=Release /p:Platform=" x86 " /t:rebuild
2015-02-02 22:07:19 +00:00
2017-02-23 10:51:47 +00:00
@ if errorlevel 1 goto MSBUILDFAILED
2014-07-23 00:31:00 +00:00
rmdir /s /q temp
2015-02-02 23:44:48 +00:00
del /s %NAME%
2013-11-03 14:40:55 +00:00
cd ..\output
2012-10-29 08:37:22 +00:00
rem slimdx has a way of not making it into the output directory, so this is a good time to make sure
2011-06-11 20:01:36 +00:00
copy ..\..\SlimDx.dll
2012-10-29 08:37:22 +00:00
rem at the present we support moving all these dlls into the dll subdirectory
rem that might be troublesome some day..... if it does get troublesome, then we'll have to
rem explicitly list the OK ones here as individual copies. until then....
copy *.dll dll
2015-12-10 12:57:02 +00:00
rem Now, we're about to zip and then unzip. Why, you ask? Because that's just the way this evolved.
2016-05-29 14:50:16 +00:00
..\dist\zip.exe -X -r ..\Dist\%NAME% EmuHawk.exe DiscoHawk.exe defctrl.json dll shaders gamedb Tools NES\Palettes Lua Gameboy\Palettes -x *.pdb -x *.lib -x *.pgd -x *.ipdb -x *.iobj -x *.exp -x dll\libsneshawk-64*.exe -x *.ilk -x dll\gpgx.elf -x dll\miniclient.*
2014-07-23 00:31:00 +00:00
cd ..\Dist
2015-02-02 23:44:48 +00:00
.\unzip.exe %NAME% -d temp
del %NAME%
2014-07-23 00:31:00 +00:00
2015-12-10 12:57:02 +00:00
rem Remove things we can't allow the user's junky files to pollute the dist with. We'll export fresh copies from git
2014-07-23 00:31:00 +00:00
rmdir /s /q temp\lua
2015-07-15 03:10:47 +00:00
rmdir /s /q temp\firmware
2015-12-10 12:57:02 +00:00
rmdir /s /q gitsucks
2016-10-26 17:50:37 +00:00
git --git-dir ../.git archive --format zip --output lua.zip HEAD Assets/Lua
git --git-dir ../.git archive --format zip --output firmware.zip HEAD output/Firmware
2015-12-20 17:13:32 +00:00
rem Getting externaltools example from my repo
rem I once talked about a dedicated repo for external tools, think about moving the exemple to it it it happend
git clone https://github.com/Hathor86/HelloWorld_BizHawkTool.git
git --git-dir HelloWorld_BizHawkTool/.git archive --format zip --output HelloWorld_BizHawkTool.zip master
rmdir /s /q HelloWorld_BizHawkTool
2015-07-15 03:10:47 +00:00
unzip lua.zip -d gitsucks
rem del lua.zip
2016-09-01 18:22:57 +00:00
move gitsucks\Assets\Lua temp
2015-07-15 03:10:47 +00:00
unzip Firmware.zip -d gitsucks
rem del firmware.zip
move gitsucks\output\Firmware temp
rmdir /s /q gitsucks
rem remove UPX from any files we have checked in, because people's lousy security software hates it
2016-03-24 21:42:33 +00:00
rem: wait, why did I comment this out? did it have to do with CGC not roundtripping de-UPXing? then we should just not UPX it in the first place (but it's big)
upx -d temp\dll\*.dll
upx -d temp\dll\*.exe
upx -d temp\*.exe
2016-02-02 23:48:02 +00:00
2016-11-13 00:27:39 +00:00
rem dont need docs xml for assemblies and whatnot
del temp\dll\*.xml
2016-02-02 23:48:02 +00:00
cd temp
2015-12-10 12:57:02 +00:00
rem Patch up working dir with a few other things we want
mkdir ExternalTools
copy ..\HelloWorld_BizHawkTool.dll ExternalTools
2015-12-20 17:13:32 +00:00
copy ..\HelloWorld_BizHawkTool.zip ExternalTools
2016-03-24 21:42:33 +00:00
mkdir Firmware
2015-12-10 12:57:02 +00:00
2016-11-13 00:27:39 +00:00
rem compress nescart 7z
cd gamedb
..\..\7za a -t7z -mx9 NesCarts.7z NesCarts.xml
del NesCarts.xml
cd ..
2015-12-10 12:57:02 +00:00
rem Build the final zip
2015-02-02 23:44:48 +00:00
..\zip.exe -X -9 -r ..\%NAME% . -i \*
2014-07-23 00:31:00 +00:00
cd ..
2015-12-10 12:57:02 +00:00
rem DONE!
2014-07-23 00:31:00 +00:00
rmdir /s /q temp
2014-09-24 23:53:13 +00:00
goto END
2015-02-02 23:02:37 +00:00
: MISSINGMSBUILD
@ echo Missing msbuild.exe. can't make distro without that.
goto END
2017-02-23 10:51:47 +00:00
: MSBUILDFAILED
@ echo msbuild failed. Usual cause: user committed broken code.
goto END
2015-07-15 03:10:47 +00:00
: MISSINGGIT
@ echo missing git.exe. can't make distro without that.
2015-02-02 23:44:48 +00:00
: END
2017-02-23 10:51:47 +00:00