Read plugin version

Hi all,
I want to make a function in my plugin.

When users use the old version plugin,
pop up the message to remind the new version is already available.

Does anyone know how to read the version number of the plugin?

Try this:

FString PluginName = "MyPlugin";
FString LatestVersion = "1.4.1";

IPluginManager& PluginManager = IPluginManager::Get();
TArray<TSharedRef<IPlugin>> Plugins = PluginManager.GetDiscoveredPlugins();
for(const TSharedRef<IPlugin>& Plugin: Plugins) {
	if (Plugin.GetName() == PluginName) {
		const FPluginDescriptor& Descriptor = Plugin->GetDescriptor();
		if (Descriptor.VersionName != LatestVersion) {
			// Invoke your update code here
		}
	}
}

For an example, have a look at the end of this file: https://github.com/EpicGames/UnrealEngine/blob/f8f4b403eb682ffc055613c7caf9d2ba5df7f319/Engine/Source/Editor/ContentBrowser/Private/NativeClassHierarchy.cpp

#1 result on google for this, so just to update it, here’s a UE5 version that no longer requires looping the entire plugin list:

#include "Interfaces/IPluginManager.h"

const TSharedPtr<IPlugin> Plugin = IPluginManager::Get().FindPlugin(TEXT("WRITE_PLUGIN_NAME_HERE"));
	
if (Plugin.IsValid())
	{
		return Plugin->GetDescriptor().VersionName;
	}