Skip to content

Commit b2b4dd2

Browse files
committed
Add first version of a Windows installer
1 parent b1f198a commit b2b4dd2

File tree

5 files changed

+82
-12
lines changed

5 files changed

+82
-12
lines changed

.github/workflows/windows-msys2.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,7 @@ jobs:
8585
--disable-ecasound
8686
--disable-intersense
8787
CPPFLAGS="-I/ucrt64/include -I`pwd`/../websocketpp -D_WEBSOCKETPP_CPP11_THREAD_"
88-
# TODO: move this to configure.ac:
89-
CFLAGS=-mwin32
9088
LDFLAGS=-L/ucrt64/lib
91-
# TODO: move this to configure.ac:
92-
LIBS="-lws2_32 -lwsock32 -lglu32 -lopengl32"
9389
)
9490
./configure --disable-dependency-tracking "${CONFIGURE_OPTIONS[@]}"
9591
- name: upload config.log
@@ -109,6 +105,5 @@ jobs:
109105
- name: upload installer
110106
uses: actions/upload-artifact@v3
111107
with:
112-
# TODO: upload the actual installer
113108
name: ssr-installer
114-
path: ssr/windows-installer
109+
path: "ssr/windows-installer/SoundScape Renderer * Installer.exe"

configure.ac

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ AC_CANONICAL_TARGET
5151

5252
dnl Compute the canonical host-system type variable, 'host', and its three
5353
dnl individual parts 'host_cpu', 'host_vendor', and 'host_os'.
54-
dnl AC_CANONICAL_HOST
54+
AC_CANONICAL_HOST
5555

5656
dnl Runs many macros required for proper operation of the generated Makefiles.
5757
dnl see http://sources.redhat.com/automake/automake.html#Options for options
@@ -123,6 +123,11 @@ dnl AC_DEFINE writes values in config.h
123123
dnl AC_DEFINE_UNQUOTED performs additional shell expansions, e.g. substitution
124124
dnl of variable with value.
125125

126+
127+
AS_IF([test "$host_os" = "mingw32"], [
128+
CXXFLAGS="$CXXFLAGS -mwin32"
129+
])
130+
126131
ENABLE_AUTO([all],
127132
[all renderers (use --enable-xyz to re-enable certain renderers)],
128133
[
@@ -496,6 +501,9 @@ ENABLE_FORCED([gui], [graphical user interface (using Qt)],
496501
AC_CHECK_HEADER([OpenGL/glu.h], , [have_gui=no])
497502
LIBS="$LIBS -framework OpenGL"
498503
])
504+
AS_IF([test "$host_os" = "mingw32"], [
505+
LIBS="$LIBS -lglu32 -lopengl32"
506+
])
499507
AC_SEARCH_LIBS([gluNewQuadric], [GLU], , [have_gui=no])
500508
# on some systems this is needed, on the others it doesn't hurt:
501509
AC_SEARCH_LIBS([glSelectBuffer], [GL], , [have_gui=no])
@@ -562,6 +570,13 @@ ENABLE_AUTO([fudi-interface], [FUDI interface (needs Asio and {fmt})],
562570
[have_fudi_interface=no])
563571
])
564572

573+
AS_IF([test "$host_os" = "mingw32"], [
574+
AS_IF([test x$have_ip_interface = xyes -o x$have_websocket_interface = xyes -o x$have_fudi_interface = xyes],
575+
[
576+
LIBS="$LIBS -lws2_32 -lwsock32"
577+
])
578+
])
579+
565580
ENABLE_FORCED([ecasound], [Ecasound soundfile playback/recording],
566581
[
567582
dnl Checking for libecasoundc. It does not provide pkg-config and installs
@@ -731,14 +746,14 @@ ENABLE_EXPLICIT([windows-installer], [creation of an installer for Windows],
731746
AC_CHECK_PROG([have_nsis], [nsis], [yes], [no])
732747
AC_CHECK_PROG([have_windeployqt], [windeployqt], [yes], [no])
733748
AS_IF([test x$enable_windows_installer = xyes -o x$enable_windows_installer = x],
734-
[WINDOWS_INSTALLER=SoundScapeRenderer-$PACKAGE_VERSION],
749+
[WINDOWS_INSTALLER="SoundScape Renderer $PACKAGE_VERSION Installer"],
735750
[WINDOWS_INSTALLER=$enable_windows_installer])
736751
737752
dnl WARNING: any user-specified --prefix, --bindir, ... is overwritten!
738753
dnl however, it can still be specified at make time (although kinda useless)!
739754
prefix=$(pwd)/windows-installer
740755
docdir=\${prefix}/Documentation
741-
pkgdatadir=\${prefix}/PkgData
756+
pkgdatadir=\${prefix}/data
742757
])
743758

744759
ENABLE_AUTO([browser-gui], [creation of HTML/JavaScript files for browser GUI],
@@ -772,7 +787,8 @@ AC_SUBST(DEBUGGING_FLAGS)
772787

773788
dnl List of output files generated by AC_OUTPUT from their respective *.in files
774789
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile browser-gui/Makefile])
775-
AC_CONFIG_FILES([tests/Makefile data/Makefile data/nsis/Makefile])
790+
AC_CONFIG_FILES([tests/Makefile data/Makefile])
791+
AC_CONFIG_FILES([data/nsis/Makefile data/nsis/installer-script.nsi])
776792

