This document is intended for developers creating plug-ins for Screen Monkey. It describes the process of creating a setup project in Visual Studio which will install the plug-in files in the correct location.
Creating a Plug-in Installer
It is assumed that you are already familiar with creating and modifying msi installers in Visual Studio. Before you begin you will need to add asetup project to your solution. This is done by right clicking on the solution and selecting Add | New Project.
Please now edit the installer to install any required files and show the correct title and author information. It is advised that you stick to the version numbering system [Major Version].[Minor Version].[Beta Release].
When adding dependency files to the setup they should all be placed in the “Application Folder” of the setup project. If you place them anywhere else it is likely that Screen Monkey will not be able to load them.
Adding Install Paths
First you need to setup your installer to load the install paths saved in the registry when Screen Monkey is installed. The setup creates four registry settings.
The root path to the Screen Monkey installation.
HKEY_LOCAL_MACHINE\Software\Screen Monkey\Path
This is the path that all clip plug-in should be installed to. This is the directory that Screen Monkey will search when it starts up to find any plug-in assemblies and your plug-in will not appear if it is not placed in this folder.
HKEY_LOCAL_MACHINE\Software\Screen Monkey\ClipPluginPath
This is the that all effects plug-in should be installed to. This is the directory that Screen Monkey will search when it starts up to find any plug-in assemblies and your plug-in will not appear if it is not placed in this folder.
HKEY_LOCAL_MACHINE\Software\Screen Monkey\EffectPluginPath
This is the path that all interaction plug-in should be installed to. This is the directory that Screen Monkey will search when it starts up to find any plug-in assemblies and your plug-in will not appear if it is not placed in this folder.
HKEY_LOCAL_MACHINE\Software\Screen Monkey\InteractionPluginPath
When you uninstall Screen Monkey the registry entries are deleted.
We now need to load these registry entries so that we can use them in the setup project. This is done by adding a registry search.
-
Click on the setup project in the solution explorer.
-
From the View menu select Editor | Launch Conditions
-
You will be presented with a tree which shows two branches “Search Target Machine” and “Launch Conditions”
-
Right click on “Search Target Machine” and select “Add Registry Search”.
-
When you select the newly added search you can edit the settings of the search in the properties window. You will need to add four searches with the following settings.
| Registry Search 1 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| Registry Search 2 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| Registry Search 3 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| Registry Search 4 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Detecting if Screen Monkey is installed
It is a good idea to prevent your plug-in being installed if the user has not already installed Screen Monkey. This can be done in Visual Studio by specifying a launch condition. The following will take you through the process of specifying a launch condition.
-
Click on the setup project in the solution explorer.
-
From the View menu select Editor | Launch Conditions
-
You will be presented with a tree which shows two branches “Search Target Machine” and “Launch Conditions”
-
Right click on “Search Target Machine” and select “Add Launch Condition”.
-
Now edit the properties of the launch condition to the ones shown below.
| Launch Condition | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Default Install Directory
To ensure that your plug-in and its dependencies are installed in the correct place you need to set the default install directory to the plug-in directory listed in the registry. The following instructions taker you through setting the default install directory to the plug-in directory stored in the registry.
-
Click on the setup project in the solution explorer.
-
From the View menu select Editor | File System
-
In the new view that open up click on “Application Folder” to show its properties in the property window.
-
Change the “DefaultLocation” property to “[SCREENMONKEYCLIPPATH]”
-
If you are not installing a clip plugin then you will need to change the above to the correct path for your plug-in type so for effects plug-in DefaultLocation = [SCREENMONKEYEFFECTPATH].
Removing Installation Folder Page
You may also wish to remove the installation folder page displayed while running the setup. This gives the user the option to change the installation folder however in this instance we do not want the user to select an install folder or the plug-in may not work.
-
Click on the setup project in the solution explorer.
-
From the View menu select Editor | User Interface
-
Under Install find the Installation Folder dialog and right click on it.
-
Select Delete from the drop down menu. The Installation Folder dialog should be removed from the list of dialogs.
-
Repeat the above for the Administrative Install
Conclusion
If you have followed the above instructions correctly you should find that when you run the setup it will install your plug-in to the correct plug-in folder.