
For a significant number of users, installing the application is equivalent to the appearance of a shortcut on the desktop or a button on the toolbar. In this article, we will look at the mechanism for adding menus and toolbars for custom applications installed on nanoCAD Plus 8.5, as well as analyze the procedure for creating a shortcut that allows you to run a specific user application in the nanoCAD environment.
For those who are more interested in trying than reading the description, we immediately provide a
link to the distribution package of the application “Examples of nanoCAD SDK 8.5” . After installing this application, when you run nanoCAD Plus 8.5, examples created on LISP, C ++, C #, VB.NET, JScript and VBScript will be automatically loaded, and a drop-down menu and toolbar will be added to the user interface (as in the title screenshot), allowing call sample commands.
First, we illustrate a ready-made application for installing the examples bundled with nanoCAD Plus 8.5 - “Examples of nanoCAD SDK 8.5”, and then we will look at how to include a menu and toolbar description file.
')

Sample Installer Overview
The example installer for nanoCAD is a Windows Installer file named SamplesApp <version> .msi. After launch, it will build a list of installed versions of nanoCAD compatible with the installer, and will offer to choose which versions to install the application on, and which ones not:



Installation folder: C: \ Program Files (x86) \ Nanosoft \ Examples nanoCAD SDK 8.5 \ NCAD80x64.
The installed application “Examples of nanoCAD SDK 8.5” should be added to the startup list:

When nanoCAD 8.5 is launched, a message about the loaded application is displayed in the command line:

Downloaded commands can be executed:
• from the command line,
• from the drop-down menu installed with the application:

• or using the
nanoCAD SDK toolbar, where some commands of the SDK examples are placed:

What sets the installer
For each of the nanoCAD versions selected during the installation process, the installer creates a directory with example files:

For platforms 8.0-8.5, a full set of examples is installed (folder NCAD80x64), and for previous versions of the platform, only scripts (JS, VBS) are installed that do not require reassembly for each platform (folders get the names by version number: NC70x64, etc.). This is not a limitation of the application installation technology: if you build SDK samples of all previous versions, you can create a single installer that will install the full set of examples on all supported platforms.

Application Description File (* .package)

In addition to the application files, in the examples folder there is a package file - with the .package extension, which contains all the necessary information about the nanoCAD user configurations (including applications for download and user menus) and allows you to download the selected configuration immediately when nanoCAD starts.
Consider a batch file for loading NRX modules from the set of examples for nanoCAD. The content of the file is the following XML structure:
<?xml version="1.0" encoding="utf-8" ?> <ApplicationPackage xmlns="hostApplicationPackage/v01" Name="nanoCAD SDK Samples" > <Components> <ConfigEntry FileName="NCADSDK.cfg" FileType="CFG" /> <ComponentEntry AppName="HelloNRX minimal NRX sample" ModuleName="HelloNRX.nrx" ModuleType="NRX" /> <ComponentEntry AppName="CrossCircle Object Enabler" ModuleName="CrossCircle.nrx" ModuleType="NRX" /> <ComponentEntry AppName="CrossCircle Commands" ModuleName="CrossCircleUI.nrx" ModuleType="NRX" /> <ComponentEntry AppName="CrossCircle Managed Wrapper" ModuleName="CrossCircleMg.dll" ModuleType="NRX" /> <ComponentEntry AppName="CrossCircle Managed Commands" ModuleName="CrossCircleMgdList.dll" ModuleType="MGD" /> <ComponentEntry AppName="HelloHost .NET Sample" ModuleName="HelloHost.dll" ModuleType="MGD" /> <ComponentEntry AppName="HelloHost VB.NET Sample" ModuleName="HelloHostVB.dll" ModuleType="MGD" /> <ComponentEntry AppName="MultiCAD Objects" ModuleName="McsObjects.dll" ModuleType="MultiCAD" /> <ComponentEntry AppName="MultiCAD Symbols" ModuleName="Symbols.dll" ModuleType="MultiCAD" /> <ComponentEntry AppName="MultiCAD .NET Symbols" ModuleName="SymbolsMgd.dll" ModuleType="MGD" /> <ComponentEntry AppName="MultiCAD .NET CustomObjects" ModuleName="CustomObjects.dll" ModuleType="MGD" /> <ComponentEntry AppName="NSF Commands" ModuleName="hello_nsf.nsf" ModuleType="NSF" /> <ComponentEntry AppName="Tiles LISP Sample" ModuleName="Tiles.lsp" ModuleType="LISP" /> <ComponentEntry AppName="Hello World DCL Sample" ModuleName="helloworld.lsp" ModuleType="LISP" /> <ComponentEntry AppName="ListDialog DCL Sample" ModuleName="listdialog.lsp" ModuleType="LISP" /> <ComponentEntry AppName="MessageBox DCL Sample" ModuleName="messagebox.lsp" ModuleType="LISP" /> <ComponentEntry AppName="SinDialog DCL Sample" ModuleName="sindialog.lsp" ModuleType="LISP" /> </Components> </ApplicationPackage>
Elements that are used to describe the package:
• ApplicationPackage
• Components
• ConfigEntry
• ComponentEntry
The main ApplicationPackage element contains the Name attribute to specify the name of the application, which will be displayed on the command line when the download is complete.
The Components element describes the components of the package: the application loadable module is the ComponentEntry element, as well as the application configuration file with the menu ConfigEntry.
ComponentEntry contains attributes: AppName is the name of the application, ModuleName is the name of the executable module, ModuleType is the type of the module. The following types are allowed:
Command line options, create shortcut
The distribution kit “Examples of nanoCAD SDK 8.5” adds the application to autoload and it loads every time the platform starts. Consider the situation when the application does not need to automatically load, but it should load when you start nanoCAD using a special shortcut on the Windows desktop.
1. Disable autoload:

2. Create a shortcut for “C: \ Program Files \ Nanosoft \ nanoCAD x64 Plus 8.5 \ nCad.exe” (we assume that you installed nanoCAD x64 Plus 8.5 on drive C, in the Program Files folder), let's call it “nanoCAD Plus 8.5 with Examples of SDKs .lnk.
3. Add the following parameters to the command line:
a. -r - the name of the starting configuration (NCADSamples),
b. -p - Profile name (if not specified, corresponds to the name of the starting configuration),
c. -g - the path to the loaded application, can be specified several times.
When you first start using a new shortcut, a profile will be created whose name was specified on the shortcut command line:

It is important not to confuse the concepts of starting configuration and profile:
- Start configuration - contains information about which main and which additional user interface files (* .cfg) are loaded, as well as a link to the current profile. Designed to create independent configurations (shortcuts) in which applications are launched.
- Profile - contains the program settings. Different startup configurations can either refer to different, independent profiles, or use the same settings, referring to the same profile.
Conclusion
The source code for the installer of examples for nanoCAD is included in the SDK. In order to build the installer yourself, you need
WiX Toolset version 3.8. An example of the file with the .cfg extension is also included in the SDK, a description of the process of creating a custom toolbar and a custom menu nanoCAD is given in the
article .