# How to make the plug-in installer for Dynamic Draw 4.0

I describe the process of making a installer for the plug-in 'PgTest' using Microsoft Visual C++ .NET 2003.
The process of making the plug-in 'PgTest' is described in the 'MakePlugIn.html'.

Select the 'Solution PgTest' in the [Solution Explorer].
Click the following menu.
[File] >> [Add Project] >> [New Project]

The [Add New Project] dialog will be displayed.
Select 'Setup and Deployment Projects] in the [Project Types] and [Setup Wizard] in the [Templates].
Enter 'Setup' in the [Name] and 'C:\SRC\PgTest' in the [Location].
Push the [OK] button.

The [Setup wizard] dialog will be displayed.

Push the [Next] button.
The [Choose a project type] page will be displayed.
Select 'Create a setup for a Windows application' and push the [Next] button.

The [Choose project outputs to include] page will be displayed.
Select 'Primary Output from PgTest' and push the [Next] button.

The [Choose files to include] page will be displayed.
If you wish to include some files, push the [Add] button and set the files.
In the following example, the file 'ReadMe.txt' is included.
Push the [Next] button.

The [Create Project] page will be displayed.
Push the [Finish] button.

The 'Setup' will be appended in the [Solution Explorer].

Start the 'regedit.exe'.
The Registry Editor will be displayed.
Click the mouse right-button at the following registry.
------------------------------------------
HKEY_CLASSES_ROOT\CLSID\{6B73A07D-1F3A-4502-A920-57CFA19DE990}\PlugIn4.1\{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}
------------------------------------------
The popup menu will be displayed.
Click the command [Export].
*Remarks*
'{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}' is same as the value of PG_MODULE_CLSID in the 'MpaModule.cpp'.

Information about the registry will be exported.
In the following example, it is saved as 'C:\SRC\PgTest\setup.reg'.

Exit the 'regedit.exe'.
Select the 'Setup' in the [Solution Explorer].
Click the following menu.
[View] >> [Editor] >> [Registry]
The 'Registry' window will be displayed.

Select the 'Registry on Target Machine' and click the following menu.
[Action] >> [Import]
The [Import Registry File] dialog will be displayed.
Select the file that is saved by 'regedit.exe' and push the [Open] button.

Information of the registry that is described in the file will be displayed in the 'Registry' window.

Select the following registry.
--------------------------------------------
HKEY_CLASSES_ROOT\CLSID\{6B73A07D-1F3A-4502-A920-57CFA19DE990}\PlugIn4.1\{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}
--------------------------------------------
Click the mouse right-button at the 'FilePath'.
The popup menu will be displayed.
Click the command [Properties Window].
The 'Properties' window will be displayed.
Click the 'Value' and change the value of it to the following.
---------------------------------------------
[ProgramFilesFolder][Manufacturer]\[ProductName]\PgTest.dll
---------------------------------------------

Click the mouse right-button at '{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}'.
The popup menu will be displayed.
Click the command 'Rename'.
And click the mouse right-button again.
Click the command 'Copy' to copy the text '{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}' to the clipboard.

Change the text '{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}' to '[UpgradeCode]'.

Select the 'Setup' in the [Solution Explorer].
Paste the text '{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}' to the value of 'UpgradeCode' in the [Properties] window.

Furthermore, set the appropriate values to the value of [Author] , [Manufacture], [ProductName], [Version] and others.
*Remarks*
The value of [ProductName] is displayed in the 'Add or Remove Programs' of the Control Panel. So the value should include the word 'Dynamic Draw' that the user can recognize it as a plug-in of the Dynamic Draw.
In the following example, the value is 'Dynamic Draw Plug-in Test'.

Click the following menu.
[Build] >> [Configuration Manager]
The [Configuration Manager] dialog will be displayed.
Select 'Debug' in the [Active Solution Configuration] and tick off 'Build'.
Select 'Release' in the [Active Solution Configuration] and tick off 'Build'.
Click the [Close] button.

Click the following menu.
[Build] >> [Buld Solution]
The installer will be created at the directory 'C:\SRC\PgTest\Setup\Relese'.

Before starting the installation, you have to uninstall the debug version of the plug-in 'PgTest' that has been installed in the MakePlugIn.html.
Start the Dynamic Draw and clear the check mark of the 'Test' in the [Environment setup] dialog.
Exit the Dynamic Draw.
Start the 'regedit.exe'.
Delete the followin registry.
-------------------------------
HKEY_CLASSES_ROOT\CLSID\{6B73A07D-1F3A-4502-A920-57CFA19DE990}\PlugIn4.1\{A9BA890E-2D2E-40D2-8521-94BE80A92FEC}
-------------------------------

You can start the installation to double-click the file 'C:\SRC\PgTest\Setup\Relese\Setup.Exe'.

*Remarks*
After the installation is finished, the plug-in still is not incorporated as a member of the Dynamic Draw.
You have to tick off the plug-in in the [Environment setup] dialog.