Index: scripts/internal/detect_incorrect_manifest.bat =================================================================== diff -u -N --- scripts/internal/detect_incorrect_manifest.bat (revision 0) +++ scripts/internal/detect_incorrect_manifest.bat (revision 251181849c91428d68b3e3565add9a2043b45fec) @@ -0,0 +1,69 @@ +@echo off + +setlocal ENABLEDELAYEDEXPANSION + +rem Validate input parameters +if [%1] == [] ( + echo Usage: detect_incorrect_manifest.bat path_to_exe_dll_file + goto end +) + +rem initialize +call config.bat +if errorlevel 1 ( + exit /b 1 +) + +call internal\prepare_env.bat +if errorlevel 1 ( + goto error +) + +if not exist "%VS90COMNTOOLS%\vsvars32.bat" ( + echo ERROR: Can't find the vsvars32.bat file. + goto error +) else ( + call "%VS90COMNTOOLS%\vsvars32.bat" >nul +) + +rem process input path +SET InputFile=%~1 +SET TmpManifestLocation=%TmpDir%\extracted.manifest + +rem dll or exe? +if NOT "%InputFile%" == "!InputFile:.dll=dummy!" ( + rem this is a dll + SET ResID=2 +) else if NOT "%InputFile%" == "!InputFile:.exe=dummy!" ( + rem exe file + SET ResID=1 +) else ( + echo ERROR: Unknown file type encountered. + goto error +) + +mt.exe -nologo -inputresource:"%InputFile%";#%ResID% -out:"%TmpManifestLocation%" +if errorlevel 1 ( + echo ERROR: cannot extract manifest from file %InputFile%. + goto error +) + +SET _command=type "%TmpManifestLocation%" + +rem Currently we expect to have only 9.0.30729.5570 referenced in the manifest; if there is any older version, then some library linked with the project uses outdated version (boost?) +for %%v in ("9.0.21022.8" "9.0.30411" "9.0.30729.1" "9.0.30729.4148") do ( + for /f %%a in ('%_command% ^| find %%v') do ( + if NOT "%%a" == "0" ( + echo ERROR: %~Nx1 references an old version of MFC ^(%%v^) + goto error + ) + ) +) + +goto end + +:error +exit /b 1 + +:end +exit /b 0 Index: scripts/make_existing_release.bat =================================================================== diff -u -N -r718a83fb4e17e7d6160fdbf11b154e2068278586 -r251181849c91428d68b3e3565add9a2043b45fec --- scripts/make_existing_release.bat (.../make_existing_release.bat) (revision 718a83fb4e17e7d6160fdbf11b154e2068278586) +++ scripts/make_existing_release.bat (.../make_existing_release.bat) (revision 251181849c91428d68b3e3565add9a2043b45fec) @@ -62,6 +62,29 @@ goto error ) +echo --- Verifying build ------------------------------------------------- +cd %MainProjectDir% +if not exist bin\release ( + echo ERROR: The bin\release directory does not exist. + goto error +) + +cd %MainProjectDir%\scripts + +SET FoundWrongManifest=0 +for %%v in (%MainProjectDir%\bin\release\*.dll %MainProjectDir%\bin\release\*.exe) do ( + echo * Verifying %%~nv%%~xv... + call internal\detect_incorrect_manifest.bat "%%v" + if errorlevel 1 ( + SET FoundWrongManifest=1 + ) +) + +if "!FoundWrongManifest!" == "1" ( + echo ERROR: Incorrect manifest detected in one or more executables. + goto error +) + echo --- Preparing packages ---------------------------------------------- echo * Create source package for version %CHTextVersion%... @@ -103,12 +126,6 @@ ) ) -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-%CHTextVersion%.zip" -tzip "*.pdb" >"%TmpDir%\command.log"