Closed wpostma closed 2 years ago
Have to manually copy files from c:\Program Files\Common Files\Cardinal to the VST2 folder where the vst2 dll is to make the Cardinal plugin register and load, and operate.
otherwise what happens? what is the error?
The error depends on the host:
It appears to be due to the code relying on environment variables, I suspect that a more robust mechanism to determine the asset folder is to call SHGetFolderPath with the correct CSIDL constant
https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha
Probably works whenever the environment variable CommonProgramFiles exists.
Many win32 processes may be created without environment variable inheritance, inside the DAWs
Okay I brushed off my stale C++ "interview question" skills and whipped up this which should work even if you have Unicode characters (chinese anyone?) in the system NTFS paths.
` // it's a bit harder than I thought to call an API and output it to the console in Windows.
#include <iostream>
extern "C" {
#include <Windows.h>
#include <Shlobj.h>
#include <fileapi.h>
#include <stringapiset.h>
}
#ifndef UNICODE
#error ""this test should be done in unicode"
#endif
#define UTF8
int main()
{
TCHAR szProgramFilesCommon[MAX_PATH];
SetConsoleOutputCP(CP_UTF8);
szProgramFilesCommon[0] = '\0';
SHGetFolderPath(HWND(0), CSIDL_PROGRAM_FILES_COMMON, NULL, 0, szProgramFilesCommon);
size_t convertArrayLen = wcslen(szProgramFilesCommon)+1; // include the nul in the conversion
// String s = String( & szProgramFilesCommon[0] );
CHAR mbcs[MAX_PATH * 4];
BOOL defaultCH = false;
WideCharToMultiByte(CP_UTF8, 0, szProgramFilesCommon, convertArrayLen, mbcs,MAX_PATH,NULL,&defaultCH );
std::string s = std::string(mbcs);
std::cout << "assets " << s << std::flush; // wow I think this is a stupid way to code output. nice work bjarne.
}
`
Expectation: Can run the installer and then use the VST2 plugin.
Actual experience:
Have to manually copy files from c:\Program Files\Common Files\Cardinal to the VST2 folder where the vst2 dll is to make the Cardinal plugin register and load, and operate.
I believe that when the installer was added, there may have been code added to find the files in c:\Program Files\Common Files\Cardinal however it is not finding the files, and it is acting like they were not installed.