Installation and Uninstallation
Plugin Installation
When a plugin is installed, Logi Plugin Service extracts the contents of the .lplug4 plugin package into the Plugins directory:
- Windows
- macOS
%LOCALAPPDATA%\Logi\LogiPluginService\Plugins\
~/Library/Application Support/Logi/LogiPluginService/Plugins/
You can install plugins with Logi Plugin Tool using the following command:
logiplugintool install Example.lplug4
When a plugin is uninstalled, Logi Plugin Service removes the plugin files from the Logi Plugin Service data directory. Logi Plugin Tool can be used to uninstall plugins:
logiplugintool uninstall Example
where "Example" is the name of the plugin to uninstall.
Customizing Installation
A plugin can override the Plugin.Install() and Plugin.Uninstall() methods to customize the installation and uninstallation process:
Install()is called immediately after the plugin is installed (copied to the Logi Plugin Service data directory).Uninstall()is called just before the plugin is uninstalled (deleted from the Logi Plugin Service data directory).
The Install() method can:
- Install application-side extension files into a target application's directory.
- Copy presets or other resources required by the target application.
- Allow specific TCP/IP ports in the firewall.
The Uninstall() method can:
- Delete files installed by the
Install()method. - Delete caching files.
- Remove additional files.
If your plugin needs to install additional files (application-side extensions, presets, etc.), it can do so in the Install() method:
- Additional files are added to the plugin as an embedded resource.
- In the
Install()method, a plugin can call the following helper methods to extract these files to the required directory:Assembly.ExtractFile(String resourceFileName, String pathName)- extracts an embedded resource file to a specified location on the local drive.Assembly.FindFile(String resourceFileName)- returns the full path to an embedded resource by file name.Assembly.GetFilesInFolder(String resourceFolderName)- returns an array of full paths to embedded resources located in the given folder.Assembly.ReadTextFile(String resourceName)- reads text from an embedded resource text file.
Your plugin has access to its Assembly instance via the this.Assembly field:
var pluginFileName = Path.Combine(gimpDirectory, "plug-ins", "logi_plugin.py");
this.Assembly.ExtractFile("Loupedeck.Payload.plugin.logi_plugin.py", pluginFileName);
Plugin Dependencies
If your plugin requires additional class libraries, include the dependency DLLs alongside your plugin DLL in the .lplug4 package. The Logi Plugin Service will load them automatically when the plugin starts.