From aa0ea689348c0e47e9d2805c8a1b9d77b24a00ae Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 26 Mar 2018 19:47:40 -0400 Subject: [PATCH] Add VSTs to Windows installer, zip distribution --- Makefile | 6 +++++ arch.mk | 13 +++++++---- installer.nsi | 61 +++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index d3c69d12..f99c0ec9 100644 --- a/Makefile +++ b/Makefile @@ -94,6 +94,9 @@ endif dist: all +ifndef RELEASE + exit 1 # Must enable RELEASE for dist target +endif rm -rf dist # Rack distribution $(MAKE) -C plugins/Fundamental dist @@ -141,6 +144,9 @@ ifeq ($(ARCH), mac) endif ifeq ($(ARCH), win) mkdir -p dist/Rack + mkdir -p dist/Rack/Bridge + cp Bridge/vst/dist/VCV-Bridge-64.dll dist/Rack/Bridge/ + cp Bridge/vst/dist/VCV-Bridge-32.dll dist/Rack/Bridge/ cp -R LICENSE* res dist/Rack/ cp $(TARGET) dist/Rack/ strip dist/Rack/$(TARGET) diff --git a/arch.mk b/arch.mk index cf26b179..c9fb5979 100644 --- a/arch.mk +++ b/arch.mk @@ -3,17 +3,22 @@ ifndef ARCH MACHINE = $(shell gcc -dumpmachine) -ifneq (,$(findstring linux,$(MACHINE))) +ifneq (, $(findstring linux, $(MACHINE))) # Linux ARCH = lin -else ifneq (,$(findstring apple,$(MACHINE))) +else ifneq (, $(findstring apple, $(MACHINE))) # Mac ARCH = mac -else ifneq (,$(findstring mingw,$(MACHINE))) +else ifneq (, $(findstring mingw, $(MACHINE))) # Windows ARCH = win +ifneq ( ,$(findstring x86_64, $(MACHINE))) + BITS = 64 +else ifneq (, $(findstring i686, $(MACHINE))) + BITS = 32 +endif else - $(error Could not determine machine type. Try hacking around in arch.mk) +$(error Could not determine machine type. Try hacking around in arch.mk) endif endif \ No newline at end of file diff --git a/installer.nsi b/installer.nsi index d347c4b8..c6e31efc 100644 --- a/installer.nsi +++ b/installer.nsi @@ -12,7 +12,7 @@ InstallDir "$PROGRAMFILES\VCV" ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\VCV Rack" "" -;Request application privileges for Windows Vista +;Request admin permissions so we can install to Program Files and add a registry entry RequestExecutionLevel admin @@ -28,16 +28,20 @@ RequestExecutionLevel admin ; Pages -; !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY -;second directory selection -; Var DbInstDir -; !define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which to install the database." -; !define MUI_DIRECTORYPAGE_TEXT_TOP "The installer will install the database(s) in the following folder. To install in a differenct folder, click Browse and select another folder. Click Next to continue." -; !define MUI_DIRECTORYPAGE_VARIABLE $DbInstDir ; <= the other directory will be stored into that variable -; !insertmacro MUI_PAGE_DIRECTORY +Var VST_64_DIR +!define MUI_DIRECTORYPAGE_VARIABLE $VST_64_DIR +!define MUI_DIRECTORYPAGE_TEXT_TOP "Bridge VST 64-bit plugin install directory" +!define MUI_PAGE_CUSTOMFUNCTION_PRE VST_64_DIR_PRE +!insertmacro MUI_PAGE_DIRECTORY + +Var VST_32_DIR +!define MUI_DIRECTORYPAGE_VARIABLE $VST_32_DIR +!define MUI_DIRECTORYPAGE_TEXT_TOP "Bridge VST 32-bit plugin install directory" +!define MUI_PAGE_CUSTOMFUNCTION_PRE VST_32_DIR_PRE +!insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES @@ -47,11 +51,14 @@ RequestExecutionLevel admin !insertmacro MUI_LANGUAGE "English" +; Sections -Section "!VCV Rack" VCVRACK +Section "VCV Rack" VCVRACK + SectionIn RO SetOutPath "$INSTDIR" - File /r "dist\Rack" + CreateDirectory $OUTDIR + File /r /x "Bridge" "dist\Rack" ;Store installation folder WriteRegStr HKCU "Software\VCV Rack" "" $INSTDIR @@ -72,8 +79,18 @@ Section "!VCV Rack" VCVRACK SectionEnd -; Section "VST Plugin" VST -; SectionEnd +Section "Bridge VST 64-bit plugin" VST_64 + StrCpy $OUTDIR $VST_64_DIR + CreateDirectory $OUTDIR + File "dist\Rack\Bridge\VCV-Bridge-64.dll" +SectionEnd + + +Section "Bridge VST 32-bit plugin" VST_32 + StrCpy $OUTDIR $VST_32_DIR + CreateDirectory $OUTDIR + File "dist\Rack\Bridge\VCV-Bridge-32.dll" +SectionEnd Section "Uninstall" @@ -86,3 +103,23 @@ Section "Uninstall" DeleteRegKey /ifempty HKCU "Software\VCV Rack" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\VCV Rack" SectionEnd + + +; Functions + +Function VST_64_DIR_PRE + ${Unless} ${SectionIsSelected} ${VST_64} + Abort + ${EndUnless} +FunctionEnd + +Function VST_32_DIR_PRE + ${Unless} ${SectionIsSelected} ${VST_32} + Abort + ${EndUnless} +FunctionEnd + +Function .onInit + StrCpy $VST_64_DIR "$PROGRAMFILES\Steinberg\VSTPlugins" + StrCpy $VST_32_DIR "$PROGRAMFILES (x86)\Steinberg\VSTPlugins" +FunctionEnd