How to allow Visual Studio to copy the VST2 to the correct folder? [SOLVED]

I’m new to using Visual Studio 2019 on Windows 10 (have been using MacOS up to now). I have it installed and configured, and I can compile a VST2 plugin successfully (have installed the legacy SDK).

I want to enable the step that copies the completed VST2 into the correct default location, which is:

C:\Program Files\VstPlugins

The folder exists, and I can manually put the VST in there and have it loaded by the AudioPluginHost.

In the Projucer, I have specified the above path as written in the field for “VST (Legacy) Binary Location” and enabled “Enable Plugin Copy Step”.

However, when building, I get an error that “Access is denied”:

1>------ Build started: Project: PanProcessorWidth_VST, Configuration: Debug x64 ------
1>PanProcessorWidth_VST.vcxproj -> C:\Users\sk\Documents\MY_JUCE\PanProcessorWidth05\Builds\VisualStudio2019\x64\Debug\VST\PanProcessorWidth.dll
1>Access is denied.
1>        0 file(s) copied.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: The command "copy /Y "C:\Users\sk\Documents\MY_JUCE\PanProcessorWidth05\Builds\VisualStudio2019\x64\Debug\VST\PanProcessorWidth.dll" "C:\Program Files\VstPlugins\PanProcessorWidth.dll"
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :VCEnd" exited with code 1.
1>Done building project "PanProcessorWidth_VST.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

Does anyone know what I must do to get this to work? I’m not much of a Windows guy…

EDIT: I am the administrator account…

Did you check the permissions of the folder? Your account needs to be able to write/modify.

Even if you are Administrator, Windows launches programs as normal user by default, mainly for security reasons.

You need to run Visual Studio 2019 as Administrator manually by right-clicking on the shortcut:

Thanks so much! It works…

1 Like

Did the C:\Program Files\VstPlugins folder exist before? I’m 99% sure if the folder exists already then no problem, but if it doesn’t then you need the “Run as Administrator” work around. I certainly don’t need to do that in my Windows install (the only difference is my default VST folder lives within the Cubase folder).

No, I created it because JUCE shows that it is the default folder it expects to find VST2 plugins inside of when you run the plugin scanner in AudioPluginHost. But I did create it as admin…if that matters (I guess not).

I think it would matter. iirc if you created it as Admin, then you’d need Admin rights to write to it. I guess the difference here is Cubase’s VST folder doesn’t have that restriction. You could check the “Properties” of the VST folder and make sure that writes for anyone is enabled, because I imagine it would be quite a pain to remember to Run as Administrator every time you start Visual Studio.

Isn’t Run as Administrator a persistent setting? I seem to remember it used to be back in Windows 7.

OK, so apparently “Run as Administrator” is NOT a persistent setting. Which does make it a pain to have to set this every time you launch the app.

But I’m looking at the permissions for this folder and it seems the admin account already has access to everything checked:

Screen Shot 2020-01-26 at 7.42.58 PM

I fixed it. For some reason, I had to enable Write access for “Users”:
(which I guess is what you said, @richie :smiley:

Screen Shot 2020-01-26 at 7.49.43 PM

1 Like

I think this is because without elevating your permissions via a UAC dialogue (or “Run as administrator”), your user is part of the “Users” group (which I mistakenly thought was called “Anyone”, possibly I was thinking about Windows 7 or even XP there!). This way nefarious programs shouldn’t be able to do naughty things without you giving them explicit permission to do so. Glad you got it sorted though.