@@ -1610,9 +1610,16 @@ int PluginInfoComponent::downloadPlugin (const String& plugin, const String& ver
1610
1610
fs::path tempPluginPath = tempDir.getChildFile (" plugins" ).getFullPathName ().toStdString ();
1611
1611
fs::path destPluginPath = getPluginsDirectory ().getFullPathName ().toStdString ();
1612
1612
1613
- // Copy only if plugin file exists
1613
+ // Copy only if plugin file exists in temp directory
1614
1614
if (fs::exists (tempPluginPath))
1615
1615
{
1616
+ // Delete existing plugin DLL file if it exists
1617
+ File dllFile = getPluginsDirectory ().getChildFile (dllName);
1618
+ if (dllFile.exists ())
1619
+ {
1620
+ dllFile.deleteRecursively ();
1621
+ }
1622
+
1616
1623
const auto copyOptions = fs::copy_options::overwrite_existing
1617
1624
| fs::copy_options::recursive;
1618
1625
try
@@ -1647,9 +1654,15 @@ int PluginInfoComponent::downloadPlugin (const String& plugin, const String& ver
1647
1654
// Copy only if shared files exist
1648
1655
if (fs::exists (tempSharedPath))
1649
1656
{
1657
+ #ifdef JUCE_WINDOWS || JUCE_MAC
1658
+ const auto copyOptions = fs::copy_options::overwrite_existing
1659
+ | fs::copy_options::recursive
1660
+ | fs::copy_options::copy_symlinks;
1661
+ #else
1650
1662
const auto copyOptions = fs::copy_options::update_existing
1651
1663
| fs::copy_options::recursive
1652
1664
| fs::copy_options::copy_symlinks;
1665
+ #endif
1653
1666
try
1654
1667
{
1655
1668
fs::copy (tempSharedPath, destSharedPath, copyOptions);
0 commit comments