Redistribution
Redistribution
See also: Deploy Tutorial
Applications developed using KernelCAD ActiveX Controls will run on other
machines without requiring DInsight license. The license is needed on the application development stage, when the
in a dialog or form containing the control is opened.
Determine which KerCAD*.ocx your application uses and add it to your setup
project. The easiest way to do that in Mocrosoft Visual Studio is to run the
application in debug mode and search the Output window for .ocx name. For .NET
application most likely it will be KerCADn*.ocx . Use the
Dependency Walker utility on your
applications exe file if the previous method is not appropriate. The utility can
also help identifying any missing dlls.
KernelCAD components depend on a number of Dynamic Link Libraries from
Microsoft and KernelCAD Runtime files. They all must be present on the target machine for the component
to work. When some of the files are missing the application, which uses KernelCAD
quite often will not start without any messages. Installation process which
redistributes KernelCAD components may also fail because the component
registration will not be possible.
To redistribute KernelCAD Runtime files add all content of the Bin folder of the
KernelCAD installation directory, excluding .exe files, to your setup project.
KernelCAD depends on: C++ Runtime librarries and MFC library for Visual Studio
2008. It is importatnt to install this particular version of the librraies.
There are several ways to create an installer for KernelCAD components:
Redistributing via Precompiled Installer
This is the easiest approach. To install KernelCAD components execute
KernelCAD_Runtime_4_2.exe provided in Redist folder of the installation
directory on the target computer prior installation of your application. It can
be added as a prerequsite and automatically executed by the application's
installer.
Specific to Microsoft Vusual Studio: If you are using a Visual Studio Setup and
Deployment project, to create a single-step installer add
KernelCAD_Runtime_4_2.exe to the list of installed files and in the Custom
Actions Editor add a custom action using the .exe to the Install step.
Redistributing via KCRedist.msi
This method is slightly more flexible, but requires some preparation. Briefly,
to install the runtime this way copy whole contents of Redist\DISK1 folder to
the target computer and execute the setup.exe. Various third party
utilities provide means to convert contents of the folder into an easy
downloadable self-extracting executable.
Note:
DISK1 folder is a copy of the Release folder created
during compilation of the Samples\Deployment\VisualStudio\KCRedist Microsoft
Visual Studio setup and deployment project. This provides a way to further
customise the installer. Notice the Visual C++ prerequisite added to
the project. (Project node in project explorer > Properties > Prerequisites in
Visual Studio).
Samples\Deployment\KCRedist contains similar project for InstallShield installer
creation software.
Note: When redistributing a .NET application, which uses kernelCAD, you
might get an error "Failed to register KernCADne.ocx" or similar. This often
happens with Visual Studio Setup and Deployment projects because Visual Studio
automatically adds KernCADne.ocx next to the executable which uses it. In
addition to that KernCADne.ocx is instaled by the runtime. So there is a
duplication. The solution is to remove the automatically added KernCADne.ocx
from the deployment project. Visual Studio does not allow doing it directly. To
bypass this select the file and in properties panel select "Exclude".
Generic installation
To install the librraies execute vcredist_x86.exe provided in the
Redist\vcredist_x86_VS08 folder of the KernelCAD installation directory on the
target computer before installing and registering KernelCAD components. It is
recommended to add this step as a prerequisite for the installation process. It
can be aded automatically in Visual Studio Setup and Deployment projects or
Install Shield projects. See below for details. Other installer creation
software should have similar facility.
Redistributing using Microsoft Visual Studio
Visual Studio Setup and Deployment projects allow simple way of adding
prerequisite step for the installer: Select the setup project in the solution
explorer. In the context menu (right click) select Properties. Click
Prerequsites button The dialog displays prerequisites available for this version
of Visual Studio.
Visual Studio 2008
As KernelCAD is built using Visual Studio 2008 just turn on the "Visual C++
Runtime Libraries (x86)" check box and click OK.
Visual Studio other than 2008
By default your version of Visual Studio will have "Visual C++ Runtime .." for
ths particular version, not for VS 2008.
To make the correct prerequisite available in the prereqisites window close
Visual Studio. Copy vcredist_x86_VS08 folder from Redist subdirectory of the KernelCAD installation
directory to the
folder where Visual Studio searches for installed bootstrapper packages. For
Visual Studio 2005 it is the C:\Program Files\Microsoft Visual Studio
8\SDK\v2.0\BootStrapper\Packages\ folder. For Visual Studio 2010 it is
the C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
folder. For other versions of Visual Studio location of bootstrapped packages
directory can be determined on a 32 bit operating systems from Path value under
HKEY_LOCAL_MACHINE\Software\Microsoft\GenericBootstrapper\ key in the registry.
On a 64 bit systems look at the
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper key.
After the above, the prereqisites window should have "Visual C++ 2008 Runtime
Library (x86)" option. Select it. Clear any other "Visual C++ Runtime .." options
if your application does not depend on it.
Redistributing using InstallShield
To add the vcredist_x86.exe as a prerequisite to InstallShield environment
in the InstallShiedl menu select Tools > Prerequisite Editor. Open "Files To
Inclde" tab. Select Add and browse to the
vcredist_x86_VS08\vcredist_x86.exe in Redist subdirectory of the the KernelCAD installation
directory. Make sure vcredist_x86.exe is specified in the top combobox on the
"Application to Run" tab. Select "Save As" in the prerequisite editor menu and
type a name for the new prerequisite. Close the editor.
The prerequisite will appear in the Application Data > Redistributables view.
Turn on the check box next to it to add to the current installer
|