3 # we assume this script is <ardour-src>/tools/x-win/package.sh
4 pushd "`/usr/bin/dirname \"$0\"`" > /dev/null; this_script_dir="`pwd`"; popd > /dev/null
7 . ../define_versions.sh
9 cd $this_script_dir/../..
11 test -f gtk2_ardour/wscript || exit 1
13 # Defaults (overridden by environment)
14 : ${XARCH=i686} # or x86_64
15 : ${ROOT=/home/ardour}
18 : ${SRCCACHE=/var/tmp/winsrc} # source-code tgz cache
20 : ${HARRISONCHANNELSTRIP=harrison_channelstrip}
21 : ${HARRISONLV2=harrison_lv2s-n}
22 : ${HARRISONDSPURL=http://www.harrisonconsoles.com/plugins/releases/public}
24 # see also wscript, video_tool_paths.cc, bundle_env_mingw.cc
25 # registry keys based on this are used there
28 PROGRAM_VERSION=${major_version}
31 PRODUCT_VERSION=${major_version}
36 # TODO: grep from build/config.log instead
37 while [ $# -gt 0 ] ; do
52 PRODUCT_NAME=mixbus32c
54 PROGRAM_NAME=Mixbus32C-${PROGRAM_VERSION}
57 --chanstrip) HARRISONCHANNELSTRIP=$2 ; shift; shift ;;
62 LOWERCASE_DIRNAME=ardour${major_version}
63 STATEFILE_SUFFIX=ardour # see filename_extensions.cc
67 PRODUCT_ID=${PROGRAM_NAME}${PROGRAM_VERSION}
68 PRODUCT_EXE=${PRODUCT_NAME}.exe
69 PRODUCT_ICON=${PRODUCT_NAME}.ico
71 ###############################################################################
73 echo "Packaging $PRODUCT_ID"
75 if test "$XARCH" = "x86_64" -o "$XARCH" = "amd64"; then
76 echo "Target: 64bit Windows (x86_64)"
77 XPREFIX=x86_64-w64-mingw32
80 echo "Target: 32 Windows (i686)"
81 XPREFIX=i686-w64-mingw32
85 : ${PREFIX=${ROOT}/win-stack-$WARCH}
88 if [ "$(id -u)" = "0" ]; then
89 apt-get -y install nsis curl
94 echo "--- Downloading.. $2"
95 test -f ${SRCCACHE}/$1 || curl -k -L -o ${SRCCACHE}/$1 $2
98 ################################################################################
101 ARDOURVERSION=${release_version}
102 ARDOURDATE=$(date -R)
103 if ! test -f build/gtk2_ardour/ardour-${ARDOURVERSION}.exe; then
104 echo "*** Please compile ardour-${ARDOURVERSION}.exe first."
108 echo " === bundle to $DESTDIR"
112 ################################################################################
114 if test -z "$DESTDIR"; then
116 trap 'rm -rf $DESTDIR' exit SIGINT SIGTERM
119 echo " === bundle to $DESTDIR"
121 ALIBDIR=$DESTDIR/lib/${LOWERCASE_DIRNAME}
124 mkdir -p $DESTDIR/bin
125 mkdir -p $DESTDIR/share/
126 mkdir -p $ALIBDIR/surfaces
127 mkdir -p $ALIBDIR/backends
128 mkdir -p $ALIBDIR/panners
129 mkdir -p $ALIBDIR/vamp
130 mkdir -p $ALIBDIR/suil
132 cp build/libs/gtkmm2ext/gtkmm2ext-*.dll $DESTDIR/bin/
133 cp build/libs/midi++2/midipp-*.dll $DESTDIR/bin/
134 cp build/libs/evoral/evoral-*.dll $DESTDIR/bin/
135 cp build/libs/ardour/ardour-*.dll $DESTDIR/bin/
136 cp build/libs/timecode/timecode.dll $DESTDIR/bin/
137 cp build/libs/canvas/canvas-*.dll $DESTDIR/bin/
138 cp build/libs/pbd/pbd-*.dll $DESTDIR/bin/
139 cp build/libs/ptformat/ptformat-*.dll $DESTDIR/bin/
140 cp build/libs/audiographer/audiographer-*.dll $DESTDIR/bin/
141 cp build/libs/fst/ardour-vst-scanner.exe $DESTDIR/bin/ || true
142 cp build/session_utils/*-*.exe $DESTDIR/bin/ || true
143 cp `ls -t build/gtk2_ardour/ardour-*.exe | head -n1` $DESTDIR/bin/${PRODUCT_EXE}
145 mkdir -p $DESTDIR/lib/gtk-2.0/engines
146 cp build/libs/clearlooks-newer/clearlooks.dll $DESTDIR/lib/gtk-2.0/engines/libclearlooks.la
148 cp $PREFIX/bin/*dll $DESTDIR/bin/
149 cp $PREFIX/lib/*dll $DESTDIR/bin/
150 # special case libportaudio (wasapi), old stack has no wasapi and hence no .xp
151 cp $PREFIX/bin/libportaudio-2.xp $DESTDIR/bin/ || cp $PREFIX/bin/libportaudio-2.dll $DESTDIR/bin/libportaudio-2.xp
152 rm -rf $DESTDIR/bin/libjack*.dll
154 cp `find build/libs/surfaces/ -iname "*.dll"` $ALIBDIR/surfaces/
155 cp `find build/libs/backends/ -iname "*.dll"` $ALIBDIR/backends/
156 cp `find build/libs/panners/ -iname "*.dll"` $ALIBDIR/panners/
158 cp -r build/libs/LV2 $ALIBDIR/
159 cp -r build/libs/vamp-plugins/*ardourvampplugins*.dll $ALIBDIR/vamp/libardourvampplugins.dll
160 cp $PREFIX/lib/suil-*/*.dll $ALIBDIR/suil/ || true
162 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
163 if test -d $PREFIX/lib/lv2/lv2core.lv2 ; then
164 cp -R $PREFIX/lib/lv2/lv2core.lv2 $ALIBDIR/LV2/
167 mv $ALIBDIR/surfaces/ardourcp*.dll $DESTDIR/bin/
169 # TODO use -static-libgcc -static-libstdc++ -- but for .exe files only
170 if update-alternatives --query ${XPREFIX}-gcc | grep Value: | grep -q win32; then
171 cp /usr/lib/gcc/${XPREFIX}/*-win32/libgcc_s_*.dll $DESTDIR/bin/
172 cp /usr/lib/gcc/${XPREFIX}/*-win32/libstdc++-6.dll $DESTDIR/bin/
173 elif update-alternatives --query ${XPREFIX}-gcc | grep Value: | grep -q posix; then
174 cp /usr/lib/gcc/${XPREFIX}/*-posix/libgcc_s_*.dll $DESTDIR/bin/
175 cp /usr/lib/gcc/${XPREFIX}/*-posix/libstdc++-6.dll $DESTDIR/bin/
177 cp /usr/lib/gcc/${XPREFIX}/*/libgcc_s_sjlj-1.dll $DESTDIR/bin/
178 cp /usr/lib/gcc/${XPREFIX}/*/libstdc++-6.dll $DESTDIR/bin/
180 #Ubuntu's 14.04's mingw needs this one for the std libs above
181 if test -f /usr/${XPREFIX}/lib/libwinpthread-1.dll; then
182 cp /usr/${XPREFIX}/lib/libwinpthread-1.dll $DESTDIR/bin/
185 cp -r $PREFIX/share/${LOWERCASE_DIRNAME} $DESTDIR/share/
186 cp -r $PREFIX/share/locale $DESTDIR/share/
187 cp -r $PREFIX/etc/${LOWERCASE_DIRNAME}/* $DESTDIR/share/${LOWERCASE_DIRNAME}/
189 cp COPYING $DESTDIR/share/
190 cp gtk2_ardour/icons/${PRODUCT_ICON} $DESTDIR/share/
191 cp gtk2_ardour/icons/ardour_bug.ico $DESTDIR/share/
193 # replace default cursor with square version (sans hotspot file)
194 cp gtk2_ardour/icons/cursor_square/* $DESTDIR/share/${LOWERCASE_DIRNAME}/icons/
196 # clean build-dir after depoyment
197 echo " === bundle completed, cleaning up"
202 ################################################################################
204 if test -z "$NOVIDEOTOOLS"; then
205 echo " === Including video-tools"
206 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
207 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
209 rsync -a -q --partial \
210 rsync://ardour.org/video-tools/harvid_win-${HARVID_VERSION}.tar.xz \
211 "${SRCCACHE}/harvid_win-${HARVID_VERSION}.tar.xz"
213 rsync -a -q --partial \
214 rsync://ardour.org/video-tools/xjadeo_win-${XJADEO_VERSION}.tar.xz \
215 "${SRCCACHE}/xjadeo_win-${XJADEO_VERSION}.tar.xz"
218 tar -xf "${SRCCACHE}/harvid_win-${HARVID_VERSION}.tar.xz" -C "$DESTDIR/video/"
219 tar -xf "${SRCCACHE}/xjadeo_win-${XJADEO_VERSION}.tar.xz" -C "$DESTDIR/video/"
222 du -sh $DESTDIR/video
226 ################################################################################
227 ### include static gdb - re-zipped binaries from
228 ### http://sourceforge.net/projects/mingw/files/MinGW/Extension/gdb/gdb-7.6.1-1/gdb-7.6.1-1-mingw32-bin.tar.lzma
229 ### http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.1/threads-win32/sjlj/x86_64-4.9.1-release-win32-sjlj-rt_v3-rev1.7z
230 if ! grep " using ./waf configure" build/config.log | grep -q -- "--optimize"; then
231 download gdb-static-win3264.tar.xz http://robin.linuxaudio.org/gdb-static-win3264.tar.xz
233 tar xf gdb-static-win3264.tar.xz
236 echo " === Creating debug.bat"
237 cp -r ${SRCCACHE}/gdb_$WARCH $DESTDIR/gdb
238 cat > $DESTDIR/debug.bat << EOF
240 START ..\\gdb\\bin\\gdb.exe -iex "set logging overwrite on" -iex "set height 0" -iex "set logging on %UserProfile%\\${PRODUCT_NAME}-debug.log" -iex "target exec ${PRODUCT_EXE}" -iex "run"
242 OUTFILE="${TMPDIR}/${PRODUCT_NAME}-${ARDOURVERSION}-dbg-${WARCH}-Setup.exe"
243 VERSIONINFO="Debug Version."
245 OUTFILE="${TMPDIR}/${PRODUCT_NAME}-${ARDOURVERSION}-${WARCH}-Setup.exe"
246 VERSIONINFO="Optimized Version."
249 ################################################################################
250 ### Mixbus plugins, etc
252 mkdir -p $ALIBDIR/LV2
254 echo "Adding General MIDI Synth LV2"
256 for proj in x42-gmsynth; do
257 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/win/${proj}.latest.txt)
258 rsync -a -q --partial \
259 rsync://x42-plugins.com/x42/win/${proj}-lv2-${WARCH}-${X42_VERSION}.zip \
260 "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
261 unzip -q -d "$ALIBDIR/LV2/" "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
265 if test x$WITH_X42_LV2 != x ; then
266 mkdir -p $ALIBDIR/LV2
268 echo "Adding x42 Plugins"
270 for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums; do
271 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/win/${proj}.latest.txt)
272 rsync -a -q --partial \
273 rsync://x42-plugins.com/x42/win/${proj}-lv2-${WARCH}-${X42_VERSION}.zip \
274 "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
275 unzip -q -d "$ALIBDIR/LV2/" "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
279 if test x$WITH_HARRISON_LV2 != x ; then
280 mkdir -p $ALIBDIR/LV2
282 echo "Including Harrison LV2s"
284 curl -s -S --fail -# \
285 -z "${SRCCACHE}/${HARRISONLV2}.${WARCH}.zip" \
286 -o "${SRCCACHE}/${HARRISONLV2}.${WARCH}.zip" \
287 "${HARRISONDSPURL}/${HARRISONLV2}.${WARCH}.zip"
288 unzip -q -d "$ALIBDIR/LV2/" "${SRCCACHE}/${HARRISONLV2}.${WARCH}.zip"
291 if test -n "$MIXBUS"; then
292 echo "Deploying Harrison Mixbus Channelstrip"
294 mkdir -p $ALIBDIR/ladspa/strip
295 curl -s -S --fail -# \
296 -z "${SRCCACHE}/${HARRISONCHANNELSTRIP}.${WARCH}.dll" \
297 -o "${SRCCACHE}/${HARRISONCHANNELSTRIP}.${WARCH}.dll" \
298 "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${WARCH}.dll"
300 cp "${SRCCACHE}/${HARRISONCHANNELSTRIP}.${WARCH}.dll" \
301 "$ALIBDIR/ladspa/strip/${HARRISONCHANNELSTRIP}.dll"
303 echo "Deploying Harrison Vamp Plugins"
304 mkdir -p $ALIBDIR/vamp
305 curl -s -S --fail -# \
306 -z "${SRCCACHE}/harrison_vamp.${WARCH}.dll" \
307 -o "${SRCCACHE}/harrison_vamp.${WARCH}.dll" \
308 "${HARRISONDSPURL}/harrison_vamp.${WARCH}.dll"
310 cp "${SRCCACHE}/harrison_vamp.${WARCH}.dll" \
311 "$ALIBDIR/vamp/harrison_vamp.dll"
314 ################################################################################
316 if test x$DEMO_SESSION_URL != x ; then
317 mkdir -p $Shared/sessions
318 DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
319 for demo in $DEMO_SESSIONS; do
320 curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
324 ################################################################################
326 ( cd $DESTDIR ; find . ) > ${TMPDIR}/file_list.txt
328 ################################################################################
329 echo " === Preparing Windows Installer"
330 NSISFILE=$DESTDIR/a3.nsis
332 if test "$WARCH" = "w64"; then
337 # TODO we should only add this for 32bit on 64bit windows!
341 if test -n "$QUICKZIP" ; then
342 cat > $NSISFILE << EOF
346 cat > $NSISFILE << EOF
347 SetCompressor /SOLID lzma
348 SetCompressorDictSize 32
352 cat >> $NSISFILE << EOF
353 !addincludedir "${this_script_dir}\\nsis"
355 !include FileAssociation.nsh
358 Name "${PROGRAM_NAME}${PROGRAM_VERSION}"
360 RequestExecutionLevel admin
361 InstallDir "\$${PGF}\\${PRODUCT_ID}"
362 InstallDirRegKey HKLM "Software\\${PRODUCT_NAME}\\${PRODUCT_ID}\\$WARCH" "Install_Dir"
363 !define MUI_ICON "share\\${PRODUCT_ICON}"
367 if test -n "$MIXBUS"; then
369 # TODO: proper welcome/finish text.
370 cat >> $NSISFILE << EOF
371 !define MUI_FINISHPAGE_TITLE "Welcome to Harrison Mixbus"
372 !define MUI_FINISHPAGE_TEXT "Thanks for your purchase of Mixbus!\$\\r\$\\nYou will find the Mixbus application in the Start Menu (or the All Apps panel for Windows 8) \$\\r\$\\nClick the link below to view the Mixbus manual, and learn ways to get involved with the Mixbus community."
373 !define MUI_FINISHPAGE_LINK "Mixbus Manual"
374 !define MUI_FINISHPAGE_LINK_LOCATION "http://harrisonconsoles.com/site/${PRODUCT_NAME}-info.html"
375 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
380 cat >> $NSISFILE << EOF
381 !define MUI_FINISHPAGE_TITLE "Welcome to Ardour"
382 !define MUI_FINISHPAGE_TEXT "This windows versions or Ardour is provided as-is.\$\\r\$\\nThe Ardour community currently has no expertise in supporting windows users, and there are no developers focusing on windows specific issues either.\$\\r\$\\nIf you like Ardour, please consider helping out."
383 !define MUI_FINISHPAGE_LINK "Ardour Manual"
384 !define MUI_FINISHPAGE_LINK_LOCATION "http://manual.ardour.org/"
385 #this would run as admin - see http://forums.winamp.com/showthread.php?t=353366
386 #!define MUI_FINISHPAGE_RUN "\$INSTDIR\\bin\\${PRODUCT_EXE}"
387 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
392 cat >> $NSISFILE << EOF
393 !define MUI_ABORTWARNING
394 !insertmacro MUI_PAGE_LICENSE "share\\COPYING"
395 !insertmacro MUI_PAGE_COMPONENTS
396 !insertmacro MUI_PAGE_DIRECTORY
397 !insertmacro MUI_PAGE_INSTFILES
398 !insertmacro MUI_PAGE_FINISH
399 !insertmacro MUI_UNPAGE_CONFIRM
400 !insertmacro MUI_UNPAGE_INSTFILES
401 !insertmacro MUI_LANGUAGE "English"
403 Section "${PROGRAM_NAME}${PROGRAM_VERSION} (required)" SecMainProg
409 File /nonfatal debug.bat
410 File /nonfatal /r gdb
411 WriteRegStr HKLM "Software\\${PROGRAM_KEY}\\v${major_version}\\$WARCH" "Install_Dir" "\$INSTDIR"
412 WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "DisplayName" "${PROGRAM_NAME}${PROGRAM_VERSION}"
413 WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "UninstallString" '"\$INSTDIR\\uninstall.exe"'
414 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "NoModify" 1
415 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "NoRepair" 1
416 WriteUninstaller "\$INSTDIR\uninstall.exe"
417 CreateShortCut "\$INSTDIR\\${PROGRAM_NAME}${PROGRAM_VERSION}.lnk" "\$INSTDIR\\bin\\${PRODUCT_EXE}" "" "\$INSTDIR\\bin\\${PRODUCT_EXE}" 0
418 \${registerExtension} "\$INSTDIR\\bin\\${STATEFILE_SUFFIX}" ".${PRODUCT_NAME}" "${PROGRAM_NAME} Session"
421 Section "WASAPI sound driver" SecWASAPI
425 if test -z "$NOVIDEOTOOLS"; then
427 cat >> $NSISFILE << EOF
428 Section "Videotimeline Tools" SecVideo
429 WriteRegStr HKLM "Software\\${PROGRAM_KEY}\\v${major_version}\\video" "Install_Dir" "\$INSTDIR\\video"
437 cat >> $NSISFILE << EOF
438 Section "Start Menu Shortcuts" SecMenu
439 SetShellVarContext all
440 CreateDirectory "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}"
441 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\${PROGRAM_NAME}${PROGRAM_VERSION}.lnk" "\$INSTDIR\\bin\\${PRODUCT_EXE}" "" "\$INSTDIR\\bin\\${PRODUCT_EXE}" 0
444 if test -f "$DESTDIR/debug.bat"; then
445 cat >> $NSISFILE << EOF
446 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\${PROGRAM_NAME}${PROGRAM_VERSION} GDB.lnk" "\$INSTDIR\\debug.bat" "" "\$INSTDIR\\share\\ardour_bug.ico" 0
450 if test -z "$NOVIDEOTOOLS"; then
451 cat >> $NSISFILE << EOF
452 IfFileExists "\$INSTDIR\\video\\xjadeo\\xjadeo.exe" 0 +2
453 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\Video Monitor.lnk" "\$INSTDIR\\video\\xjadeo\\xjadeo.exe" "" "\$INSTDIR\\video\\xjadeo\\xjadeo.exe" 0
457 cat >> $NSISFILE << EOF
458 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0
460 LangString DESC_SecMainProg \${LANG_ENGLISH} "${PROGRAM_NAME} ${ARDOURVERSION}\$\\r\$\\n${VERSIONINFO}\$\\r\$\\n${ARDOURDATE}"
461 LangString DESC_SecWASAPI \${LANG_ENGLISH} "WASAPI Audio Driver\$\\r\$\\nOnly works on Vista or later. Windows 10 Users may currently also experience issues if this is installed."
464 if test -z "$NOVIDEOTOOLS"; then
465 cat >> $NSISFILE << EOF
466 LangString DESC_SecVideo \${LANG_ENGLISH} "Video Tools\$\\r\$\\nxjadeo-${XJADEO_VERSION}\$\\r\$\\nharvid-${HARVID_VERSION}"
470 cat >> $NSISFILE << EOF
471 LangString DESC_SecMenu \${LANG_ENGLISH} "Create Start-Menu Shortcuts (recommended)."
472 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
473 !insertmacro MUI_DESCRIPTION_TEXT \${SecMainProg} \$(DESC_SecMainProg)
474 !insertmacro MUI_DESCRIPTION_TEXT \${SecWASAPI} \$(DESC_SecWASAPI)
477 if test -z "$NOVIDEOTOOLS"; then
478 cat >> $NSISFILE << EOF
479 !insertmacro MUI_DESCRIPTION_TEXT \${SecVideo} \$(DESC_SecVideo)
483 cat >> $NSISFILE << EOF
484 !insertmacro MUI_DESCRIPTION_TEXT \${SecMenu} \$(DESC_SecMenu)
485 !insertmacro MUI_FUNCTION_DESCRIPTION_END
487 SetShellVarContext all
488 DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}"
489 DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}"
490 DeleteRegKey HKLM "Software\\${PROGRAM_KEY}\\v${major_version}"
491 RMDir /r "\$INSTDIR\\bin"
492 RMDir /r "\$INSTDIR\\lib"
493 RMDir /r "\$INSTDIR\\share"
494 RMDir /r "\$INSTDIR\\gdb"
495 RMDir /r "\$INSTDIR\\video"
496 Delete "\$INSTDIR\\debug.bat"
497 Delete "\$INSTDIR\\uninstall.exe"
498 Delete "\$INSTDIR\\${PROGRAM_NAME}${PROGRAM_VERSION}.lnk"
500 Delete "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\*.*"
501 RMDir "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}"
502 \${unregisterExtension} ".${STATEFILE_SUFFIX}" "${PROGRAM_NAME} Session"
508 ReadRegStr \$R0 HKLM \
509 "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" \
513 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
514 "${PROGRAM_NAME} is already installed. Click 'OK' to remove the previous version or 'Cancel' to cancel this upgrade." \
520 ExecWait '\$R0 _?=\$INSTDIR'
521 IfErrors uninstall_error
523 ReadRegStr \$R1 HKLM \
524 "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" \
526 StrCmp \$R1 "" 0 done
528 Delete "\$INSTDIR\\uninstall.exe"
534 MessageBox MB_OK|MB_ICONEXCLAMATION \
535 "Uninstaller did not complete successfully. Continue at your own risk..." \
540 \${If} \${AtMostWinXP}
541 SectionSetFlags \${SecWASAPI} \${SF_RO}
543 SectionSetFlags \${SecWASAPI} \${SF_SELECTED}
548 Function .onInstSuccess
550 \${If} \${AtMostWinXP}
554 SectionGetFlags \${SecWASAPI} \$R0
556 IntOp \$R0 \$R0 & \${SF_SELECTED}
557 IntCmp \$R0 \${SF_SELECTED} pa_with_wasapi pa_no_wasapi
560 ; VISTA .. 9, libportaudio with WASAPI is good.
561 Delete "\$INSTDIR\\bin\\libportaudio-2.xp"
564 ; Windows XP lacks support for WASAPI, Windows10 on some system has issues
565 ; http://tracker.ardour.org/view.php?id=6507
567 Delete "\$INSTDIR\\bin\\libportaudio-2.dll"
568 Rename "\$INSTDIR\\bin\\libportaudio-2.xp" "\$INSTDIR\\bin\\libportaudio-2.dll"
576 echo " === OutFile: $OUTFILE"
578 if test -n "$QUICKZIP" ; then
579 echo " === Building Windows Installer (fast zip)"
581 echo " === Building Windows Installer (lzma compression takes ages)"
583 time makensis -V2 $NSISFILE