Changeset 1625


Ignore:
Timestamp:
Jun 11, 2010, 6:11:09 PM (11 years ago)
Author:
Matthäus Wander
Message:

Plugin HowTo:

  • prepared part 2 to rely on the plugin template
  • removed no longer needed sections
Location:
trunk/Documentation/Developer/PluginHowTo
Files:
4 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Documentation/Developer/PluginHowTo/part1.tex

    r1624 r1625  
    178178
    179179With Visual C\# Express the build process is basically the same as with Visual Studio. When opening the solution file, you will receive two error messages. The first is because Visual C\# does not support solution folders and shows all plugin projects as a flat list in the solution explorer. However this is only a visual defect. The second error message is, because Visual C\# does not support unit tests and thus is not able to load the project \textit{DevTestMethods}. Again, this does not interfere with opening, writing, compiling, running or debugging plugins.
     180
     181\section{Downloading the plugin template}
     182\label{DownloadingThePluginTemplate}
     183
     184Before you can start implementing a new plugin, you will have to download the CrypTool~2 plugin template. The template is located at the CrypTool 2 website at \url{http://www.cryptool2.vs.uni-due.de/index.php?page=33&lm=3}. Save the template zip file in your documents folder in the subdirectory \texttt{Visual Studio 2010\textbackslash{}Templates\textbackslash{}Project Templates\textbackslash{}} (applies to both, Visual Studio and Visual C\# Express). Do not unpack the zip file.
  • trunk/Documentation/Developer/PluginHowTo/part2.tex

    r1541 r1625  
    11\chapter{Plugin Implementation}
    22\label{sec:PluginImplementation}
    3 In this chapter we provide step-by-step instructions for implementing your own CrypTool 2 plugin. The given instructions refer primarily to the usage of \textbf{Microsoft Visual Studio Professional 2008}, so before starting you should have a copy of the program installed on your computer.
    4 
    5 \section{Downloading the example and template}
    6 \label{sec:DownloadingTheExampleAndTemplate}
     3In this chapter we provide step-by-step instructions for implementing your own CrypTool 2 plugin. We assume, you have retrieved the CrypTool 2 source code from the SVN repository, have set up Visual Studio 2010 or Visual C\# 2010 Express to build CrypTool 2, and you have placed the template at the right place.
     4
     5\section{Downloading the example}
     6\label{sec:DownloadingTheExample}
    77
    88We will use the \textbf{Caesar cipher} (also known as the \textbf{shift cipher}) as an example throughout this chapter. If you did not to download the entire CrypTool 2 source code as described in Section \ref{CheckingOutTheSources}, you can still get a copy of the source code for the Caesar algorithm referenced throughout this guide from the following location:\\\\
    99\textit{username: anonymous\\
    1010password:} (not required)\\
    11 \url{https://www.cryptool.org/svn/CrypTool2/trunk/CrypPlugins/Caesar/}\\\\
    12 We have also created a Visual Studio plugin \textbf{template} to help with the development of new plugins. Using this template is strongly recommended over copying and pasting code from this document! The template and a short readme can be found here:\\\\
    13 \url{http://cryptool2.vs.uni-due.de/index.php?page=33&lm=3}
    14 \clearpage
     11\url{https://www.cryptool.org/svn/CrypTool2/trunk/CrypPlugins/Caesar/}
    1512
    1613\section{Creating a new project}
    1714\label{sec:CreatingANewProject}
    1815
    19 To begin, open Visual Studio, go to the menu bar and select \textit{File~$\rightarrow$ New $\rightarrow$ Project\ldots }. The following window will appear:
     16%To begin, open Visual Studio, go to the menu bar and select \textit{File~$\rightarrow$ New $\rightarrow$ Project\ldots }. The following window will appear:
     17
     18XXX: update screenshot
     19
     20XXX: right click in solution explorer on CrypPlugins (Express: on solution), select Add, New Project
     21
     22XXX: select CrypTool 2 Plugin as project type
     23
     24XXX: enter some plugin name
     25
     26XXX: enter CrypPlugins as location (!!!)
    2027
    2128\begin{figure}[h!]
     
    2734\clearpage
    2835
    29 Select \textbf{\textit{.NET-Framework 3.5}} as the target framework. Then choose \textit{Class Library} as the default template, as this will build the project for your plugin as a DLL file. Give the project a unique and meaningful name (such as \textit{Caesar} in our case), and choose a location to save it to. Select the subdirectory \textit{CrypPlugins} from your SVN trunk as the location. Finally, confirm by pressing the \textit{OK} button. Note that creating a new project in this manner also creates a new solution into which the project is placed. At this point, your Visual Studio solution should look like this:
     36%Select \textbf{\textit{.NET-Framework 3.5}} as the target framework. Then choose \textit{Class Library} as the default template, as this will build the project for your plugin as a DLL file. Give the project a unique and meaningful name (such as \textit{Caesar} in our case), and choose a location to save it to. Select the subdirectory \textit{CrypPlugins} from your SVN trunk as the location. Finally, confirm by pressing the \textit{OK} button. Note that creating a new project in this manner also creates a new solution into which the project is placed. At this point, your Visual Studio solution should look like this:
    3037
    3138\begin{figure}[h!]
     
    3744\clearpage
    3845
    39 \section{Interface selection}
    40 \label{sec:InterfaceSelection}
    41 
    42 To include our new plugin in the CrypTool 2 application, we must first add a reference to the CrypTool 2 library \textbf{\textit{CrypPluginBase.dll}}, where all the necessary CrypTool 2 plugin interfaces are declared.
    43 
    44 \begin{figure}[h!]
    45         \includegraphics{figures/add_reference.jpg}
    46         \caption{Adding a new reference.}
    47         \label{fig:add_reference}
    48 \end{figure}
    49 
    50 \noindent Right-click in the Solution Explorer on the \textit{Reference} item and choose \textit{Add Reference}. A window like the following should appear:
    51 
    52 \begin{figure}[h!]
    53         \centering
    54                 \includegraphics{figures/add_pluginbase_source.jpg}
    55         \caption{Adding a reference to the CrypPluginBase source code.}
    56         \label{fig:add_pluginbase_source}
    57 \end{figure}
    58 \clearpage
    59 
    60 Unless you have created your new project in the same CrypTool 2 solution, you probably will not be able to select the library directly as seen above in Figure \ref{fig:add_pluginbase_source}; instead you can browse for the binary DLL as seen below in Figure \ref{fig:browse_reference}. Click on the \textit{Browse} tab and navigate to the folder in which you downloaded the CrypTool 2 project. Within that folder, go to \textit{\textbackslash CrypPluginBase\textbackslash bin\textbackslash Debug} and select the file \textit{CrypPluginBase.dll}. The library reference can then be added by double clicking the file or pressing the \textit{OK} button.
    61 
    62 \begin{figure}[h!]
    63         \centering
    64                 \includegraphics{figures/browse_reference.jpg}
    65         \caption{Browsing for a reference.}
    66         \label{fig:browse_reference}
    67 \end{figure}
    68 
    69 Besides CrypPluginBase you will need to add three Windows assembly references to provide the necessary namespaces for the user control functions \textit{Presentation} and \textit{QuickWatchPresentation}. This can be done in a similar manner as before with the \textit{CrypPluginBase} reference, but by selecting the \textit{.NET} tab and searching for the references there. Select the following .NET components:
    70 
    71 \textit{
    72 \begin{itemize}
    73     \item PresentationCore
    74     \item PresentationFramework
    75     \item WindowsBase
    76 \end{itemize}}
    77 \clearpage
    78 
    79 \noindent After these additions, your reference tree view should look like this:
    80 
    81 \begin{figure}[h!]
    82                 \includegraphics{figures/reference_tree.jpg}
    83         \caption{A reference tree with the essential components.}
    84         \label{fig:reference_tree}
    85 \end{figure}
    86 
    87 \noindent If your plugin will require other additional libraries, you can add them in the same way.
    88 
    89 \section{Modifing the project properties}
    90 \label{sec:ModifyTheProjectProperties}
    91 
    92 It is important to make two small changes to your plugin's assembly data to make sure that it will be imported correctly into CrypTool 2. Go to the Solution Explorer and open \textit{AssemblyInfo.cs}, which can be found in the \textit{Properties} folder. Make the following two changes:
    93 
    94 \begin{itemize}
    95         \item Change the attribute \textit{AssemblyVersion} to have the value "2.0.*", and
    96         \item Comment out the attribute \textit{AssemblyFileVersion}.
    97 \end{itemize}
    98 
    99 \noindent This section of your assembly file should now look something like this:
    100 
    101 \begin{lstlisting}
    102 [assembly: AssemblyVersion("2.0.*")]
    103 //[assembly: AssemblyFileVersion("1.0.0.0")]
    104 \end{lstlisting}
    105 
    106 \section{Creating classes for the algorithm and its settings}
    107 \label{sec:CreatingClassesForTheAlgorithmAndItsSettings}
    108 
    109 In the next step we will create two classes. The first class will be the main driver; we will call ours \textit{Caesar} since that is the name of the cipher that it will implement. In our case, this class has to inherit from \textit{IEncryption} because it will be an encryption plugin. If it was instead a hash plugin, this class should inherit from \textit{IHash}. The second class will be used to store setting information for the plugin, and thus we will name ours \textit{CaesarSettings}. It will need to inherit from \textit{ISettings}.
    110 \clearpage
    111 
    112 \subsection{Creating a class for the algorithm}
    113 \label{sec:CreatingAClassForTheAlgorithm}
    114 
    115 When starting a new project, Visual Studio automatically creates a class named \textit{Class1.cs}. Since this is a rather non-descriptive name, we will change it. In our example, it will be \textit{Caesar.cs}. There are two ways to change the name:
    116 
    117 \begin{itemize}
    118         \item Rename the existing class, or
    119         \item Delete the existing class and create a new one.
    120 \end{itemize}
    121 %\clearpage
    122 
    123 \noindent Both options will achieve the same results. We will guide you through the second method. First, delete \textit{Class1.cs}.
    124 
    125 \begin{figure}[h!]
    126         \centering
    127                 \includegraphics{figures/new_class.jpg}
    128         \caption{Deleting a class.}
    129         \label{fig:new_class}
    130 \end{figure}
    131 \clearpage
    132 
    133 \noindent Then right-click on the project item (in our case, \textit{Caesar}) and select \textit{Add $\rightarrow$ Class\ldots }:
    134 
    135 \begin{figure}[h]
    136         \centering
    137                 \includegraphics{figures/add_new_class.jpg}
    138         \caption{Adding a new class.}
    139         \label{fig:add_new_class}
    140 \end{figure}
    141 \clearpage
    142 
    143 \noindent Finally, give your class a unique name. We will call our class \textit{Caesar.cs} and define it as public so that it will be available to other classes.
    144 
    145 \begin{figure}[h!]
    146         \centering
    147                 \includegraphics[width=1.00\textwidth]{figures/name_new_class.jpg}
    148         \caption{Naming the new class.}
    149         \label{fig:name_new_class}
    150 \end{figure}
    151 
    152 Note that Visual Studio will automatically generate a very basic code outline for the new class. In our example, we will not use the all the namespaces that are automatically imported, so you can delete the line \texttt{using System.Linq;}.
    153 
    154 \subsection{Creating a settings class}
    155 \label{sec:CreatingASettingsClass}
    156 
    157 Add a second public class in the same way. We will call the class \textit{CaesarSettings}. The settings class will store the necessary information about controls, captions, descriptions and default parameters (e.g.\ for key settings, alphabets, key length and type of action) to build the \textbf{TaskPane} in the CrypTool application.
     46XXX: rename files in solution explorer to something meaningful (ExamplePluginCT2.cs, ExamplePluginCT2Settings.cs)
     47
     48XXX: rename class ExamplePluginCT2Settings to something meaningful (right-click, refactor/rename).
     49
     50%In our case, this class has to inherit from \textit{IEncryption} because it will be an encryption plugin. If it was instead a hash plugin, this class should inherit from \textit{IHash}. The second class will be used to store setting information for the plugin, and thus we will name ours \textit{CaesarSettings}. It will need to inherit from \textit{ISettings}.
     51
     52%When starting a new project, Visual Studio automatically creates a class named \textit{Class1.cs}. Since this is a rather non-descriptive name, we will change it. In our example, it will be \textit{Caesar.cs}.
     53
     54%Then right-click on the project item (in our case, \textit{Caesar}) and select \textit{Add $\rightarrow$ Class\ldots }:
     55
     56%The settings class will store the necessary information about controls, captions, descriptions and default parameters (e.g.\ for key settings, alphabets, key length and type of action) to build the \textbf{TaskPane} in the CrypTool application.
    15857\clearpage
    15958
     
    17069\subsection{Adding the namespaces and inheritance sources for the Caesar class}
    17170\label{sec:AddingTheNamespacesAndInheritanceSourcesForTheCaesarClass}
     71
     72XXX: your plugin main class should inherit from some interface from the following CrypPluginBase interfaces
     73
     74XXX: CT2 determines by your chosen interface in which algorithm category your plugin will be shown (encryption, hash, analysis etc.)
    17275
    17376Open the \textit{Caesar.cs} file by double clicking on it in the Solution Explorer. To include the necessary namespaces in the class header, use the \texttt{using} statement followed by the name of the desired namespace. The CrypTool 2 API provides the following namespaces:
     
    19699\end{itemize}
    197100
    198 \noindent It is important to define a new default namespace for our public class (\textit{Caesar}). In CrypTool 2  the standard namespace convention is \textit{Cryptool.[name of class]}. Therefore our namespace will be defined as \textit{Cryptool.Caesar}.\clearpage
    199 
    200 \noindent At this point, the source code should look like the following:
    201 
    202 \begin{lstlisting}
    203 using System;
    204 using System.Collections.Generic;
    205 using System.Text;
    206 
    207 //required CrypTool namespaces
    208 using Cryptool.PluginBase;
    209 using Cryptool.PluginBase.Cryptography;
    210 using Cryptool.PluginBase.IO;
    211 using Cryptool.PluginBase.Miscellaneous;
    212 
    213 namespace Cryptool.Caesar
    214 {
    215         public class Caesar
    216         {
    217         }
    218 }
    219 \end{lstlisting}
    220 
    221 \ \\ % ugly but functional
    222 \noindent Next we should let the \textit{Caesar} class inherit from \textit{IEncryption} by making the following alteration:
    223 
    224 \begin{lstlisting}
    225 namespace Cryptool.Caesar
    226 {
    227         public class Caesar : IEncryption
    228         {
    229         }
    230 }
    231 \end{lstlisting}
    232 
    233 \subsection{Adding interface functions to the Caesar class}
    234 \label{sec:AddingInterfaceFunctionsToTheCaesarClass}
    235 
    236 You may notice an underscore underneath the \textit{I} in \textit{IEncryption}. Move your mouse over it, or place the cursor on it and press \textit{Shift+Alt+F10} and the following submenu should appear:
    237 
    238 \begin{figure}[h!]
    239         \centering
    240                 \includegraphics{figures/inherit_submenu.jpg}
    241         \caption{An inheritance submenu.}
    242         \label{fig:inherit_submenu}
    243 \end{figure}
    244 
    245 Select the item \textit{Implement interface `IEncryption'}. Visual Studio will automatically generate all the interface members necessary for interaction with the CrypTool 2 core. (This step will save you a lot of typing!)
    246 \clearpage
    247 
    248 \noindent Your code should now look like this:
    249 
    250 \begin{lstlisting}
    251 using System;
    252 using System.Collections.Generic;
    253 using System.Text;
    254 
    255 using Cryptool.PluginBase;
    256 using Cryptool.PluginBase.Cryptography;
    257 using Cryptool.PluginBase.IO;
    258 using Cryptool.PluginBase.Miscellaneous;
    259 
    260 namespace Cryptool.Caesar
    261 {
    262     public class Caesar : IEncryption
    263     {
    264         #region IPlugin Members
    265 
    266         public void Dispose()
    267         {
    268             throw new NotImplementedException();
    269         }
    270 
    271         public void Execute()
    272         {
    273             throw new NotImplementedException();
    274         }
    275 
    276         public void Initialize()
    277         {
    278             throw new NotImplementedException();
    279         }
    280 
    281         public event GuiLogNotificationEventHandler OnGuiLogNotificationOccured;
    282 
    283         public event PluginProgressChangedEventHandler OnPluginProgressChanged;
    284 
    285         public event StatusChangedEventHandler OnPluginStatusChanged;
    286 
    287         public void Pause()
    288         {
    289             throw new NotImplementedException();
    290         }
    291 
    292         public void PostExecution()
    293         {
    294             throw new NotImplementedException();
    295         }
    296 
    297         public void PreExecution()
    298         {
    299             throw new NotImplementedException();
    300         }
    301 
    302         public System.Windows.Controls.UserControl Presentation
    303         {
    304             get { throw new NotImplementedException(); }
    305         }
    306 
    307         public System.Windows.Controls.UserControl QuickWatchPresentation
    308         {
    309             get { throw new NotImplementedException(); }
    310         }
    311 
    312         public ISettings Settings
    313         {
    314             get { throw new NotImplementedException(); }
    315         }
    316 
    317         public void Stop()
    318         {
    319             throw new NotImplementedException();
    320         }
    321 
    322         #endregion
    323 
    324         #region INotifyPropertyChanged Members
    325 
    326         public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
    327 
    328         #endregion
    329     }
    330 }
    331 \end{lstlisting}
    332 
    333 \subsection{Adding the namespace and interfaces to the CaesarSettings class}
    334 \label{sec:AddingTheNamespaceAndInterfacesToTheCaesarSettingsClass}
    335 
    336 Let's now take a look at the second class in our example, \textit{CaesarSettings}, by double-clicking on the \textit{CaesarSettings.cs} file in the Solution Explorer. First, we need to again include the \textit{Cryptool.PluginBase} namespace to the class header. Then we must let the settings class inherit from \textit{ISettings} in the same manner as was done with the Caesar class. Visual Studio will again automatically generate code from the CrypTool interface as seen below. (In this case, we can remove the using \texttt{System.Collections.Generic;}, \texttt{using System.Linq;}, and \texttt{using System.Text;} lines, as we will not use those references.)
    337 \clearpage
    338 
    339 \begin{lstlisting}
    340 using System;
    341 
    342 using Cryptool.PluginBase;
    343 
    344 namespace Cryptool.Caesar
    345 {
    346     public class CaesarSettings : ISettings
    347     {
    348         #region ISettings Members
    349 
    350         public bool HasChanges
    351         {
    352             get
    353             {
    354                 throw new NotImplementedException();
    355             }
    356             set
    357             {
    358                 throw new NotImplementedException();
    359             }
    360         }
    361 
    362         #endregion
    363 
    364         #region INotifyPropertyChanged Members
    365 
    366         public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
    367 
    368         #endregion
    369     }
    370 }
    371 \end{lstlisting}
     101\clearpage
    372102
    373103\subsection{Adding controls to the CaesarSettings class}
    374104\label{sec:AddingControlsToTheCaesarSettingsClass}
    375105
    376 The settings class is used to populate the TaskPane in the CrypTool 2 application so that the user can modify the plugin settings at will. Thus we will need to implement some controls, such as buttons and text boxes, to allow for the necessary interaction. If you will be implementing an algorithm that does not have any user-defined settings (i.e.\ a hash function), then this class can be left mostly empty; you will, however, still have to modify the \textit{HasChanges} property to avoid a \textit{NotImplementedException}. The following code demonstrates the modifications necessary to create the backend for the TaskPane for our Caesar algorithm. You can also look at the source code of other CrypTool 2 plugins for examples of how to create the TaskPane backend.\\
     106The settings class is used to populate the TaskPane in the CrypTool 2 application so that the user can modify the plugin settings at will. Thus we will need to implement some controls, such as buttons and text boxes, to allow for the necessary interaction. If you will be implementing an algorithm that does not have any user-defined settings (i.e.\ a hash function), then this class can be left mostly empty. The following code demonstrates the modifications necessary to create the backend for the TaskPane for our Caesar algorithm. You can also look at the source code of other CrypTool 2 plugins for examples of how to create the TaskPane backend.\\
    377107
    378108\begin{lstlisting}
     
    13291059\label{sec:PerformingACleanDispose}
    13301060
    1331 Be sure you have closed and cleaned all your streams after execution before CrypTool 2 decides to dispose the plugin instance. Though not required, we will run the disposal code before execution as well. We will expand the associated automatically generated methods (see Section \ref{sec:AddingInterfaceFunctionsToTheCaesarClass}) as follows:
    1332 
     1061Be sure you have closed and cleaned all your streams after execution before CrypTool 2 decides to dispose the plugin instance.
    13331062\begin{lstlisting}
    13341063public void Dispose()
     
    13401069        listCryptoolStreamsOut.Clear();
    13411070}
    1342 
    1343 public void PostExecution()
    1344 {
    1345         Dispose();
    1346 }
    1347 
    1348 public void PreExecution()
    1349 {
    1350         Dispose();
    1351 }
    1352 \end{lstlisting}
    1353 \clearpage
    1354 
    1355 \section{Finishing the implementation}
    1356 \label{sec:FinishingTheImplementation}
    1357 
    1358 When adding plugin instances to the CrypTool 2 workspace, the application core checks whether the plugin runs without any exceptions. If any method inherited from IPlugin throws an exception, CrypTool 2 will display an error message and prohibit use of the plugin. Therefore, we must remove the \textit{NotImplementedException} from the automatically generated methods \textit{Initialize()}, \textit{Pause()} and \textit{Stop()}. In our example it will be sufficient to provide empty implementations:
    1359 
    1360 \begin{lstlisting}
    1361 public void Initialize()
    1362 {
    1363 }
    1364 
    1365 public void Pause()
    1366 {
    1367 }
    1368 
    1369 public void Stop()
    1370 {
    1371 }
    1372 \end{lstlisting}
    1373 
    1374 \ \\
    1375 The methods \textit{Presentation()} and \textit{QuickWatchPresentation()} can be used to provide a specialized visualization of the plugin algorithm to be shown in CrypTool 2. Take a look at the \textit{PRESENT} plugin to see how a custom visualization can be realized. For our Caesar example, we have chosen not to implement a custom visualization. Therefore we will simply return \texttt{null}:
    1376 
    1377 \begin{lstlisting}
    1378 public UserControl Presentation
    1379 {
    1380         get { return null; }
    1381 }
    1382 
    1383 public UserControl QuickWatchPresentation
    1384 {
    1385         get { return null; }
    1386 }
    1387 \end{lstlisting}
    1388 
    1389 \ \\
    1390 Your plugin should compile without errors at this point.
    1391 \clearpage
    1392 
    1393 \section{Importing and testing the plugin}
    1394 \label{sec:ImportingAndTestingThePlugin}
    1395 
    1396 After you have built the plugin, you need to move the newly created plugin DLL to a location where CrypTool 2 can find it. There are currently a couple different ways to accomplish this. First, though, you need to locate the DLL. Once you have successfully compiled the plugin, the DLL should be in \textit{\mbox{\textbackslash CrypPluginBase\textbackslash }bin\textbackslash Debug}.
    1397 
    1398 % Global Storage does not currently function - but presumably will be brought back in at another time.
    1399 
    1400 %\subsection{Global storage}
    1401 %\label{sec:GlobalStorage}
    1402 
    1403 %The first option is to copy your plugin's DLL file to the \textit{CrypPlugins} folder in which the CrypTool 2 %executable (\textit{CrypWin.exe}) can be found.
    1404 
    1405 %\begin{figure}[h]
    1406 %       \centering
    1407 %               \includegraphics{figures/copy_dll_global_storage.jpg}
    1408 %       \caption{Copying the plugin to the global storage folder}
    1409 %       \label{fig:copy_dll_global_storage}
    1410 %\end{figure}
    1411 
    1412 %This folder is known as ``global storage'' in the CrypTool 2 architecture. Changes in this folder will affect %all users on a multi-user Windows platform. You should now restart CrypTool 2.
    1413 %\clearpage
    1414 
    1415 %\begin{figure}[h]
    1416 %       \centering
    1417 %               \includegraphics{figures/global_storage.jpg}
    1418 %       \caption{Inside the CrypPlugins folder (the global storage).}
    1419 %       \label{fig:global_storage}
    1420 %\end{figure}
    1421 
    1422 \subsection{Custom storage}
    1423 \label{sec:CustomStorage}
    1424 
    1425 The first possibility is to copy your plugin's DLL file to the \textit{CrypPlugins} folder located in the \textit{Application Data} folder in your home folder. In Windows XP, the home folder path should be as follows: \textit{C:\textbackslash Documents and Settings\textbackslash $<$user name$>$\textbackslash Application Data\textbackslash CrypPlugins}, and in Vista and Windows 7 the path should look like: \textit{C:\textbackslash Users\textbackslash $<$user name$>$\textbackslash Application Data\textbackslash CrypPlugins}. This home folder path is called ``custom storage'' in the CrypTool architecture. Changes in this folder will only take effect for current user. After copying the file, you must restart CrypTool 2.
    1426 
    1427 \begin{figure}[h]
    1428         \centering
    1429                 \includegraphics[width=1.00\textwidth]{figures/custom_storage.jpg}
    1430         \caption{The custom storage folder.}
    1431         \label{fig:custom_storage}
    1432 \end{figure}
    1433 \clearpage
    1434 
    1435 % Direct import is currently not supported - but presumably it will return again in some form.
    1436 
    1437 %\subsection{Importing directly}
    1438 %\label{sec:ImportingDirectly}
    1439 
    1440 %Another option is to import new plugins directly from the CrypTool 2 interface. Just run \mbox{CrypWin.exe} and select the \textit{Download Plugins} button. An \textit{Open File Dialog} window will open and ask where the new plugin is located. After selecting the new plugin, CrypTool 2 will automatically import the plugin to the custom storage folder. With this option you will not have to restart the program. All corresponding menu entries will be updated automatically. Note that this option is just a temporary solution: in the future this will be done online by a web service.
    1441 %\clearpage
    1442 
    1443 \subsection{Using build settings}
    1444 \label{sec:UsingBuildSettings}
    1445 
    1446 Alternatively, you can use the build settings in your plugin's project properties to copy the DLL automatically after building it in Visual Studio. To set this up, right-click on your plugin project and select \textit{Properties}:
    1447 
    1448 \begin{figure}[h]
    1449         \centering
    1450                 \includegraphics{figures/solution_properties.JPG}
    1451         \caption{Selecting the solution properties.}
    1452         \label{fig:solution_properties}
    1453 \end{figure}
    1454 \clearpage
    1455 
    1456 \noindent Then select \textit{Build Events}:
    1457 
    1458 \begin{figure}[h]
    1459         \centering
    1460                 \includegraphics{figures/post_build.JPG}
    1461         \caption{Setting the build events.}
    1462         \label{fig:post_build}
    1463 \end{figure}
    1464 
    1465 \noindent And finally, enter the following text into the \textit{Post-build event command line} field:\\\\
    1466 cd "\$(ProjectDir)" \\
    1467 cd ..\textbackslash ..\textbackslash CrypWin\textbackslash bin\textbackslash Debug\\
    1468 if not exist ".\textbackslash CrypPlugins" mkdir ".\textbackslash CrypPlugins"\\
    1469 %del /F /S /Q /s /q "\colorbox{yellow}{Caesar}*.*"\\
    1470 %copy "\$(TargetDir)\colorbox{yellow}{Caesar}*.*" ".\textbackslash CrypPlugins"\\\\
    1471 % Colorbox is ugly and creates spaces around the box. Highlighting via the Soul package is much better!
    1472 del /F /S /Q /s /q "\hl{Caesar}*.*"\\
    1473 copy "\$(TargetDir)\hl{Caesar}*.*" ".\textbackslash CrypPlugins"\\\\
    1474 You will need to change the highlighted fields to your particular plugin's name.
     1071\end{lstlisting}
    14751072\clearpage
    14761073
Note: See TracChangeset for help on using the changeset viewer.