Convert C++ Add-In to Registry Free

  1. In the Application Properties dialog box, Build tab, in Output, clear the check box for"Register for COM interop.
  2. Create a file in the same folder as your project file, and name it "CPPOEMAddIn.X.manifest". Replace CPPOEMAddIn with the name of your add-in. Add the following lines to the manifest file. Edit the text in italics to match your add-in.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <assemblyIdentity name="CPPOEMAddIn" version="1.0.0.0" />
      <clrClass clsid="{89003b1d-548e-4508-a054-42ce772163b0}" 
                progid="CppOEMAddIn.CppOEMAddInAddInServer" 
                threadingModel="Both" 
                name="CppOEMAddIn.CppOEMAddInAddInServer" 
                runtimeVersion="" />
      <file name="CppOEMAddIn.dll" hashalg="SHA1" />
    
    

    The name of the assemblyIdentity element is the name of the project, as highlighted in the following image.

    The clsid is the class ID for your add-in and it is located in the .idl file associated with your add-in, as shown in the following image. The braces are required in the manifest file.

    The name attribute of the clrClass element consists of two parts, separated by periods. The first part is the name of your project. In this example, it is CppOEMAddIn. The second part is the name of the class that implements the ApplicationAddInServer interface, which is "CppOEMAddInAddInServer":

  3. Configure the project settings to embed the manifest correctly within the .dll. The first two settings are part of the Linker settings. The settings and the values to change them to are highlighted in the following image. In some cases, the values for these settings are already correct.
    Next are the Manifest Tool settings. Set Embed Manifest to Yes, as shown:
    In the Build Events section of the settings, remove the post-build step that registers the add-in in the registry. Clear any text from the Command Line field, as shown in the following image.
  4. Remove any code from the project that supports the registration of the add-in in the registry. This action removes the .rgs file associated with the project, and deletes the DllRegisterServer and DllUnregisterServer functions.
  5. Compile your project. If any errors occur during the compile, verify that the command string you entered matches the string in step 2.

    To verify that the manifest is correctly embedded, drag the add-in .dll into Visual Studio. The "RT_MANIFEST" folder displays, as shown in the following image. Double click the "2" icon to display a window with the actual manifest data.

  6. All registry-free add-ins require an .addin file. With a registry-based add-in, Inventor relies on the registry to get information about the add-in. The .addin file takes the place of the registry for this same information. The addin filename is in the form of Autodesk.AddInName.Inventor.addin. The following image is an example of the .addin file for an example primary add-in, with the portions to change in italics.
    <?xml version="1.0" encoding="utf-16"?>
    <Addin Type="Standard">
    	<ClassId>{2bf59d73-5170-4524-b0e1-391760aaffa5}</ClassId>
    	<ClientId>{2bf59d73-5170-4524-b0e1-391760aaffa5}</ClientId>
    	<DisplayName>MyOEMApp</DisplayName>
    	<Description>Inventor OEM Sample App</Description>
    	<Assembly>MyOEMApp\MyOEMApp.dll</Assembly>
    	<Hidden>0</Hidden>
    </Addin>
    

      Descriptions of elements in the addin file example:

    • ClassId and ClientId Both are the same value, which is the GUID at the top of the StandardAddInServer class.
    • DisplayName The value can be anything, and is the name of the add-ins as shown in the Add-In Manager.
    • Description The value can be anything, and is the description of the add-in as shown in the Add-In Manager.
    • Assembly Defines the name and path of the add-in .dll, relative to the OEM bin folder. The subfolder requires the same name as the add-in .dll.
    • Hidden Defines whether the add-in is visible in the Add-In Manager. A value of 1 indicates that it is hidden. However, if you right-click within the Add-In Manager and choose "Show hidden members," all add-ins display.
    • There can be other elements that are defined for other add-ins that either do not apply, or are ignored for an OEM primary add-in.

  7. Create a folder in the OEM\bin folder that is the same name as your add-in .dll, (minus the .dll portion of the name. Example full path to the new folder: "C:\Program Files\Autodesk\Inventor OEM 2014\Bin\MyOEMApp").

    Copy the add-in .dll to the new folder.

  8. Copy the .addin file to one of the following folders, depending on the scope of your add-in, and the operating system.
    • Version Independent
      If an .addin file is present in the following locations, the add-in loads in multiple versions of Inventor, based on the values of the "SupportedSoftwareVersionXXX" settings in the manifest file.
      • Windows XP C:\Documents and Settings\All Users\Application Data\Autodesk\Inventor Addins\
      • Windows7 C:\ProgramData\Autodesk\Inventor Addins\
    • Version Dependent
      A manifest file present in the following locations indicates that the add-in loads in a specific version of Inventor. Any values of the "SupportedSoftwareVersionXXX" settings in the manifest file are ignored.
      • Windows XP C:\Documents and Settings\All Users\Application Data\Autodesk\Inventor 2011\Addins\
      • Windows7 C:\ProgramData\Autodesk\Inventor 2011\Addins\
    • Per User Override
      When you save per user overrides, the manifest file generates automatically in the following locations. The settings in these manifest files override the setting values in the manifest files in the 'all users' folder. The names of these override manifest files match the names of the "master" files.
      • Windows XP C:\Documents and Settings\<user>\Application Data\Autodesk\Inventor 2011\Addins\
      • Windows7 C:\Users\<user>\AppData\Roaming\Autodesk\Inventor 2011\Addins\