cd /d "%~dp0"

set ORGAPPVER=2.8.6.2
set APPVER=2.8.6+-jp-2
set SAFEAPPVER=2.8.6-jp-2
rem set APPVER=%ORGAPPVER%+-jp-1
rem set SAFEAPPVER=%ORGAPPVER%-jp-1
set DISTDIR=\Web Page\geocities

copy "Build\WinMerge-%ORGAPPVER%-Setup.exe" "WinMerge-%APPVER%-Setup.exe"
\progra~1\7-zip\7z.exe a -tzip "%DISTDIR%\WinMerge-%SAFEAPPVER%-Setup.exe.zip" "WinMerge-%APPVER%-Setup.exe"

mkdir "%DISTDIR%\2.8-zip-version\WinMerge\" 2> NUL
mkdir "%DISTDIR%\2.8-zip-version\WinMerge\Languages" 2> NUL
mkdir "%DISTDIR%\2.8-zip-version\WinMerge\Filters" 2> NUL
mkdir "%DISTDIR%\2.8-zip-version\WinMerge\MergePlugins" 2> NUL
mkdir "%DISTDIR%\2.8-zip-version\WinMerge\Docs" 2> NUL

rem Readme
copy Docs\Users\*.txt "%DISTDIR%\2.8-zip-version\WinMerge\"
copy Src\COPYING "%DISTDIR%\2.8-zip-version\WinMerge\"

rem Help
copy Build\Manual\htmlhelp\WinMerge.chm "%DISTDIR%\2.8-zip-version\WinMerge\Docs"

rem Excecutables
copy Build\MergeRelease\WinMerge.exe "%DISTDIR%\2.8-zip-version\WinMerge\"
copy Build\MergeUnicodeRelease\WinMergeU.exe "%DISTDIR%\2.8-zip-version\WinMerge\"

rem ShellExtension
copy Build\MergeRelease\ShellExtension.dll "%DISTDIR%\2.8-zip-version\WinMerge\"
copy Build\MergeUnicodeRelease\ShellExtensionU.dll "%DISTDIR%\2.8-zip-version\WinMerge\"
copy Build\ShellExtensionX64\ShellExtensionX64.dll "%DISTDIR%\2.8-zip-version\WinMerge\"
copy ShellExtension\*.bat "%DISTDIR%\2.8-zip-version\WinMerge\"

rem Dlls
copy Build\pcre\pcre.dll "%DISTDIR%\2.8-zip-version\WinMerge\"
copy Build\expat\libexpat.dll "%DISTDIR%\2.8-zip-version\WinMerge\"

rem Translation
copy Build\MergeUnicodeRelease\Languages\Japanese.po "%DISTDIR%\2.8-zip-version\WinMerge\Languages\"
copy Build\MergeUnicodeRelease\MergeLang.dll "%DISTDIR%\2.8-zip-version\WinMerge\"

rem Filters
copy Filters\*.flt "%DISTDIR%\2.8-zip-version\WinMerge\Filters\"
copy Filters\*.tmpl "%DISTDIR%\2.8-zip-version\WinMerge\Filters\"
copy Filters\*.txt "%DISTDIR%\2.8-zip-version\WinMerge\Filters\"

rem Plugins
copy Plugins\dlls\*.dll "%DISTDIR%\2.8-zip-version\WinMerge\MergePlugins\"
copy Plugins\dlls\*.sct "%DISTDIR%\2.8-zip-version\WinMerge\MergePlugins\"
del "%DISTDIR%\2.8-zip-version\WinMerge\MergePlugins\Watch*OfLog.dll"

rem Runtimes
copy Installer\Runtimes\*.dll "%DISTDIR%\2.8-zip-version\WinMerge\"

rem 7zPlugins
copy Build\MergeRelease\Merge7z*.dll "%DISTDIR%\2.8-zip-version\WinMerge\"
copy Build\MergeUnicodeRelease\Merge7z*.dll "%DISTDIR%\2.8-zip-version\WinMerge\"


\progra~1\7-zip\7z.exe a -tzip "%DISTDIR%\winmerge-%SAFEAPPVER%-exe.zip" "%DISTDIR%\2.8-zip-version\WinMerge\"

\progra~1\7-zip\7z.exe a -tzip  -xr!*.bak -xr!*.lang -xr!*.ncb -xr!*.opt -xr!*.plg-xr!*.suo -xr!*.obj -xr!*.pdb -xr!*.pch -xr!*.res -xr!*.exe -xr!*.sbr -xr!*.zip -xr!WinMergeSplash.psd -xr!*.lib -xr!*.idb -xr!Merge_vc8.vcproj.DAMENINGEN2.taka.user -xr!BuildLog.htm -xr!CVS -xr!.svn -xr!Brazilian.po -xr!Bulgarian.po -xr!Catalan.po -xr!Croatian.po -xr!ChineseSimplified.po -xr!ChineseTraditional.po -xr!CVS -xr!Czech.po -xr!Danish.po -xr!Dutch.po -xr!French.po -xr!German.po -xr!Hungarian.po -xr!Italian.po -xr!Korean.po -xr!Norwegian.po -xr!Polish.po -xr!Portuguese.po -xr!Russian.po -xr!Slovak.po -xr!Spanish.po -xr!Swedish.po -xr!Turkish.po "%DISTDIR%\winmerge-%SAFEAPPVER%-full-src.zip" ArchiveSupport Docs Externals Filters Installer Plugins ShellExtension Src Testing Tools Web readme.txt *.cmd *.bat *.inf

explorer "%DISTDIR%"
pause
