mirror of
https://github.com/xroche/httrack.git
synced 2026-07-14 12:50:52 +03:00
Compare commits
5 Commits
content-co
...
fix/rc-blo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2c391e8af | ||
|
|
9ec5a3a067 | ||
|
|
cd38e6e68d | ||
|
|
e692e56592 | ||
|
|
7d9d4ed890 |
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Resource scripts are Windows tooling input and must stay CRLF: the engine has no
|
||||
# encoding guard, so an autocrlf checkout could otherwise flatten them silently.
|
||||
*.rc text eol=crlf
|
||||
@@ -83,6 +83,9 @@ libhttrack_la_CFLAGS = $(AM_CFLAGS) -DLIBHTTRACK_EXPORTS -DZLIB_CONST
|
||||
libhttrack_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(VERSION_INFO)
|
||||
|
||||
EXTRA_DIST = httrack.h webhttrack \
|
||||
version.rc \
|
||||
libhttrack.rc \
|
||||
httrack.rc \
|
||||
coucal/murmurhash3.h.diff \
|
||||
coucal/murmurhash3.h.orig \
|
||||
minizip/iowin32.c \
|
||||
|
||||
@@ -328,8 +328,8 @@ typedef enum hts_wizard {
|
||||
|
||||
typedef enum hts_robots {
|
||||
HTS_ROBOTS_NEVER = 0, /**< ignore robots rules */
|
||||
HTS_ROBOTS_SOMETIMES = 1, /**< partial obedience (default) */
|
||||
HTS_ROBOTS_ALWAYS = 2, /**< obey robots rules */
|
||||
HTS_ROBOTS_SOMETIMES = 1, /**< partial obedience, set by -s */
|
||||
HTS_ROBOTS_ALWAYS = 2, /**< obey robots rules (default) */
|
||||
HTS_ROBOTS_ALWAYS_STRICT = 3 /**< obey even strict rules */
|
||||
} hts_robots;
|
||||
#endif
|
||||
|
||||
5
src/httrack.rc
Normal file
5
src/httrack.rc
Normal file
@@ -0,0 +1,5 @@
|
||||
// Version resource for httrack.exe, the command line program. See version.rc.
|
||||
#define VER_FILE_DESCRIPTION "HTTrack Website Copier (command line)"
|
||||
#define VER_ORIGINAL_FILENAME "httrack.exe"
|
||||
#define VER_FILETYPE VFT_APP
|
||||
#include "version.rc"
|
||||
@@ -108,6 +108,9 @@
|
||||
<Project>{e76ad871-54c1-45e8-a657-6117adeffb46}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="httrack.rc" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
|
||||
5
src/libhttrack.rc
Normal file
5
src/libhttrack.rc
Normal file
@@ -0,0 +1,5 @@
|
||||
// Version resource for libhttrack.dll. See version.rc.
|
||||
#define VER_FILE_DESCRIPTION "HTTrack Website Copier engine"
|
||||
#define VER_ORIGINAL_FILENAME "libhttrack.dll"
|
||||
#define VER_FILETYPE VFT_DLL
|
||||
#include "version.rc"
|
||||
@@ -141,6 +141,9 @@
|
||||
<ClCompile Include="minizip\zip.c" />
|
||||
<ClCompile Include="punycode.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="libhttrack.rc" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
|
||||
50
src/version.rc
Normal file
50
src/version.rc
Normal file
@@ -0,0 +1,50 @@
|
||||
// Version resource for libhttrack.dll and httrack.exe. Signing enforces that every
|
||||
// binary in a release names the same product and version, so both need one.
|
||||
// Spelled out here because a VERSIONINFO cannot take a version string apart;
|
||||
// tests/01_engine-version-macros.test fails if this drifts from htsglobal.h.
|
||||
// The per-binary parts come from libhttrack.rc / httrack.rc.
|
||||
|
||||
#include <winver.h>
|
||||
|
||||
#ifndef VER_FILE_DESCRIPTION
|
||||
#define VER_FILE_DESCRIPTION "HTTrack Website Copier"
|
||||
#endif
|
||||
#ifndef VER_ORIGINAL_FILENAME
|
||||
#define VER_ORIGINAL_FILENAME ""
|
||||
#endif
|
||||
#ifndef VER_FILETYPE
|
||||
#define VER_FILETYPE VFT_APP
|
||||
#endif
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 3, 49, 12, 0
|
||||
PRODUCTVERSION 3, 49, 12, 0
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VER_FILETYPE
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0" // U.S. English, Unicode
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Xavier Roche"
|
||||
VALUE "FileDescription", VER_FILE_DESCRIPTION
|
||||
VALUE "FileVersion", "3.49.12"
|
||||
VALUE "InternalName", VER_ORIGINAL_FILENAME
|
||||
VALUE "LegalCopyright", "Copyright (C) 1998-2026 Xavier Roche and other contributors. GNU GPL v3 or later."
|
||||
VALUE "OriginalFilename", VER_ORIGINAL_FILENAME
|
||||
VALUE "ProductName", "HTTrack Website Copier"
|
||||
VALUE "ProductVersion", "3.49-12"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
64
tests/01_engine-version-macros.test
Executable file
64
tests/01_engine-version-macros.test
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# version.rc repeats the version that htsglobal.h declares. Signing enforces that
|
||||
# every binary in a release reports the same one, so a drift fails the signing
|
||||
# request on release day rather than the build. Assert the two agree.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
src="${top_srcdir:-..}/src"
|
||||
h="$src/htsglobal.h"
|
||||
rc="$src/version.rc"
|
||||
for f in "$h" "$rc"; do
|
||||
[ -f "$f" ] || {
|
||||
echo "cannot find $f"
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
|
||||
# 3.49-12 (display) and 3.49.12 (dotted).
|
||||
version=$(sed -n 's/^#define HTTRACK_VERSION[[:space:]][[:space:]]*"\([^"]*\)".*/\1/p' "$h")
|
||||
versionid=$(sed -n 's/^#define HTTRACK_VERSIONID[[:space:]][[:space:]]*"\([^"]*\)".*/\1/p' "$h")
|
||||
if [ -z "$version" ] || [ -z "$versionid" ]; then
|
||||
echo "could not read the version from $h"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The same version, as version.rc states it.
|
||||
fileversion=$(sed -n 's/^[[:space:]]*FILEVERSION[[:space:]][[:space:]]*\(.*\)$/\1/p' "$rc" | tr -d ' \r')
|
||||
productversion=$(sed -n 's/^[[:space:]]*PRODUCTVERSION[[:space:]][[:space:]]*\(.*\)$/\1/p' "$rc" | tr -d ' \r')
|
||||
rc_fileversion=$(sed -n 's/.*VALUE "FileVersion",[[:space:]]*"\([^"]*\)".*/\1/p' "$rc")
|
||||
rc_productversion=$(sed -n 's/.*VALUE "ProductVersion",[[:space:]]*"\([^"]*\)".*/\1/p' "$rc")
|
||||
rc_productname=$(sed -n 's/.*VALUE "ProductName",[[:space:]]*"\([^"]*\)".*/\1/p' "$rc")
|
||||
|
||||
# 3.49.12 -> 3,49,12,0
|
||||
expected_numeric="$(echo "$versionid" | tr '.' ','),0"
|
||||
|
||||
fail=0
|
||||
check() { # what expected actual
|
||||
if [ "$2" != "$3" ]; then
|
||||
echo "version.rc $1 is \"$3\", but htsglobal.h says it should be \"$2\""
|
||||
fail=1
|
||||
fi
|
||||
}
|
||||
check FILEVERSION "$expected_numeric" "$fileversion"
|
||||
check PRODUCTVERSION "$expected_numeric" "$productversion"
|
||||
check FileVersion "$versionid" "$rc_fileversion"
|
||||
check ProductVersion "$version" "$rc_productversion"
|
||||
|
||||
# Signing pins the product name too.
|
||||
check ProductName "HTTrack Website Copier" "$rc_productname"
|
||||
|
||||
[ "$fail" -eq 0 ] || exit 1
|
||||
|
||||
# And the shipped binary must agree with the header it was built from.
|
||||
out=$(httrack --version)
|
||||
case "$out" in
|
||||
*"$version"*) ;;
|
||||
*)
|
||||
echo "httrack --version says \"$out\", which does not mention $version"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "version resource agrees with htsglobal.h: $version ($expected_numeric)"
|
||||
@@ -68,6 +68,7 @@ TESTS = \
|
||||
01_engine-urlhack.test \
|
||||
01_engine-unescape-bounds.test \
|
||||
01_engine-useragent.test \
|
||||
01_engine-version-macros.test \
|
||||
01_engine-xfread.test \
|
||||
01_zlib-acceptencoding.test \
|
||||
01_zlib-contentcodings.test \
|
||||
|
||||
Reference in New Issue
Block a user