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

windows-installer #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
46 changes: 12 additions & 34 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ name: Building for Windows
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
tags:
- '*' # Push events to every tag not containing /

branches:
- '*'
env:
DEB_DH_SHLIBDEPS_ARGS_ALL: "--dpkg-shlibdeps-params=--ignore-missing-info"

Expand All @@ -28,42 +27,21 @@ jobs:
mkdir -p distribute/win/3rdparty

- name: Regenerate common ./configure script
run: ./autogen.sh

- name: Cross-compile and make installer for Win32
run: |
mingw32-configure --without-magick --without-pstoedit
make

# Install dependencies
for dll in iconv.dll libffi-8.dll libgcc_s_dw2-1.dll libglib-2.0-0.dll libgobject-2.0-0.dll libintl-8.dll libpcre2-8-0.dll libpng16-16.dll libwinpthread-1.dll zlib1.dll
do
cp -afv /usr/i686-w64-mingw32/sys-root/mingw/bin/$dll distribute/win/3rdparty/$dll
done

makensis -DVERSION=${{ github.ref_name }}-$(date +%Y%m%d) -DFLAVOUR=win32 distribute/win/autotrace.nsi
ls -la distribute/win
run: sh autogen.sh

- name: Cross-compile and make installer for Win64
run: |
mingw64-configure --without-magick --without-pstoedit
make
makensis -DVERSION=$(date +%Y%m%d) -DFLAVOUR=win64 distribute/win/autotrace.nsi

# Install dependencies
for dll in iconv.dll libffi-8.dll libglib-2.0-0.dll libgobject-2.0-0.dll libintl-8.dll libpcre2-8-0.dll libpng16-16.dll zlib1.dll
do
cp -afv /usr/x86_64-w64-mingw32/sys-root/mingw/bin/$dll distribute/win/3rdparty/$dll
done

makensis -DVERSION=${{ github.ref_name }}-$(date +%Y%m%d) -DFLAVOUR=win32 distribute/win/autotrace.nsi
ls -la distribute/win
- name: Cross-compile and make installer for Win32
run: |
mingw32-configure --without-magick --without-pstoedit
make -B
makensis -DVERSION=$(date +%Y%m%d) -DFLAVOUR=win32 distribute/win/autotrace.nsi

- uses: svenstaro/upload-release-action@v2
- uses: actions/upload-artifact@v4.3.0
with:
file_glob: true
file: distribute/win/autotrace-*-setup.exe

# - uses: actions/upload-artifact@v4.3.0
# with:
# name: windows-installers
# path: distribute/win/autotrace-*-setup.exe
name: win32-installer
path: distribute/win/autotrace-*-setup.exe
43 changes: 30 additions & 13 deletions distribute/win/autotrace.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ OutFile "autotrace-${VERSION}-${FLAVOUR}-setup.exe"
; The default installation directory
;InstallDir $EXEDIR
; Do not use PROGRAMFILES, that is for 32bit code only!
InstallDir $PROGRAMFILES64\AutoTrace
!If ${FLAVOUR} == "win64"
Target amd64-unicode
InstallDir $PROGRAMFILES64\AutoTrace
!endif
!If ${FLAVOUR} == "win32"
Target x86-unicode
InstallDir $PROGRAMFILES\AutoTrace
!endif

; Request application privileges for Windows Vista
; RequestExecutionLevel user
Expand All @@ -47,20 +54,30 @@ Section "" ;No components page, name is not important
SetOutPath $INSTDIR

; Put file there
File /oname=autotrace.exe "../../autotrace.exe"
File /oname=iconv.dll "3rdparty/iconv.dll"
File /oname=libffi-8.dll "3rdparty/libffi-8.dll"
!If ${FLAVOUR} == "win32"
File /oname=libgcc_s_dw2-1.dll "3rdparty/libgcc_s_dw2-1.dll"
File /oname=autotrace.exe "../../.libs/autotrace.exe"
!If ${FLAVOUR} == "win64"
File /oname=iconv.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/iconv.dll"
File /oname=libffi-8.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libffi-8.dll"
File /oname=libglib-2.0-0.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libglib-2.0-0.dll"
File /oname=libgobject-2.0-0.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libgobject-2.0-0.dll"
File /oname=libintl-8.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libintl-8.dll"
File /oname=libpcre2-8-0.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libpcre2-8-0.dll"
File /oname=libpng16-16.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libpng16-16.dll"
File /oname=libssp-0.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libssp-0.dll"
File /oname=zlib1.dll "/usr/x86_64-w64-mingw32/sys-root/mingw/bin/zlib1.dll"
!EndIf
File /oname=libglib-2.0-0.dll "3rdparty/libglib-2.0-0.dll"
File /oname=libgobject-2.0-0.dll "3rdparty/libgobject-2.0-0.dll"
File /oname=libintl-8.dll "3rdparty/libintl-8.dll"
File /oname=libpcre2-8-0.dll "3rdparty/libpcre2-8-0.dll"
File /oname=libpng16-16.dll "3rdparty/libpng16-16.dll"
!If ${FLAVOUR} == "win32"
File /oname=libwinpthread-1.dll "3rdparty/libwinpthread-1.dll"
File /oname=iconv.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/iconv.dll"
File /oname=libffi-8.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libffi-8.dll"
File /oname=libglib-2.0-0.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libglib-2.0-0.dll"
File /oname=libgobject-2.0-0.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libgobject-2.0-0.dll"
File /oname=libintl-8.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libintl-8.dll"
File /oname=libpcre2-8-0.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libpcre2-8-0.dll"
File /oname=libpng16-16.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libpng16-16.dll"
File /oname=libssp-0.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libssp-0.dll"
File /oname=zlib1.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/zlib1.dll"
File /oname=libgcc_s_dw2-1.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libgcc_s_dw2-1.dll"
File /oname=libwinpthread-1.dll "/usr/i686-w64-mingw32/sys-root/mingw/bin/libwinpthread-1.dll"
!EndIf
File /oname=zlib1.dll "3rdparty/zlib1.dll"

SectionEnd ; end the section