Index: scripts/config.bat =================================================================== diff -u -N --- scripts/config.bat (revision 0) +++ scripts/config.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,17 @@ +@echo off +SET ReposCH=https://copyhandler.svn.sourceforge.net/svnroot/copyhandler +SET ReposIcpf=https://libicpf.svn.sourceforge.net/svnroot/libicpf +SET ReposIctranslate=https://libictranslate.svn.sourceforge.net/svnroot/libictranslate + +SET CurrentDir=%CD% +SET ScriptDir=%CurrentDir% +SET OutputDir=%CurrentDir%\out +SET TmpDir=%CurrentDir%\tmp +SET MainProjectDir=%TmpDir%\copyhandler + +if not exist "%ScriptDir%\make_package.bat" ( + echo ERROR: This script needs to be called from its directory. + exit /b 1 +) + +exit /b 0 Index: scripts/edit.bat =================================================================== diff -u -N --- scripts/edit.bat (revision d6d1712f9a8c0d2e97ac5dabc7674cd78ef00df5) +++ scripts/edit.bat (revision 0) @@ -1 +0,0 @@ -type ..\externals.txt >%1 Index: scripts/internal/clear_env.bat =================================================================== diff -u -N --- scripts/internal/clear_env.bat (revision 0) +++ scripts/internal/clear_env.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,55 @@ +@echo off + +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +cd "%TmpDir%\.." + +rem Setup environment +if exist "%TmpDir%" ( + echo * Removing temporary directory... + rmdir /S /Q "%TmpDir%" >nul + if exist "%TmpDir%" ( + echo ERROR: Deleting the old temporary folder failed. + exit /b 1 + ) +) + +if NOT "%1" == "/skip_create" ( + if exist "%OutputDir%" ( + echo * Removing OutputDirectory... + rmdir /S /Q "%OutputDir%" >nul + if exist "%OutputDir%" ( + echo ERROR: Deleting the old output folder failed. + exit /b 1 + ) + ) + + mkdir "%TmpDir%" + if not exist "%TmpDir%" ( + echo ERROR: Creating temporary folder failed. + exit /b 1 + ) + + mkdir "%OutputDir%" + if not exist "%OutputDir%" ( + echo ERROR: Creating temporary folder failed. + exit /b 1 + ) + + mkdir "%TmpDir%\zip32" + if not exist "%TmpDir%\zip32" ( + echo ERROR: Creating temporary zip32 folder failed. + goto error + ) + + mkdir "%TmpDir%\zip64" + if not exist "%TmpDir%\zip64" ( + echo ERROR: Creating temporary zip64 folder failed. + goto error + ) +) + +exit /b 0 Index: scripts/internal/detect_version.bat =================================================================== diff -u -N --- scripts/internal/detect_version.bat (revision 0) +++ scripts/internal/detect_version.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,95 @@ +@echo off + +rem Include config +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +rem Validate input parameters +if "%1" == "" ( + echo Usage: script beta^|final + goto end +) + +echo * Cleaning environment +call internal\clear_env.bat +if errorlevel 1 ( + echo ERROR: Problem with preparing environment. + goto error +) + +echo * Checking out '/trunk/src/common' directory of CH +svn co "%ReposCH%/trunk/src/common" "%MainProjectDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo Cannot retrieve the part of copy handler sources to establish svn version. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Scanning directory for version number +rem Get SVN version +2 to correct the nearest commit +set _ver_cmd=svnversion -n "%MainProjectDir%" +for /f %%a in ('%_ver_cmd%') do set /a TrunkSVNVersion=%%a +if errorlevel 1 ( + echo Problem with scanning svn WC for current version. + goto error +) +if "%TrunkSVNVersion%" == "" ( + echo Can't get the major version. + goto error +) + +SET /a SVNVersion=%TrunkSVNVersion%+2 + +echo * Detecting version numbers +set _ver_cmd=type "%MainProjectDir%\version.h" +for /f "tokens=3 delims= " %%a in ('%_ver_cmd% ^|find "define PRODUCT_VERSION1 "') do set MajorVersion=%%a +if errorlevel 1 ( + echo Problem with retrieving MajorVersion. + goto error +) +if "%MajorVersion%" == "" ( + echo Can't get the major version. + goto error +) + +set _ver_cmd=type "%MainProjectDir%\version.h" +for /f "tokens=3 delims= " %%a in ('%_ver_cmd% ^|find "define PRODUCT_VERSION2 "') do set MinorVersion=%%a +if errorlevel 1 ( + echo Problem with retrieving MinorVersion. + goto error +) +if "%MinorVersion%" == "" ( + echo Can't get the major version. + goto error +) + +SET CustomVersion=0 + +if "%1" == "beta" ( + SET TrunkTextVersion=%MajorVersion%.%MinorVersion%beta-svn%TrunkSVNVersion% + SET TextVersion=%MajorVersion%.%MinorVersion%beta-svn%SVNVersion% +) else ( + SET TrunkTextVersion=%MajorVersion%.%MinorVersion%Final + SET TextVersion=%MajorVersion%.%MinorVersion%Final +) + +if "%TextVersion%" == "" ( + echo Cannot calculate the text version. + goto error +) + +echo * Detected current trunk at %MajorVersion%.%MinorVersion%.%TrunkSVNVersion%.%CustomVersion%, preparing to tag as %MajorVersion%.%MinorVersion%.%SVNVersion%.%CustomVersion% +goto cleanup + +:error +rem Get outside of the temp directory to be able to delete it +call internal\clear_env.bat /skip_create +exit /b 1 + +:cleanup +call internal\clear_env.bat /skip_create + +:end +exit /b 0 Index: scripts/internal/embed_srcserver_info.bat =================================================================== diff -u -N --- scripts/internal/embed_srcserver_info.bat (revision 0) +++ scripts/internal/embed_srcserver_info.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,45 @@ +@echo off + +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +call internal\prepare_env.bat +if errorlevel 1 ( + goto error +) + +SET _cmd=call svnindex.cmd /debug /source=%MainProjectDir%\src /source=%MainProjectDir%\src\ictranslate /source=%MainProjectDir%\src\libictranslate /source=%MainProjectDir%\src\rc2lng /source=%MainProjectDir%\src\libicpf /symbols=%MainProjectDir%\bin\release +rem SET _cmd=call svnindex.cmd /debug /source=%MainProjectDir%\src /symbols=%MainProjectDir%\bin\release + +%_cmd% >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Error encountered while embedding source server information. + exit /b 1 +) + +SET IndexRes=Undefined +SET _cmd=type "%TmpDir%\command.log" +for /f %%a in ('%_cmd% ^| find /c "zero source files found"') do set IndexRes=%%a +if NOT "%IndexRes%" == "0" ( + echo Some source server information has not been embedded. See the log below: + type "%TmpDir%\command.log" + exit /b 1 +) + +for /f %%a in ('%_cmd% ^| find /c "ERROR"') do set IndexRes=%%a +if NOT "%IndexRes%" == "0" ( + echo Error encountered when embedding source server information. See the log below: + type "%TmpDir%\command.log" + exit /b 1 +) + +for /f %%a in ('%_cmd% ^| find /c "WARNING"') do set IndexRes=%%a +if NOT "%IndexRes%" == "0" ( + echo Error encountered when embedding source server information. See the log below: + type "%TmpDir%\command.log" + exit /b 1 +) + +exit /b 0 Index: scripts/internal/prepare_env.bat =================================================================== diff -u -N --- scripts/internal/prepare_env.bat (revision 0) +++ scripts/internal/prepare_env.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,43 @@ +@echo off + +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +rem Setup environment +if not exist "%TmpDir%" ( + mkdir "%TmpDir%" + if not exist "%TmpDir%" ( + echo ERROR: Creating temporary folder failed. + exit /b 1 + ) +) + +if not exist "%OutputDir%" ( + mkdir "%OutputDir%" + if not exist "%OutputDir%" ( + echo ERROR: Creating temporary folder failed. See the log below: + type "%TmpDir%\command.log" + exit /b 1 + ) +) + +rem Prepare directories +if not exist "%TmpDir%\zip32" ( + mkdir "%TmpDir%\zip32" + if not exist "%TmpDir%\zip32" ( + echo ERROR: Creating temporary zip32 folder failed. + goto error + ) +) + +if not exist "%TmpDir%\zip64" ( + mkdir "%TmpDir%\zip64" + if not exist "%TmpDir%\zip64" ( + echo ERROR: Creating temporary zip64 folder failed. + goto error + ) +) + +exit /b 0 Index: scripts/internal/replace_version.vbs =================================================================== diff -u -N --- scripts/internal/replace_version.vbs (revision 0) +++ scripts/internal/replace_version.vbs (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,36 @@ +Const ForReading = 1 +Const ForWriting = 2 + +strOldFileName = Wscript.Arguments(0) +strNewFileName = Wscript.Arguments(1) +strMajor = WScript.Arguments(2) +strMinor = WScript.Arguments(3) +strSVN = WScript.Arguments(4) +strCustom = WScript.Arguments(5) +strTextVersion = WScript.Arguments(6) + +' Validate parameters +if strOldFileName = "" or strNewFileName = "" or strMajor = "" or strMinor = "" or strSVN = "" or strCustom ="" or strTextVersion="" then + WScript.echo "Missing input parameters" + return 1 +end if + +Set objFSO = CreateObject("Scripting.FileSystemObject") + +' Read the source file +Set objFile = objFSO.OpenTextFile(strOldFileName, ForReading) + +strText = objFile.ReadAll +objFile.Close + +' Replace the text +strText = Replace(strText, "{major_version}", strMajor) +strText = Replace(strText, "{minor_version}", strMinor) +strText = Replace(strText, "{svn_version}", strSVN) +strText = Replace(strText, "{custom_version}", strCustom) +strText = Replace(strText, "{text_version}", strTextVersion) + +' And write the text +Set objFile = objFSO.OpenTextFile(strNewFileName, ForWriting) +objFile.WriteLine strText +objFile.Close Index: scripts/internal/svntag.bat =================================================================== diff -u -N --- scripts/internal/svntag.bat (revision 0) +++ scripts/internal/svntag.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,91 @@ +@echo off + +rem Mark the changes as local ones +setlocal + +if [%1] == [] ( + echo Usage: svntag.bat TextVersion + exit /b 1 +) + +SET TextVersion=%1 + +rem Include config +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +call internal\clear_env.bat +if errorlevel 1 ( + echo ERROR: Problem with preparing environment. + goto error +) + +echo * Tagging projects... +call internal\svntag_single.bat "%ReposIcpf%" %TextVersion% +if errorlevel 1 ( + goto error +) + +call internal\svntag_single.bat "%ReposIctranslate%" %TextVersion% +if errorlevel 1 ( + goto error +) + +call internal\svntag_single.bat "%ReposCH%" %TextVersion% +if errorlevel 1 ( + goto error +) + +echo * Checking out the tagged ch repository... +svn --ignore-externals co "%ReposCH%/tags/%TextVersion%" "%MainProjectDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Creating new svn:externals definition... + +echo src/libicpf %ReposIcpf%/tags/%TextVersion%/src/libicpf >"%TmpDir%\externals.txt" +echo src/libictranslate %ReposIctranslate%/tags/%TextVersion%/src/libictranslate >>"%TmpDir%\externals.txt" +echo src/rc2lng %ReposIctranslate%/tags/%TextVersion%/src/rc2lng >>"%TmpDir%\externals.txt" +echo src/ictranslate %ReposIctranslate%/tags/%TextVersion%/src/ictranslate >>"%TmpDir%\externals.txt" + +svn propedit --editor-cmd "type %TmpDir%\externals.txt >" svn:externals "%MainProjectDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Updating version information... +cscript //NoLogo internal\replace_version.vbs "%MainProjectDir%\src\common\version.h.template" "%MainProjectDir%\src\common\version.h" %MajorVersion% %MinorVersion% %SVNVersion% %CustomVersion% %TextVersion% >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while checking out copyhandler project. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Performing commit of the updated svn:externals... +svn commit -m "Updated svn:externals definition" "%MainProjectDir%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while committing changes to repository. See the log below: + type "%TmpDir%\command.log" + goto error +) + +goto cleanup + +:error +call internal\clear_env.bat /skip_create + +exit /b 1 + +:cleanup +echo * Cleaning up the temporary files... +call internal\clear_env.bat /skip_create + +:end +exit /b 0 Index: scripts/internal/svntag_single.bat =================================================================== diff -u -N --- scripts/internal/svntag_single.bat (revision 0) +++ scripts/internal/svntag_single.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,41 @@ +@echo off + +if [%1] == [] ( + echo Usage: svntag_single.bat ReposAddress TextVersion + exit /b 1 +) + +SET ReposAddress=%1 +SET TextVersion=%2 + +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +call internal\clear_env.bat +if errorlevel 1 ( + exit /b 1 +) + +rem check if the project isn't already tagged +svn co "%ReposAddress%/tags/%TextVersion%" "%MainProjectDir%" 2>nul +if errorlevel 1 ( + rem when error, it probably means that the tag does not exist + goto create +) + +rem if we're here, then the tag already exist +echo * The repository already had a tag %TextVersion%. Skipping tagging. +exit /b 0 + +:create +echo * Tagging %ReposAddress% as %TextVersion%... +svn cp -m "Tagged project to %TextVersion%" "%ReposAddress%/trunk/" "%ReposAddress%/tags/%TextVersion%" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while tagging libicpf project. See the log below: + type "%TmpDir%\command.log" + exit /b 1 +) + +exit /b 0 Index: scripts/make_existing_package.bat =================================================================== diff -u -N --- scripts/make_existing_package.bat (revision 0) +++ scripts/make_existing_package.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,234 @@ +@echo off + +rem Mark the changes as local ones +setlocal + +rem Check input parameter +if [%1] == [] ( + echo Usage: make_package.bat TextVersion + exit /b 1 +) + +SET TextVersion=%1 + +echo --- Initializing ---------------------------------------------- +echo * Clearing environment... +call internal\clear_env.bat +if errorlevel 1 ( + goto error +) + +echo * Initializing Visual Studio environment +if not exist "%VS90COMNTOOLS%\vsvars32.bat" ( + echo ERROR: Can't find the vsvars32.bat file. + goto error +) else ( + call "%VS90COMNTOOLS%\vsvars32.bat" >nul +) + +SET VSInst=%ProgramFiles% +if NOT "%ProgramFiles(x86)%" == "" SET VSInst=%ProgramFiles(x86)% + +echo --- Preparing source package ---------------------------------------- +echo * Retrieving tagged source code... +svn co "%ReposCH%/tags/%TextVersion%" "%MainProjectDir%" >"%TmpDir%\command.log" 2>"%TmpDir%\command-err.log" +if errorlevel 1 ( + echo ERROR: encountered a problem while exporting sources from repository. See the log below: + type "%TmpDir%\command-err.log" + goto error +) + +SET _cmd=type "%TmpDir%\command-err.log" +for /f %%a in ('%_cmd% ^|find "Error"') do SET Res=%%a +if NOT "%Res%" == "" ( + echo ERROR: Encountered some problems while checking out CH. See below for details: + type "%TmpDir%\command-err.log" + goto error +) + +echo * Create source package... +cd %MainProjectDir% +7z a "%OutputDir%\chsrc-%TextVersion%.zip" -tzip -x!"scripts\*.bat" -xr!".svn" . >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Preparation of the sources failed. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo --- Preparing binary packages (Win32) -------------------------- +echo * Building... +devenv ch.vc90.sln /rebuild "Release-Unicode|Win32" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Build process failed. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Embedding source server information to debug symbol files... +cd %ScriptDir% +call internal\embed_srcserver_info.bat +if errorlevel 1 ( + goto error +) + +echo * Preparing the zip package (Win32) + +cd %MainProjectDir% +if not exist bin\release ( + echo ERROR: The bin\release directory does not exist. + goto error +) + +cd %MainProjectDir%\bin\release + +7z a "%OutputDir%\ch_symbols-%TextVersion%.zip" -tzip "*.pdb" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Could not create symbols archive. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Preparing the installer package... +cd %MainProjectDir% +if not exist scripts ( + echo ERROR: The scripts directory does not exist. + goto error +) + +cd %MainProjectDir%\scripts + +iscc setup32.iss /o%OutputDir% >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Preparation of the installer version failed. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Preparing 32-bit zip package... +cd %MainProjectDir% + +rem Prepare files +SET Res=0 +xcopy "bin\release\ch.exe" "%TmpDir%\zip32\" >"%TmpDir%\command.log" || SET Res=1 +xcopy "License.txt" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\chext.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\libicpf32u.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\libchcore32u.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\libictranslate32u.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\ictranslate.exe" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.MFC\*" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\dbghelp.dll" "%TmpDir%\zip32\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy /E /I "bin\release\help" "%TmpDir%\zip32\help" >>"%TmpDir%\command.log" || SET Res=1 +xcopy /E /I "bin\release\langs" "%TmpDir%\zip32\langs" >>"%TmpDir%\command.log" || SET Res=1 + +if %Res% NEQ 0 ( + echo ERROR: Detected a problem when copying files. See the log below: + type "%TmpDir%\command.log" + goto error +) + +cd "%TmpDir%\zip32\" + +7z a "%OutputDir%\ch32-%TextVersion%.zip" -tzip . >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Could not create win32 zip archive. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo --- Preparing binary packages (x64) ---------------------------- +cd %MainProjectDir% + +echo * Building... +devenv ch.vc90.sln /rebuild "Release-Unicode|x64" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Build process failed. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Embedding source server information to debug symbol files... +cd %ScriptDir% +call internal\embed_srcserver_info.bat +if errorlevel 1 ( + goto error +) + +echo * Preparing the zip packages (x64) +cd %MainProjectDir% + +if not exist bin\release ( + echo ERROR: The bin\release directory does not exist. + goto error +) + +cd %MainProjectDir%\bin\release + +7z a "%OutputDir%\ch_symbols64-%TextVersion%.zip" -tzip "*64*.pdb" >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Could not create symbols archive. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Preparing the installer package +cd %MainProjectDir% +if not exist scripts ( + echo ERROR: The scripts directory does not exist. + goto error +) + +cd %MainProjectDir%\scripts + +iscc setup64.iss /o%OutputDir% >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Preparation of the installer version failed. See the log below: + type "%TmpDir%\command.log" + goto error +) + +echo * Preparing 64-bit zip package... +cd %MainProjectDir% + +SET Res=0 + +xcopy "bin\release\ch64.exe" "%TmpDir%\zip64\" >"%TmpDir%\command.log" || SET Res=1 +xcopy "License.txt" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\chext64.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\libicpf64u.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\libchcore64u.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\libictranslate64u.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "bin\release\ictranslate64.exe" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%VSInst%\Microsoft Visual Studio 9.0\VC\redist\amd64\Microsoft.VC90.MFC\*" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64\dbghelp.dll" "%TmpDir%\zip64\" >>"%TmpDir%\command.log" || SET Res=1 +xcopy /E /I "bin\release\help" "%TmpDir%\zip64\help" >>"%TmpDir%\command.log" || SET Res=1 +xcopy /E /I "bin\release\langs" "%TmpDir%\zip64\langs" >>"%TmpDir%\command.log" || SET Res=1 + +if %Res% NEQ 0 ( + echo ERROR: Detected a problem when copying files. See the log below: + type "%TmpDir%\command.log" + goto error +) + +cd "%TmpDir%\zip64\" + +7z a "%OutputDir%\ch64-%TextVersion%.zip" -tzip . >"%TmpDir%\command.log" +if errorlevel 1 ( + echo ERROR: Could not create win64 zip archive. See the log below: + type "%TmpDir%\command.log" + goto error +) + +goto cleanup + +:error +call internal\clear_env.bat /skip_create +exit /b 1 + +:cleanup +call internal\clear_env.bat /skip_create + +:end +exit /b 0 Index: scripts/make_package.bat =================================================================== diff -u -N --- scripts/make_package.bat (revision 0) +++ scripts/make_package.bat (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,64 @@ +@echo off + +rem Mark the changes as local ones +setlocal + +rem Check input parameter +if [%1] == [] ( + echo Usage: make_package.bat beta^|final + exit /b 1 +) + +echo --- Initializing ----------------------------------------------- +echo * Reading configuration... +call config.bat +if errorlevel 1 ( + goto error +) + +echo * Preparing environment... +call internal\prepare_env.bat +if errorlevel 1 ( + goto error +) + +echo --- Detecting version numbers ---------------------------------- +call internal\detect_version.bat %1 +if errorlevel 1 ( + goto error +) + +echo --- Checking if current trunk is already tagged ---------------- +svn --depth empty co "%ReposCH%/tags/%TrunkTextVersion%" "%MainProjectDir%" >nul 2>nul +if errorlevel 1 ( + echo * Tag not found. Will tag. +) else ( + echo * Tag %TrunkTextVersion% already found. Skipping tagging. + SET TextVersion=%TrunkTextVersion% + SET SVNVersion=%TrunkSVNVersion% + goto make_existing +) + +echo --- Tagging the release ---------------------------------------- +call internal\svntag.bat %TextVersion% +if errorlevel 1 ( + goto error +) + +:make_existing +call make_existing_package.bat %TextVersion% +if errorlevel 1 ( + goto error +) + +goto cleanup + +:error +call internal\clear_env.bat /skip_create +exit /b 1 + +:cleanup +call internal\clear_env.bat /skip_create + +:end +exit /b 0 Index: scripts/makepkg.bat =================================================================== diff -u -N --- scripts/makepkg.bat (revision 48e3f41a2b7446047a8c228d8f9f40e61f5d5098) +++ scripts/makepkg.bat (revision 0) @@ -1,235 +0,0 @@ -@echo off - -rem Mark the changes as local ones -setlocal - -rem --------------------------------------------------- -rem Remember the current path -set CurrentDir=%CD% -set OutputDir=%CurrentDir%\out -set TmpDir=%CurrentDir%\tmp -set MainProjectDir=%TmpDir%\copyhandler - -rem --------------------------------------------------- -rem Setup environment -echo Initializing... - -if exist %TmpDir% ( - rmdir /S /Q %TmpDir% - if exist %TmpDir% ( - echo ERROR: Deleting the old temporary folder failed. - goto end - ) -) - -mkdir %TmpDir% -if not exist %TmpDir% ( - echo ERROR: Creating temporary folder failed. - goto end -) - -if exist %OutputDir% ( - rmdir /S /Q %OutputDir% - if exist %OutputDir% ( - echo ERROR: Deleting the old output folder failed. - goto end - ) -) - -mkdir %OutputDir% -if not exist %OutputDir% ( - echo ERROR: Creating temporary folder failed. - goto end -) - -mkdir %TmpDir%\zip32 -if not exist %TmpDir% ( - echo ERROR: Creating temporary zip32 folder failed. - goto end -) - -mkdir %TmpDir%\zip64 -if not exist %TmpDir% ( - echo ERROR: Creating temporary zip64 folder failed. - goto end -) - -rem enter the temporary directory -cd %TmpDir% - -rem --------------------------------------------------- -echo Exporting copyhandler from the repository... - -svn export https://copyhandler.svn.sourceforge.net/svnroot/copyhandler/trunk copyhandler -if errorlevel 1 ( - echo ERROR: encountered a problem while exporting sources from repository. - goto cleanup -) - -cd %MainProjectDir% - -rem ---------------------------------------------------- -echo Retrieving current version number -set _ver_cmd=type "src\common\version.h" -for /f "tokens=3 delims= " %%a in ('%_ver_cmd% ^|find "define PRODUCT_VERSION "') do set CHVER=%%~a -if "%CHVER%" == "" ( - echo Can't get the svn version. - goto cleanup -) - -echo Preparing the %CHVER% version of Copy Handler - -rem ---------------------------------------------------- -echo Preparing the source package -7z a "%OutputDir%\chsrc-%CHVER%.zip" -tzip -x!!"scripts\*.bat" . -if errorlevel 1 ( - echo Preparation of the sources failed. - goto cleanup -) - -rem ---------------------------------------------------- -echo Initializing Visual Studio environment variables... -if not exist "%VS90COMNTOOLS%\vsvars32.bat" ( - echo Can't find the vsvars32.bat file. - goto cleanup -) else ( - call "%VS90COMNTOOLS%\vsvars32.bat" -) - -rem --------------------------------------------------- -echo Building the solution (Win32) -devenv ch.vc90.sln /rebuild "Release-Unicode|Win32" -if errorlevel 1 ( - echo Build process failed. - goto cleanup -) - -echo Preparing the zip packages (Win32) - -if not exist bin\release ( - echo The bin\release directory does not exist. - goto cleanup -) - -cd %MainProjectDir%\bin\release - -7z a "%OutputDir%\ch_symbols-%CHVER%.zip" -tzip "*.pdb" -if errorlevel 1 ( - echo Could not create symbols archive. - goto cleanup -) - -echo Preparing the installer package -cd %MainProjectDir% -if not exist scripts ( - echo The scripts directory does not exist. - goto cleanup -) - -cd %MainProjectDir%\scripts - -iscc setup32.iss /o%OutputDir% -if errorlevel 1 ( - echo Preparation of the installer version failed. - goto cleanup -) - -cd %MainProjectDir% - -rem --------------------------------------------------- -echo Building the solution (x64) -devenv ch.vc90.sln /rebuild "Release-Unicode|x64" -if errorlevel 1 ( - echo Build process failed. - goto cleanup -) - -echo Preparing the zip packages (x64) - -if not exist bin\release ( - echo The bin\release directory does not exist. - goto cleanup -) - -cd %MainProjectDir%\bin\release - -7z a "%OutputDir%\ch_symbols64-%CHVER%.zip" -tzip "*64*.pdb" -if errorlevel 1 ( - echo Could not create symbols archive. - goto cleanup -) - -echo Preparing the installer package -cd %MainProjectDir% -if not exist scripts ( - echo The scripts directory does not exist. - goto cleanup -) - -cd %MainProjectDir%\scripts - -iscc setup64.iss /o%OutputDir% -if errorlevel 1 ( - echo Preparation of the installer version failed. - goto cleanup -) - -rem ------------- -rem We are in scripts/ and going up -cd %MainProjectDir% - -rem Prepare files -xcopy "bin\release\ch.exe" "%TmpDir%\zip32\" -xcopy "License.txt" "%TmpDir%\zip32\" -xcopy "bin\release\chext.dll" "%TmpDir%\zip32\" -xcopy "bin\release\libicpf32u.dll" "%TmpDir%\zip32\" -xcopy "bin\release\libchcore32u.dll" "%TmpDir%\zip32\" -xcopy "bin\release\libictranslate32u.dll" "%TmpDir%\zip32\" -xcopy "bin\release\ictranslate.exe" "%TmpDir%\zip32\" -xcopy "C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*" "%TmpDir%\zip32\" -xcopy "C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.MFC\*" "%TmpDir%\zip32\" -xcopy "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\dbghelp.dll" "%TmpDir%\zip32\" -xcopy /E /I "bin\release\help" "%TmpDir%\zip32\help" -xcopy /E /I "bin\release\langs" "%TmpDir%\zip32\langs" - -cd "%TmpDir%\zip32\" - -7z a "%OutputDir%\ch32-%CHVER%.zip" -tzip . -if errorlevel 1 ( - echo Could not create win32 zip archive. - goto cleanup -) - -rem ---------------------------------------------- -cd %MainProjectDir% - -xcopy "bin\release\ch64.exe" "%TmpDir%\zip64\" -xcopy "License.txt" "%TmpDir%\zip64\" -xcopy "bin\release\chext64.dll" "%TmpDir%\zip64\" -xcopy "bin\release\libicpf64u.dll" "%TmpDir%\zip64\" -xcopy "bin\release\libchcore64u.dll" "%TmpDir%\zip64\" -xcopy "bin\release\libictranslate64u.dll" "%TmpDir%\zip64\" -xcopy "bin\release\ictranslate64.exe" "%TmpDir%\zip64\" -xcopy "C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*" "%TmpDir%\zip64\" -xcopy "C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\amd64\Microsoft.VC90.MFC\*" "%TmpDir%\zip64\" -xcopy "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x64\dbghelp.dll" "%TmpDir%\zip64\" -xcopy /E /I "bin\release\help" "%TmpDir%\zip64\help" -xcopy /E /I "bin\release\langs" "%TmpDir%\zip64\langs" - -cd "%TmpDir%\zip64\" - -7z a "%OutputDir%\ch64-%CHVER%.zip" -tzip . -if errorlevel 1 ( - echo Could not create win64 zip archive. - goto cleanup -) - -:cleanup -echo Cleaning up the temporary files... -cd "%TmpDir%" -cd .. -rmdir /S /Q "%TmpDir%" - -goto end - -:end Index: scripts/svntag.bat =================================================================== diff -u -N --- scripts/svntag.bat (revision b0cf21f3bb7c35972f2a965417852161fb99d900) +++ scripts/svntag.bat (revision 0) @@ -1,66 +0,0 @@ -@echo off - -rem Mark the changes as local ones -setlocal - -echo Performing a cleanup... -if exist copyhandler ( - rmdir /S /Q copyhandler - if exist copyhandler ( - echo ERROR: Deleting the old temporary copyhandler folder failed. - goto end - ) -) - -echo Tagging projects... -svn cp -m "Tagged project to %1" https://libicpf.svn.sourceforge.net/svnroot/libicpf/trunk https://libicpf.svn.sourceforge.net/svnroot/libicpf/tags/%1 -if errorlevel 1 ( - echo ERROR: encountered a problem while tagging libicpf project. - goto cleanup -) - -svn cp -m "Tagged project to %1" https://libictranslate.svn.sourceforge.net/svnroot/libictranslate/trunk https://libictranslate.svn.sourceforge.net/svnroot/libictranslate/tags/%1 -if errorlevel 1 ( - echo ERROR: encountered a problem while tagging ictranslate project. - goto cleanup -) - -svn cp -m "Tagged project to %1" https://copyhandler.svn.sourceforge.net/svnroot/copyhandler/trunk https://copyhandler.svn.sourceforge.net/svnroot/copyhandler/tags/%1 -if errorlevel 1 ( - echo ERROR: encountered a problem while tagging copyhandler project. - goto cleanup -) - -echo Checking out the tagged ch repository... -svn co https://copyhandler.svn.sourceforge.net/svnroot/copyhandler/tags/%1 copyhandler -if errorlevel 1 ( - echo ERROR: encountered a problem while checking out copyhandler project. - goto cleanup -) - -echo Creating new svn:externals definition... - -echo src/libicpf https://libicpf.svn.sourceforge.net/svnroot/libicpf/tags/%1/src/libicpf >externals.txt -echo src/libictranslate https://libictranslate.svn.sourceforge.net/svnroot/libictranslate/tags/%1/src/libictranslate >>externals.txt -echo src/rc2lng https://libictranslate.svn.sourceforge.net/svnroot/libictranslate/tags/%1/src/rc2lng >>externals.txt -echo src/ictranslate https://libictranslate.svn.sourceforge.net/svnroot/libictranslate/tags/%1/src/ictranslate >>externals.txt - -svn propedit --editor-cmd "%CD%\edit.bat" svn:externals copyhandler -if errorlevel 1 ( - echo ERROR: encountered a problem while checking out copyhandler project. - goto cleanup -) - -echo Performing commit of the updated svn:externals... -svn commit -m "Updated svn:externals definition" copyhandler - -:cleanup -echo Cleaning up... -del externals.txt -rmdir /S /Q copyhandler - -goto end - -:end - -echo Done. Index: src/common/version.h =================================================================== diff -u -N -r329c390d607e0c1c1a7e3d31fe76bc77eb6cefe8 -r0dad97fd1b1e4c79c037b3b638181c2214c0d8f8 --- src/common/version.h (.../version.h) (revision 329c390d607e0c1c1a7e3d31fe76bc77eb6cefe8) +++ src/common/version.h (.../version.h) (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -11,10 +11,10 @@ // Version of program #define PRODUCT_VERSION1 1 #define PRODUCT_VERSION2 32 -#define PRODUCT_VERSION3 212 +#define PRODUCT_VERSION3 999 #define PRODUCT_VERSION4 0 -#define PRODUCT_VERSION "1.32beta-svn212" +#define PRODUCT_VERSION "1.32internal-999" #if SETUP_COMPILER != 1 #define SHELLEXT_PRODUCT_FULL_VERSION SHELLEXT_PRODUCT_NAME " " PRODUCT_VERSION Index: src/common/version.h.template =================================================================== diff -u -N --- src/common/version.h.template (revision 0) +++ src/common/version.h.template (revision 0dad97fd1b1e4c79c037b3b638181c2214c0d8f8) @@ -0,0 +1,32 @@ +#ifndef __VERSION_H__ +#define __VERSION_H__ + +// note that this file is also being used by setup compiler; +// in this case the SETUP_COMPILER is defined with value 1 +// Product name +#define PRODUCT_NAME "Copy Handler" +// shell extension +#define SHELLEXT_PRODUCT_NAME "Copy Handler Shell Extension" + +// Version of program +#define PRODUCT_VERSION1 {major_version} +#define PRODUCT_VERSION2 {minor_version} +#define PRODUCT_VERSION3 {svn_version} +#define PRODUCT_VERSION4 {custom_version} + +#define PRODUCT_VERSION "{text_version}" + +#if SETUP_COMPILER != 1 + #define SHELLEXT_PRODUCT_FULL_VERSION SHELLEXT_PRODUCT_NAME " " PRODUCT_VERSION + #define SHELLEXT_PRODUCT_FULL_VERSION_T _T(SHELLEXT_PRODUCT_NAME) _T(" ") _T(PRODUCT_VERSION) + + #define PRODUCT_FULL_VERSION PRODUCT_NAME " " PRODUCT_VERSION + #define PRODUCT_FULL_VERSION_T _T(PRODUCT_NAME) _T(" ") _T(PRODUCT_VERSION) +#endif + +// copyright information +#define COPYRIGHT_INFO "Copyright (C) 2001-2009 J�zef Starosczyk" +#define PRODUCT_SITE "http://www.copyhandler.com" +#define CONTACT_INFO "ixen@copyhandler.com" + +#endif