777793
dnl AC_OUTPUT should be the last command (except maybe some status messages)
778794
dnl It generates and runs config.status, which in turn creates the Makefiles and

data/nsis/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ install-exec-hook:
1919
## those are copied by windeployqt, but they are not needed:
2020
$(RM) -r $(DESTDIR)$(bindir)/styles
2121
$(RM) -r $(DESTDIR)$(bindir)/imageformats
22+
## this is assumed to be available on the target system:
23+
$(RM) -r $(DESTDIR)$(bindir)/libjack*.dll
2224

2325
# create Windows installer
2426
nsis:
25-
@echo "TODO: run NSIS!"
27+
cd $(DESTDIR)$(prefix) && MakeNSIS.exe -NOCD $(abs_builddir)/installer-script.nsi
2628

2729
.PHONY: nsis
2830

data/nsis/installer-script.nsi.in

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# https://nsis.sourceforge.io/Docs/
2+
3+
!define APPNAME "SoundScape Renderer @PACKAGE_VERSION@"
4+
5+
Name "${APPNAME}"
6+
7+
8+
9+
InstallDir "$PROGRAMFILES64\${APPNAME}"
10+
11+
SetCompressor lzma
12+
13+
#Page license
14+
#Page components
15+
Page directory
16+
Page instfiles
17+
18+
UninstPage uninstConfirm
19+
UninstPage instfiles
20+
21+
Section "Everything"
22+
SetOutPath $INSTDIR
23+
24+
File /r ".\bin"
25+
File /r ".\data"
26+
27+
WriteUninstaller "$INSTDIR\uninstall.exe"
28+
29+
# Set the working directory of the following Start Menu shortcuts:
30+
SetOutPath "$INSTDIR\bin"
31+
32+
CreateDirectory "$SMPROGRAMS\${APPNAME}"
33+
CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-binaural.lnk" "cmd" "/k ssr-binaural.exe"
34+
CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-brs.lnk" "cmd" "/k ssr-brs.exe"
35+
CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-wfs.lnk" "cmd" "/k ssr-wfs.exe"
36+
CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-vbap.lnk" "cmd" "/k ssr-vbap.exe"
37+
CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-aap.lnk" "cmd" "/k ssr-aap.exe"
38+
CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-dca.lnk" "cmd" "/k ssr-dca.exe"
39+
CreateShortcut "$SMPROGRAMS\${APPNAME}\ssr-generic.lnk" "cmd" "/k ssr-generic.exe"
40+
CreateShortcut "$SMPROGRAMS\${APPNAME}\uninstall.lnk" "$INSTDIR\uninstall.exe"
41+
42+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \
43+
"DisplayName" "${APPNAME}"
44+
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \
45+
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""
46+
SectionEnd
47+
48+
Section "Uninstall"
49+
RMDir /r "$INSTDIR\bin"
50+
RMDir /r "$INSTDIR\data"
51+
Delete "$INSTDIR\uninstall.exe"
52+
RMDir $INSTDIR
53+
54+
RMDir /r "$SMPROGRAMS\${APPNAME}"
55+
56+
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
57+
SectionEnd

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ AM_CPPFLAGS += -I$(srcdir)/../gml/include
2626
AM_CPPFLAGS += -I$(srcdir)/../rapidjson/include
2727

2828
if ENABLE_WINDOWS_INSTALLER
29-
AM_CPPFLAGS += -DSSR_DATA_DIR=\"../PkgData\"
29+
AM_CPPFLAGS += -DSSR_DATA_DIR=\"../data\"
3030
else
3131
AM_CPPFLAGS += -DSSR_DATA_DIR="\"$(pkgdatadir)\""
3232
endif

0 commit comments

Comments
 (0)