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

Fix and improve Windows installer #4348

Merged
merged 5 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
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
54 changes: 0 additions & 54 deletions .github/workflows/pkg-config-crosswrapper

This file was deleted.

10 changes: 5 additions & 5 deletions nsis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ PKG_ARCH=mingw-w64-${ARCH/_/-}
# Install packages.
sudo apt-get update --quiet
sudo apt-get install --assume-yes --no-install-recommends --quiet \
asciidoc xsltproc docbook-xml docbook-xsl \
asciidoc curl xsltproc docbook-xml docbook-xsl \
automake dpkg-dev libtool pkg-config default-jdk-headless \
mingw-w64-tools nsis g++-"$PKG_ARCH" \
makepkg pacman-package-manager
makepkg pacman-package-manager python3-venv unzip

# Configure pacman.

Expand Down Expand Up @@ -76,8 +76,6 @@ sudo pacman -S --noconfirm \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-libwebp

sudo ln -sf "$PWD/.github/workflows/pkg-config-crosswrapper" "/usr/bin/$HOST-pkg-config"

git config --global user.email "[email protected]"
git config --global user.name "Stefan Weil"
git tag -a "v$TAG" -m "Tesseract $TAG"
Expand All @@ -99,12 +97,14 @@ export PKG_CONFIG_PATH

make all training
MINGW_INSTALL=${PWD}${MINGW}
make install-jars install training-install html prefix="$MINGW_INSTALL"
make install-jars install training-install html prefix="$MINGW_INSTALL" INSTALL_STRIP_FLAG=-s
test -d venv || python3 -m venv venv
source venv/bin/activate
pip install pefile
mkdir -p dll
ln -sv $("$ROOTDIR/nsis/find_deps.py" "$MINGW_INSTALL"/bin/*.exe "$MINGW_INSTALL"/bin/*.dll) dll/
ln -svf /usr/lib/gcc/x86_64-w64-mingw32/*-win32/libstdc++-6.dll dll/
ln -svf /usr/lib/gcc/x86_64-w64-mingw32/*-win32/libgcc_s_seh-1.dll dll/
make winsetup prefix="$MINGW_INSTALL"

# Copy result for upload.
Expand Down
8 changes: 4 additions & 4 deletions nsis/tesseract.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ OutFile ${OUTFILE}
!ifndef PREFIX
!define PREFIX "../mingw64"
!endif
!define TRAININGDIR "${PREFIX}/bin"
!define BINDIR "${PREFIX}/bin"

# General Definitions
Name "${PRODUCT_NAME}"
Expand Down Expand Up @@ -202,8 +202,8 @@ Section -Main SEC0000
SectionIn RO
SetOutPath "$INSTDIR"
# files included in distribution
File ${PREFIX}/bin/tesseract.exe
File ${PREFIX}/bin/libtesseract-*.dll
File ${BINDIR}/tesseract.exe
File ${BINDIR}/libtesseract-*.dll
!ifdef CROSSBUILD
File ../dll/*.dll
!endif
Expand Down Expand Up @@ -236,7 +236,7 @@ SectionEnd
Section "Training Tools" SecTr
SectionIn 1
SetOutPath "$INSTDIR"
File ${TRAININGDIR}\*.exe
File /x tesseract.exe ${BINDIR}/*.exe
SectionEnd

!define UNINST_EXE "$INSTDIR\tesseract-uninstall.exe"
Expand Down