From dd55681546181ffd33efd494ce84c0987a7c06b1 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 22 Mar 2019 11:31:25 -0400 Subject: [PATCH] Add fatal error if res is not found. --- Makefile | 7 ------- src/main.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6f0db24f..3bf6d7db 100644 --- a/Makefile +++ b/Makefile @@ -103,8 +103,6 @@ ifdef ARCH_LIN # Manually check that no nonstandard shared libraries are linked ldd dist/Rack/$(TARGET) cp plugins/Fundamental/dist/*.zip dist/Rack/Fundamental.zip - mkdir -p dist/Rack/Bridge - # cp Bridge/VST/dist/VCV-Bridge{,-fx}.so dist/Rack/Bridge/ # Make ZIP cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack endif @@ -123,9 +121,6 @@ ifdef ARCH_MAC otool -L dist/$(TARGET).app/Contents/MacOS/$(TARGET) cp plugins/Fundamental/dist/*.zip dist/$(TARGET).app/Contents/Resources/Fundamental.zip - # cp -R Bridge/AU/dist/VCV-Bridge.component dist/ - # cp -R Bridge/VST/dist/VCV-Bridge.vst dist/ - # cp -R Bridge/VST/dist/VCV-Bridge-fx.vst dist/ # Make ZIP cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip $(TARGET).app endif @@ -138,8 +133,6 @@ ifdef ARCH_WIN cp /mingw64/bin/libstdc++-6.dll dist/Rack/ cp /mingw64/bin/libgcc_s_seh-1.dll dist/Rack/ cp plugins/Fundamental/dist/*.zip dist/Rack/Fundamental.zip - # mkdir -p dist/Rack/Bridge - # cp Bridge/VST/dist/VCV-Bridge-{32,64,fx-32,fx-64}.dll dist/Rack/Bridge/ # Make ZIP cd dist && zip -5 -r Rack-$(VERSION)-$(ARCH).zip Rack # Make NSIS installer diff --git a/src/main.cpp b/src/main.cpp index 35f7b508..5dc12ac7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -105,6 +105,13 @@ int main(int argc, char *argv[]) { INFO("System directory: %s", asset::systemDir.c_str()); INFO("User directory: %s", asset::userDir.c_str()); + std::string resDir = asset::system("res"); + if (!system::isDirectory(resDir)) { + std::string message = string::f("Rack's resource directory \"%s\" does not exist. Make sure Rack is correctly installed and launched.", resDir.c_str()); + osdialog_message(OSDIALOG_ERROR, OSDIALOG_OK, message.c_str()); + exit(1); + } + INFO("Initializing environment"); random::init(); midi::init();