Home Page > Deployment > Deploy Module Tutorial
Deploy Module Tutorial
Deploy Module Tutorial
This tutorial demonstrates creation of a Windows Installer package for a
KernelCAD-based application using KcRedist merge module and an installer creation software like Install Shield. The tutorial is based on Setup and Deployment type of project of Microsoft Visual Studio
2008. With
adjustments for different user interface the same steps are required when
using different installer creation software.
The installer will install MiniCAD.exe of the MiniCAD sample. It is a native
32 bit C++ application. If the application uses .NET version of kernelCAD the only required change is described in the Registry and Properties section below
To create a 64 bit installer you need to use 64 bit KernelCAD. Assume that "_5_2" means "_x64_5_2" in the steps below in the case
A copy of the completed project is available in Samples\Deployment\DeployModule folder.
See also: Redistribution
File System
- In Microsoft Visual Studio 2008 select File > New > Project. In the New
Project dialog expand "Other Project types" in the left panel and select
"Setup and Deployment". If you do not see the project type check that you have the latest service pack for Visual Studio
- In the right-hand side panel select "Setup Project". Select location for
the project at the bottom and type "DeployModule" for the name.
- When the project is created Visual Studio opens File System window. It
can be closed and re-opened using icons on top of the Solution Explorer.
- Select "Application Folder" in the File System window and select Action > Add >
File in menu. Browse to the installation folder of KernelCAD, which is
C:\Projects\KernelCAD_5_2 by default
- Select MiniCAD.exe. Press Open. The MiniCAD.exe will appear in the right hand
side panel of the File System window.
- Download KcRedist_5_2.zip (KcRedist_x64_5_2.zip for 64 bit installer) from
http://www.dynoinsight.com/ProDown.htm and extract it into KcRedist_5_2 folder in a temporary location
- Right-click DeployModule project in Solution Explorer of Visual Studio and
select Add>Merge Module. Browse and select all three .msm files in the KcRedist_5_2 folder. They will appear in Solution Explorer of Visual Studio
- Select Application Folder in the left hand pane of the File System
window and in context menu select Add > Folder. Change name of the folder to
Models. The name can also be changed using the Properties Window. Add new
Samples sub folder to the Models folder in the same manner.
- Add MiniCAD.glm from Models\Samples folder of KernelCAD_5_2 installation directory to the
Bin\Models\Samples folder of the target directory
- Add Gen.ico file located in KernelCAD_5_2\Samples\Deployment\ to the Application Folder of the target file system
- In the Solution Explorer of the Visual Studio select the DeployModule project. If the
properties window (View > Properties Window) click at the end of the
AddRemoveProgramIcon line and in the appeared dialog browse to the Gen.ico
- Select User's Programs Menu folder in File System window. Right-click
into right hand pane and select "Create New Shortcut". Select MiniCAD.exe in
the dialog and press OK. Change name of the shortcut to MiniCAD. In the properties
window change the Icon property to Gen.ico similar to the above
Registry and Properties
-
Open Registry Editor using icon on the top of Solution Explorer
- Add HKEY_LOCAL_MACHINE\SOFTWARE\DInsight\KerCADe\5.2 registry key with string
value named InstallDir and value [TARGETDIR] as described in
Locating Model
on Target Computer of Deploy tutorial. If the application relies on the .NET version of KernelCAD add HKEY_LOCAL_MACHINE\SOFTWARE\DInsight\KerCADne\5_2 instead
- Select the Deploy node in solution explorer.
Select Properties in the context menu. Click Prerequisite button. Turn on check
box next to "Visual Studio
Runtime Libraries (x86)" or "Visual Studio Runtime Libraries (x64)"
depending on bitnes of your application.
- Select Deploy node in solution explorer and change ProductName property
in Properties Window to "MiniCAD v1.0"
- Change the Title property to MiniCAD v1.0 Setup
- If you are using 64 bit KernelCAD change TargetPlatform property
of the project to x64
Building and testing
- Make sure that the active configuration is Release via Build >
"Configuration Manager" menu option of Visual Studio
- Build the project with Build > Build Solution. Make sure that there are
no errors in the output window
- The DeployModule.msi and setup.exe will be created in Release folder is the output of
the project. To make sure the application works without KernelCAD it is recommended to test the installer on another machine or uninstall KernelCAD
temporary
- Run setup.exe to install the application. Select MiniCAD in Start menu
to test the application.
- Uninstall the MiniCAD application using "Add or Remove Programs" from
Control Panel
See also: Deploy Tutorial
|