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=https://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
47 MANUAL_NAME="mixbus${major_version}-live-manual"
53 PRODUCT_NAME=Mixbus32C
55 PROGRAM_NAME=Mixbus32C-${PROGRAM_VERSION}
57 MANUAL_NAME="mixbus32c-${major_version}-live-manual"
59 --chanstrip) HARRISONCHANNELSTRIP=$2 ; shift; shift ;;
64 LOWERCASE_DIRNAME=ardour${major_version}
65 STATEFILE_SUFFIX=ardour # see filename_extensions.cc
69 PRODUCT_ID=${PROGRAM_NAME}${PROGRAM_VERSION}
70 PRODUCT_EXE=${PRODUCT_NAME}.exe
71 PRODUCT_ICON=${PRODUCT_NAME}.ico
73 ###############################################################################
75 echo "Packaging $PRODUCT_ID"
77 if test "$XARCH" = "x86_64" -o "$XARCH" = "amd64"; then
78 echo "Target: 64bit Windows (x86_64)"
79 XPREFIX=x86_64-w64-mingw32
82 echo "Target: 32 Windows (i686)"
83 XPREFIX=i686-w64-mingw32
87 : ${PREFIX=${ROOT}/win-stack-$WARCH}
90 if [ "$(id -u)" = "0" ]; then
91 apt-get -y install nsis curl
96 echo "--- Downloading.. $2"
97 test -f ${SRCCACHE}/$1 || curl -k -L -o ${SRCCACHE}/$1 $2
100 ################################################################################
103 ARDOURVERSION=${release_version}
104 ARDOURDATE=$(date -R)
105 if ! test -f build/gtk2_ardour/ardour-${ARDOURVERSION}.exe; then
106 echo "*** Please compile ardour-${ARDOURVERSION}.exe first."
110 echo " === bundle to $DESTDIR"
114 ################################################################################
116 if test -z "$DESTDIR"; then
118 trap 'rm -rf $DESTDIR' exit SIGINT SIGTERM
121 echo " === bundle to $DESTDIR"
123 ALIBDIR=$DESTDIR/lib/${LOWERCASE_DIRNAME}
126 mkdir -p $DESTDIR/bin
127 mkdir -p $DESTDIR/share/
128 mkdir -p $ALIBDIR/surfaces
129 mkdir -p $ALIBDIR/backends
130 mkdir -p $ALIBDIR/panners
131 mkdir -p $ALIBDIR/vamp
132 mkdir -p $ALIBDIR/suil
134 cp build/libs/gtkmm2ext/gtkmm2ext-*.dll $DESTDIR/bin/
135 cp build/libs/midi++2/midipp-*.dll $DESTDIR/bin/
136 cp build/libs/evoral/evoral-*.dll $DESTDIR/bin/
137 cp build/libs/ardour/ardour-*.dll $DESTDIR/bin/
138 cp build/libs/temporal/temporal-*.dll $DESTDIR/bin/
139 cp build/libs/canvas/canvas-*.dll $DESTDIR/bin/
140 cp build/libs/widgets/widgets-*.dll $DESTDIR/bin/
141 cp build/libs/waveview/waveview-*.dll $DESTDIR/bin/
142 cp build/libs/pbd/pbd-*.dll $DESTDIR/bin/
143 cp build/libs/ptformat/ptformat-*.dll $DESTDIR/bin/
144 cp build/libs/audiographer/audiographer-*.dll $DESTDIR/bin/
145 cp build/libs/fst/ardour-vst-scanner.exe $DESTDIR/bin/ || true
146 cp build/session_utils/*-*.exe $DESTDIR/bin/ || true
147 cp `ls -t build/gtk2_ardour/ardour-*.exe | head -n1` $DESTDIR/bin/${PRODUCT_EXE}
149 mkdir -p $DESTDIR/lib/gtk-2.0/engines
150 cp build/libs/clearlooks-newer/clearlooks.dll $DESTDIR/lib/gtk-2.0/engines/libclearlooks.la
152 cp $PREFIX/bin/*dll $DESTDIR/bin/
153 cp $PREFIX/lib/*dll $DESTDIR/bin/
154 # special case libportaudio (wasapi), old stack has no wasapi and hence no .xp
155 cp $PREFIX/bin/libportaudio-2.xp $DESTDIR/bin/ || cp $PREFIX/bin/libportaudio-2.dll $DESTDIR/bin/libportaudio-2.xp
156 rm -rf $DESTDIR/bin/libjack*.dll
158 cp `find build/libs/surfaces/ -iname "*.dll"` $ALIBDIR/surfaces/
159 cp `find build/libs/backends/ -iname "*.dll"` $ALIBDIR/backends/
160 cp `find build/libs/panners/ -iname "*.dll"` $ALIBDIR/panners/
162 cp -r build/libs/LV2 $ALIBDIR/
163 cp -r build/libs/vamp-plugins/*ardourvampplugins*.dll $ALIBDIR/vamp/libardourvampplugins.dll
164 cp $PREFIX/lib/suil-*/*.dll $ALIBDIR/suil/ || true
166 # lv2 core, classifications etc - TODO check if we need the complete LV2 ontology
167 if test -d $PREFIX/lib/lv2/lv2core.lv2 ; then
168 cp -R $PREFIX/lib/lv2/lv2core.lv2 $ALIBDIR/LV2/
171 mv $ALIBDIR/surfaces/ardourcp*.dll $DESTDIR/bin/
173 # TODO use -static-libgcc -static-libstdc++ -- but for .exe files only
174 if update-alternatives --query ${XPREFIX}-gcc | grep Value: | grep -q win32; then
175 cp /usr/lib/gcc/${XPREFIX}/*-win32/libgcc_s_*.dll $DESTDIR/bin/
176 cp /usr/lib/gcc/${XPREFIX}/*-win32/libstdc++-6.dll $DESTDIR/bin/
177 elif update-alternatives --query ${XPREFIX}-gcc | grep Value: | grep -q posix; then
178 cp /usr/lib/gcc/${XPREFIX}/*-posix/libgcc_s_*.dll $DESTDIR/bin/
179 cp /usr/lib/gcc/${XPREFIX}/*-posix/libstdc++-6.dll $DESTDIR/bin/
181 cp /usr/lib/gcc/${XPREFIX}/*/libgcc_s_sjlj-1.dll $DESTDIR/bin/
182 cp /usr/lib/gcc/${XPREFIX}/*/libstdc++-6.dll $DESTDIR/bin/
184 #Ubuntu's 14.04's mingw needs this one for the std libs above
185 if test -f /usr/${XPREFIX}/lib/libwinpthread-1.dll; then
186 cp /usr/${XPREFIX}/lib/libwinpthread-1.dll $DESTDIR/bin/
189 cp -r $PREFIX/share/${LOWERCASE_DIRNAME} $DESTDIR/share/
190 cp -r $PREFIX/share/locale $DESTDIR/share/
191 cp -r $PREFIX/etc/${LOWERCASE_DIRNAME}/* $DESTDIR/share/${LOWERCASE_DIRNAME}/
193 cp COPYING $DESTDIR/share/
194 cp gtk2_ardour/icons/${PRODUCT_ICON} $DESTDIR/share/
195 cp gtk2_ardour/icons/ArdourBug.ico $DESTDIR/share/
197 # replace default cursor with square version (sans hotspot file)
198 cp gtk2_ardour/icons/cursor_square/* $DESTDIR/share/${LOWERCASE_DIRNAME}/icons/
200 # clean build-dir after depoyment
201 echo " === bundle completed, cleaning up"
206 ################################################################################
208 if test -z "$NOVIDEOTOOLS"; then
209 echo " === Including video-tools"
210 HARVID_VERSION=$(curl -s -S http://ardour.org/files/video-tools/harvid_version.txt)
211 XJADEO_VERSION=$(curl -s -S http://ardour.org/files/video-tools/xjadeo_version.txt)
213 rsync -a -q --partial \
214 rsync://ardour.org/video-tools/harvid_${WARCH}-${HARVID_VERSION}.tar.xz \
215 "${SRCCACHE}/harvid_${WARCH}-${HARVID_VERSION}.tar.xz"
217 rsync -a -q --partial \
218 rsync://ardour.org/video-tools/xjadeo_${WARCH}-${XJADEO_VERSION}.tar.xz \
219 "${SRCCACHE}/xjadeo_${WARCH}-${XJADEO_VERSION}.tar.xz"
222 tar -xf "${SRCCACHE}/harvid_${WARCH}-${HARVID_VERSION}.tar.xz" -C "$DESTDIR/video/"
223 tar -xf "${SRCCACHE}/xjadeo_${WARCH}-${XJADEO_VERSION}.tar.xz" -C "$DESTDIR/video/"
226 du -sh $DESTDIR/video
230 ################################################################################
231 ### include static gdb - re-zipped binaries from
232 ### http://sourceforge.net/projects/mingw/files/MinGW/Extension/gdb/gdb-7.6.1-1/gdb-7.6.1-1-mingw32-bin.tar.lzma
233 ### 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
234 if ! grep " using ./waf configure" build/config.log | grep -q -- "--optimize"; then
235 download gdb-static-win3264.tar.xz http://robin.linuxaudio.org/gdb-static-win3264.tar.xz
237 tar xf gdb-static-win3264.tar.xz
240 echo " === Creating debug.bat"
241 cp -r ${SRCCACHE}/gdb_$WARCH $DESTDIR/gdb
242 cat > $DESTDIR/debug.bat << EOF
244 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"
246 OUTFILE="${TMPDIR}/${PRODUCT_NAME}-${ARDOURVERSION}-dbg-${WARCH}-Setup.exe"
247 VERSIONINFO="Debug Version."
249 OUTFILE="${TMPDIR}/${PRODUCT_NAME}-${ARDOURVERSION}-${WARCH}-Setup.exe"
250 VERSIONINFO="Optimized Version."
253 ################################################################################
254 ### Mixbus plugins, etc
256 mkdir -p $ALIBDIR/LV2
258 echo "Adding General MIDI Synth LV2"
260 for proj in x42-gmsynth; do
261 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/win/${proj}.latest.txt)
262 rsync -a -q --partial \
263 rsync://x42-plugins.com/x42/win/${proj}-lv2-${WARCH}-${X42_VERSION}.zip \
264 "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
265 unzip -q -d "$ALIBDIR/LV2/" "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
269 if test x$WITH_X42_LV2 != x ; then
270 mkdir -p $ALIBDIR/LV2
272 echo "Adding x42 Plugins"
274 for proj in x42-meters x42-midifilter x42-midimap x42-stereoroute x42-eq setBfree x42-avldrums x42-whirl x42-limiter; do
275 X42_VERSION=$(curl -s -S http://x42-plugins.com/x42/win/${proj}.latest.txt)
276 rsync -a -q --partial \
277 rsync://x42-plugins.com/x42/win/${proj}-lv2-${WARCH}-${X42_VERSION}.zip \
278 "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
279 unzip -q -d "$ALIBDIR/LV2/" "${SRCCACHE}/${proj}-lv2-${WARCH}-${X42_VERSION}.zip"
283 if test x$WITH_HARRISON_LV2 != x ; then
284 mkdir -p $ALIBDIR/LV2
286 echo "Including Harrison LV2s"
288 curl -s -S --fail -# \
289 -z "${SRCCACHE}/${HARRISONLV2}.${WARCH}.zip" \
290 -o "${SRCCACHE}/${HARRISONLV2}.${WARCH}.zip" \
291 "${HARRISONDSPURL}/${HARRISONLV2}.${WARCH}.zip"
292 unzip -q -d "$ALIBDIR/LV2/" "${SRCCACHE}/${HARRISONLV2}.${WARCH}.zip"
295 if test -n "$MIXBUS"; then
296 echo "Deploying Harrison Mixbus Channelstrip"
298 mkdir -p $ALIBDIR/ladspa/strip
299 curl -s -S --fail -# \
300 -z "${SRCCACHE}/${HARRISONCHANNELSTRIP}.${WARCH}.dll" \
301 -o "${SRCCACHE}/${HARRISONCHANNELSTRIP}.${WARCH}.dll" \
302 "${HARRISONDSPURL}/${HARRISONCHANNELSTRIP}.${WARCH}.dll"
304 cp "${SRCCACHE}/${HARRISONCHANNELSTRIP}.${WARCH}.dll" \
305 "$ALIBDIR/ladspa/strip/${HARRISONCHANNELSTRIP}.dll"
307 echo "Deploying Harrison Vamp Plugins"
308 mkdir -p $ALIBDIR/vamp
309 curl -s -S --fail -# \
310 -z "${SRCCACHE}/harrison_vamp.${WARCH}.dll" \
311 -o "${SRCCACHE}/harrison_vamp.${WARCH}.dll" \
312 "${HARRISONDSPURL}/harrison_vamp.${WARCH}.dll"
314 cp "${SRCCACHE}/harrison_vamp.${WARCH}.dll" \
315 "$ALIBDIR/vamp/harrison_vamp.dll"
318 ################################################################################
320 if test x$DEMO_SESSION_URL != x ; then
321 mkdir -p $Shared/sessions
322 DEMO_SESSIONS=$(curl -s -S --fail $DEMO_SESSION_URL/index.txt)
323 for demo in $DEMO_SESSIONS; do
324 curl -s -S --fail -# -o $Shared/sessions/$demo $DEMO_SESSION_URL/$demo
328 ################################################################################
330 ( cd $DESTDIR ; find . ) > ${TMPDIR}/file_list.txt
332 ################################################################################
333 echo " === Preparing Windows Installer"
334 NSISFILE=$DESTDIR/a3.nsis
336 if test "$WARCH" = "w64"; then
341 # TODO we should only add this for 32bit on 64bit windows!
345 if test -n "$QUICKZIP" ; then
346 cat > $NSISFILE << EOF
350 cat > $NSISFILE << EOF
351 SetCompressor /SOLID lzma
352 SetCompressorDictSize 32
356 cat >> $NSISFILE << EOF
357 !addincludedir "${this_script_dir}\\nsis"
359 !include FileAssociation.nsh
362 Name "${PROGRAM_NAME}${PROGRAM_VERSION}"
364 RequestExecutionLevel admin
365 InstallDir "\$${PGF}\\${PRODUCT_ID}"
366 InstallDirRegKey HKLM "Software\\${PRODUCT_NAME}\\${PRODUCT_ID}\\$WARCH" "Install_Dir"
367 !define MUI_ICON "share\\${PRODUCT_ICON}"
371 if test -n "$MIXBUS"; then
373 # TODO: proper welcome/finish text.
374 cat >> $NSISFILE << EOF
375 !define MUI_FINISHPAGE_TITLE "Welcome to Harrison Mixbus"
376 !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."
377 !define MUI_FINISHPAGE_LINK "Mixbus Manual"
378 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.harrisonconsoles.com/mixbus/${MANUAL_NAME}/"
379 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
384 cat >> $NSISFILE << EOF
385 !define MUI_FINISHPAGE_TITLE "Welcome to Ardour"
386 !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."
387 !define MUI_FINISHPAGE_LINK "Ardour Manual"
388 !define MUI_FINISHPAGE_LINK_LOCATION "http://manual.ardour.org/"
389 #this would run as admin - see http://forums.winamp.com/showthread.php?t=353366
390 #!define MUI_FINISHPAGE_RUN "\$INSTDIR\\bin\\${PRODUCT_EXE}"
391 !define MUI_FINISHPAGE_NOREBOOTSUPPORT
396 cat >> $NSISFILE << EOF
397 !define MUI_ABORTWARNING
398 !insertmacro MUI_PAGE_LICENSE "share\\COPYING"
399 !insertmacro MUI_PAGE_COMPONENTS
400 !insertmacro MUI_PAGE_DIRECTORY
401 !insertmacro MUI_PAGE_INSTFILES
402 !insertmacro MUI_PAGE_FINISH
403 !insertmacro MUI_UNPAGE_CONFIRM
404 !insertmacro MUI_UNPAGE_INSTFILES
405 !insertmacro MUI_LANGUAGE "English"
407 Section "${PROGRAM_NAME}${PROGRAM_VERSION} (required)" SecMainProg
413 File /nonfatal debug.bat
414 File /nonfatal /r gdb
415 WriteRegStr HKLM "Software\\${PROGRAM_KEY}\\v${major_version}\\$WARCH" "Install_Dir" "\$INSTDIR"
416 WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "DisplayName" "${PROGRAM_NAME}${PROGRAM_VERSION}"
417 WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "UninstallString" '"\$INSTDIR\\uninstall.exe"'
418 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "NoModify" 1
419 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" "NoRepair" 1
420 WriteUninstaller "\$INSTDIR\uninstall.exe"
421 CreateShortCut "\$INSTDIR\\${PROGRAM_NAME}${PROGRAM_VERSION}.lnk" "\$INSTDIR\\bin\\${PRODUCT_EXE}" "" "\$INSTDIR\\bin\\${PRODUCT_EXE}" 0
422 \${registerExtension} "\$INSTDIR\\bin\\${STATEFILE_SUFFIX}" ".${PRODUCT_NAME}" "${PROGRAM_NAME} Session"
425 Section "WASAPI sound driver" SecWASAPI
429 if test -z "$NOVIDEOTOOLS"; then
431 cat >> $NSISFILE << EOF
432 Section "Videotimeline Tools" SecVideo
433 WriteRegStr HKLM "Software\\${PROGRAM_KEY}\\v${major_version}\\video" "Install_Dir" "\$INSTDIR\\video"
441 cat >> $NSISFILE << EOF
442 Section "Start Menu Shortcuts" SecMenu
443 SetShellVarContext all
444 CreateDirectory "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}"
445 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\${PROGRAM_NAME}${PROGRAM_VERSION}.lnk" "\$INSTDIR\\bin\\${PRODUCT_EXE}" "" "\$INSTDIR\\bin\\${PRODUCT_EXE}" 0
448 if test -f "$DESTDIR/debug.bat"; then
449 cat >> $NSISFILE << EOF
450 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\${PROGRAM_NAME}${PROGRAM_VERSION} GDB.lnk" "\$INSTDIR\\debug.bat" "" "\$INSTDIR\\share\\ArdourBug.ico" 0
454 if test -z "$NOVIDEOTOOLS"; then
455 cat >> $NSISFILE << EOF
456 IfFileExists "\$INSTDIR\\video\\xjadeo\\xjadeo.exe" 0 +2
457 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\Video Monitor.lnk" "\$INSTDIR\\video\\xjadeo\\xjadeo.exe" "" "\$INSTDIR\\video\\xjadeo\\xjadeo.exe" 0
461 cat >> $NSISFILE << EOF
462 CreateShortCut "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0
464 LangString DESC_SecMainProg \${LANG_ENGLISH} "${PROGRAM_NAME} ${ARDOURVERSION}\$\\r\$\\n${VERSIONINFO}\$\\r\$\\n${ARDOURDATE}"
465 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."
468 if test -z "$NOVIDEOTOOLS"; then
469 cat >> $NSISFILE << EOF
470 LangString DESC_SecVideo \${LANG_ENGLISH} "Video Tools\$\\r\$\\nxjadeo-${XJADEO_VERSION}\$\\r\$\\nharvid-${HARVID_VERSION}"
474 cat >> $NSISFILE << EOF
475 LangString DESC_SecMenu \${LANG_ENGLISH} "Create Start-Menu Shortcuts (recommended)."
476 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
477 !insertmacro MUI_DESCRIPTION_TEXT \${SecMainProg} \$(DESC_SecMainProg)
478 !insertmacro MUI_DESCRIPTION_TEXT \${SecWASAPI} \$(DESC_SecWASAPI)
481 if test -z "$NOVIDEOTOOLS"; then
482 cat >> $NSISFILE << EOF
483 !insertmacro MUI_DESCRIPTION_TEXT \${SecVideo} \$(DESC_SecVideo)
487 cat >> $NSISFILE << EOF
488 !insertmacro MUI_DESCRIPTION_TEXT \${SecMenu} \$(DESC_SecMenu)
489 !insertmacro MUI_FUNCTION_DESCRIPTION_END
491 SetShellVarContext all
492 DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}"
493 DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}"
494 DeleteRegKey HKLM "Software\\${PROGRAM_KEY}\\v${major_version}"
495 RMDir /r "\$INSTDIR\\bin"
496 RMDir /r "\$INSTDIR\\lib"
497 RMDir /r "\$INSTDIR\\share"
498 RMDir /r "\$INSTDIR\\gdb"
499 RMDir /r "\$INSTDIR\\video"
500 Delete "\$INSTDIR\\debug.bat"
501 Delete "\$INSTDIR\\uninstall.exe"
502 Delete "\$INSTDIR\\${PROGRAM_NAME}${PROGRAM_VERSION}.lnk"
504 Delete "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}\\*.*"
505 RMDir "\$SMPROGRAMS\\${PRODUCT_ID}${SFX}"
506 \${unregisterExtension} ".${STATEFILE_SUFFIX}" "${PROGRAM_NAME} Session"
512 ReadRegStr \$R0 HKLM \
513 "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" \
517 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
518 "${PROGRAM_NAME} is already installed. Click 'OK' to remove the previous version or 'Cancel' to cancel this upgrade." \
524 ExecWait '\$R0 _?=\$INSTDIR'
525 IfErrors uninstall_error
527 ReadRegStr \$R1 HKLM \
528 "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${PRODUCT_ID}-${WARCH}" \
530 StrCmp \$R1 "" 0 done
532 Delete "\$INSTDIR\\uninstall.exe"
538 MessageBox MB_OK|MB_ICONEXCLAMATION \
539 "Uninstaller did not complete successfully. Continue at your own risk..." \
544 \${If} \${AtMostWinXP}
545 SectionSetFlags \${SecWASAPI} \${SF_RO}
547 SectionSetFlags \${SecWASAPI} 0
552 Function .onInstSuccess
554 \${If} \${AtMostWinXP}
558 SectionGetFlags \${SecWASAPI} \$R0
560 IntOp \$R0 \$R0 & \${SF_SELECTED}
561 IntCmp \$R0 \${SF_SELECTED} pa_with_wasapi pa_no_wasapi
564 ; VISTA .. 9, libportaudio with WASAPI is good.
565 Delete "\$INSTDIR\\bin\\libportaudio-2.xp"
568 ; Windows XP lacks support for WASAPI, Windows10 on some system has issues
569 ; http://tracker.ardour.org/view.php?id=6507
571 Delete "\$INSTDIR\\bin\\libportaudio-2.dll"
572 Rename "\$INSTDIR\\bin\\libportaudio-2.xp" "\$INSTDIR\\bin\\libportaudio-2.dll"
580 echo " === OutFile: $OUTFILE"
582 if test -n "$QUICKZIP" ; then
583 echo " === Building Windows Installer (fast zip)"
585 echo " === Building Windows Installer (lzma compression takes ages)"
587 time makensis -V2 $NSISFILE