Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bregonig.dll のファイル内容とタイムスタンプを比較する #335

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 62 additions & 2 deletions build-installer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ copy %INSTALLER_RESOURCES_SINT%\sakura.exe.manifest.v %INSTALLER_WORK%\
copy %INSTALLER_RESOURCES_SINT%\sakura.exe.ini %INSTALLER_WORK%\
copy %INSTALLER_RESOURCES_SINT%\keyword\*.* %INSTALLER_WORK%\keyword\

set DLL_BREGONIG_NAME=bregonig.dll
if "%platform%" == "x64" (
copy %INSTALLER_RESOURCES_BRON%\x64\*.dll %INSTALLER_WORK%\
set INSTALLER_RESOURCES_BRON_DLL=%INSTALLER_RESOURCES_BRON%\x64
) else (
copy %INSTALLER_RESOURCES_BRON%\*.dll %INSTALLER_WORK%\
set INSTALLER_RESOURCES_BRON_DLL=%INSTALLER_RESOURCES_BRON%
)
copy %INSTALLER_RESOURCES_BRON_DLL%\*.dll %INSTALLER_WORK%\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

横展ってわけではないですが /B バイナリモード指定をしたほうがよさそうです。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全体的に抜けているので、他のバッチファイルも含めて一括で対応します。

copy %INSTALLER_RESOURCES_BRON%\*.txt %INSTALLER_WORK%\

copy help\sakura\sakura.chm %INSTALLER_WORK%\
Expand All @@ -37,5 +39,63 @@ copy help\macro\macro.chm %INSTALLER_WORK%\
copy %platform%\%configuration%\*.exe %INSTALLER_WORK%\
copy %platform%\%configuration%\sakura_lang_en_US.dll %INSTALLER_WORK%\

set DLL_BREGONIG_0=%INSTALLER_RESOURCES_BRON_DLL%\%DLL_BREGONIG_NAME%
set DLL_BREGONIG_1=%INSTALLER_WORK%\%DLL_BREGONIG_NAME%
set DLL_BREGONIG_2=installer\externals\bregonig\%platform%\%DLL_BREGONIG_NAME%
set DLL_BREGONIG_3=%platform%\%configuration%\%DLL_BREGONIG_NAME%

FOR %%a IN (%DLL_BREGONIG_0%) DO SET TIMESTAMP_0=%%~ta
FOR %%b IN (%DLL_BREGONIG_1%) DO SET TIMESTAMP_1=%%~tb
FOR %%c IN (%DLL_BREGONIG_2%) DO SET TIMESTAMP_2=%%~tc
FOR %%d IN (%DLL_BREGONIG_3%) DO SET TIMESTAMP_3=%%~td

@echo %TIMESTAMP_0% %DLL_BREGONIG_0%
@echo %TIMESTAMP_1% %DLL_BREGONIG_1%
@echo %TIMESTAMP_2% %DLL_BREGONIG_2%
@echo %TIMESTAMP_3% %DLL_BREGONIG_3%

@rem compare file contents
set COMPARE_RESULT=0
fc /B %DLL_BREGONIG_0% %DLL_BREGONIG_1% 1>nul 2>&1
if "%ERRORLEVEL%" == "0" (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_1% for %platform%: matched
) else (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_1% for %platform%: unmatched
set COMPARE_RESULT=1
)

fc /B %DLL_BREGONIG_0% %DLL_BREGONIG_2% 1>nul 2>&1
if "%ERRORLEVEL%" == "0" (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_2% for %platform%: matched
) else (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_2% for %platform%: unmatched
set COMPARE_RESULT=1
)

fc /B %DLL_BREGONIG_0% %DLL_BREGONIG_3% 1>nul 2>&1
if "%ERRORLEVEL%" == "0" (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_3% for %platform%: matched
) else (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_3% for %platform%: unmatched
set COMPARE_RESULT=1
)

if "%COMPARE_RESULT%" == "1" (
echo unmatch file contents
exit /b 1
)
@rem compare timestamps
if "%TIMESTAMP_0%" == "%TIMESTAMP_1%" (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_1% for %platform%: timestamps matched
) else (
@echo %DLL_BREGONIG_0% and %DLL_BREGONIG_1% for %platform%: timestamps unmatched
set COMPARE_RESULT=1
)

if "%COMPARE_RESULT%" == "1" (
echo unmatch timestamps
exit /b 1
)

set SAKURA_ISS=installer\sakura-%platform%.iss
"C:\Program Files (x86)\Inno Setup 5\ISCC.exe" %SAKURA_ISS% || (echo error && exit /b 1)