diff --git a/installer_win/surge-x86.iss b/installer_win/surge-x86.iss index 2c1b1f991f5..92a968bf587 100644 --- a/installer_win/surge-x86.iss +++ b/installer_win/surge-x86.iss @@ -45,7 +45,7 @@ Name: EffectsVST3; Description: SurgeEffectsBank VST3 Plug-in (32 bit); Types: f Source: ..\target\vst2\Release\Surge_x86.dll; DestDir: {app}; Components: VST2; Flags: ignoreversion skipifsourcedoesntexist Source: ..\target\vst3\Release\Surge_x86.vst3; DestDir: {cf}\VST3; Components: VST3; Flags: ignoreversion Source: ..\fxbuild\surge-fx\Builds\VisualStudio2017\Win32\ReleaseWin32\VST3\SurgeEffectsBank.vst3; DestDir: {cf}\VST3; Components: EffectsVST3; Flags: ignoreversion skipifsourcedoesntexist -Source: ..\resources\data\*; DestDir: {localappdata}\Surge; Components: Data; Flags: recursesubdirs; Excludes: "*.git"; +Source: ..\resources\data\*; DestDir: {commonappdata}\Surge; Components: Data; Flags: recursesubdirs; Excludes: "*.git"; Source: ..\resources\fonts\Lato-Regular.ttf; DestDir: "{fonts}"; Components: Data; FontInstall: "Lato"; Flags: onlyifdoesntexist uninsneveruninstall [Languages] diff --git a/installer_win/surge.iss b/installer_win/surge.iss index 1903631b942..5856fe1baf3 100644 --- a/installer_win/surge.iss +++ b/installer_win/surge.iss @@ -45,7 +45,7 @@ Name: EffectsVST3; Description: SurgeEffectsBank VST3 Plug-in (64 bit); Types: f Source: ..\target\vst2\Release\Surge.dll; DestDir: {app}; Components: VST2; Flags: ignoreversion skipifsourcedoesntexist Source: ..\target\vst3\Release\Surge.vst3; DestDir: {cf}\VST3; Components: VST3; Flags: ignoreversion Source: ..\fxbuild\surge-fx\Builds\VisualStudio2017\x64\Release\VST3\SurgeEffectsBank.vst3; DestDir: {cf}\VST3; Components: EffectsVST3; Flags: ignoreversion skipifsourcedoesntexist -Source: ..\resources\data\*; DestDir: {localappdata}\Surge; Components: Data; Flags: recursesubdirs; Excludes: "*.git"; +Source: ..\resources\data\*; DestDir: {commonappdata}\Surge; Components: Data; Flags: recursesubdirs; Excludes: "*.git"; Source: ..\resources\fonts\Lato-Regular.ttf; DestDir: "{fonts}"; Components: Data; FontInstall: "Lato"; Flags: onlyifdoesntexist uninsneveruninstall [Languages] diff --git a/src/common/SurgeStorage.cpp b/src/common/SurgeStorage.cpp index f82acc1ce33..2d73ad2d6e2 100644 --- a/src/common/SurgeStorage.cpp +++ b/src/common/SurgeStorage.cpp @@ -235,12 +235,28 @@ SurgeStorage::SurgeStorage(std::string suppliedDataPath) #if TARGET_RACK datapath = suppliedDataPath; #else - PWSTR localAppData; - if (!SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &localAppData)) + bool foundSurge = false; + PWSTR commonAppData; + if (!SHGetKnownFolderPath(FOLDERID_ProgramData, 0, nullptr, &commonAppData)) { CHAR path[4096]; - wsprintf(path, "%S\\Surge\\", localAppData); + wsprintf(path, "%S\\Surge\\", commonAppData); datapath = path; + if( fs::is_directory( fs::path( datapath ) ) ) + foundSurge = true; + else + datapath = ""; + } + + if( ! foundSurge ) { + PWSTR localAppData; + if (!SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &localAppData)) + { + CHAR path[4096]; + wsprintf(path, "%S\\Surge\\", localAppData); + datapath = path; + foundSurge = true; + } } PWSTR documentsFolder; diff --git a/src/common/gui/CAboutBox.cpp b/src/common/gui/CAboutBox.cpp index 56da271ef92..7c0b4815d9e 100644 --- a/src/common/gui/CAboutBox.cpp +++ b/src/common/gui/CAboutBox.cpp @@ -68,8 +68,9 @@ void CAboutBox::draw(CDrawContext* pContext) std::vector< std::string > msgs = { { std::string() + "Version " + SURGE_STR(SURGE_VERSION) + " (" + bittiness + " " + platform + " " + flavor + ". Built " + __DATE__ + " " + __TIME__ + ")", + std::string() + "Resources: dataPath=" + dataPath + " userData=" + userPath, "Released under the GNU General Public License, v3", - "Copyright 2005-2019 by individual contributors", + "Copyright 2005-2020 by individual contributors", "Source, contributors and other information at https://github.com/surge-synthesizer/surge", "VST Plug-in technology by Steinberg, AU Plugin Technology by Apple Computer" } }; @@ -103,8 +104,10 @@ bool CAboutBox::hitTest(const CPoint& where, const CButtonState& buttons) //------------------------------------------------------------------------ -void CAboutBox::boxShow() +void CAboutBox::boxShow(std::string dataPath, std::string userPath) { + this->dataPath = dataPath; + this->userPath = userPath; setViewSize(toDisplay); setMouseableArea(toDisplay); value = 1.f; diff --git a/src/common/gui/CAboutBox.h b/src/common/gui/CAboutBox.h index 8f07f8642e6..8c452593928 100644 --- a/src/common/gui/CAboutBox.h +++ b/src/common/gui/CAboutBox.h @@ -30,7 +30,7 @@ class CAboutBox : public VSTGUI::CControl const VSTGUI::CButtonState& buttons); ///< called when a mouse down event occurs virtual void unSplash(); - void boxShow(); + void boxShow(std::string dataPath, std::string userPath); void boxHide(bool invalidateframe = true); CLASS_METHODS(CAboutBox, VSTGUI::CControl) @@ -41,6 +41,7 @@ class CAboutBox : public VSTGUI::CControl VSTGUI::CPoint offset; VSTGUI::SharedPointer _aboutBitmap; bool bvalue; + std::string dataPath, userPath; static VSTGUI::SharedPointer infoFont; }; diff --git a/src/common/gui/SurgeGUIEditor.cpp b/src/common/gui/SurgeGUIEditor.cpp index 2932b7bd36b..7df1d887f59 100644 --- a/src/common/gui/SurgeGUIEditor.cpp +++ b/src/common/gui/SurgeGUIEditor.cpp @@ -3439,7 +3439,7 @@ void SurgeGUIEditor::showSettingsMenu(CRect &menuRect) addCallbackMenu(settingsMenu, "About", [this]() { if (aboutbox) - ((CAboutBox*)aboutbox)->boxShow(); + ((CAboutBox*)aboutbox)->boxShow(this->synth->storage.datapath, this->synth->storage.userDataPath); }); eid++;