0% found this document useful (0 votes)
3 views4 pages

SolidWorks Plugin Installer Guide

This document outlines the steps to create an installer for a .NET WPF plugin for SolidWorks, emphasizing the importance of proper registration and integration. It includes guidance on building the plugin, preparing a registration class, selecting an installer tool, and configuring the installer to copy files and register the plugin in the Windows Registry. Additionally, it provides tips for testing and ensuring compatibility with SolidWorks installations.

Uploaded by

nawivac624
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

SolidWorks Plugin Installer Guide

This document outlines the steps to create an installer for a .NET WPF plugin for SolidWorks, emphasizing the importance of proper registration and integration. It includes guidance on building the plugin, preparing a registration class, selecting an installer tool, and configuring the installer to copy files and register the plugin in the Windows Registry. Additionally, it provides tips for testing and ensuring compatibility with SolidWorks installations.

Uploaded by

nawivac624
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

You're venturing into a solid, real-world scenario: creating a .

NET WPF (MVVM) plugin for


SolidWorks, and now you want to build a proper installer for it. That’s a smart move — it ensures
your users can install, register, and integrate your plugin easily without manual steps.

🧩 Step-by-Step: Building an Installer for a SolidWorks Plugin (WPF .NET)

🔧 Context:

 You're building a SolidWorks add-in in C# (.NET) using MVVM WPF for UI.

 SolidWorks expects the plugin to be registered in the Windows Registry and placed in a
known folder.

 You want an installer to handle:

o Copying files

o Registering the add-in

o Creating shortcuts (optional)

o (Optional) Checking if SolidWorks is installed

🪜 Step-by-Step Setup

✅ 1. Build Your Plugin Project

Make sure:

 Your project targets a supported .NET version (usually .NET Framework, not .NET Core/.NET
5–8) because SolidWorks APIs are COM-based, and they work best with .NET Framework
(e.g., 4.7.2).

 The project outputs a .dll file that implements ISwAddin (SolidWorks Add-in interface).

 You include a COM registration via [ComVisible(true)], [Guid(...)], etc.

✅ 2. Prepare a Registration Class (if not already)

SolidWorks uses COM registration and expects the add-in to be registered in the Windows Registry.
You need:

[ComVisible(true)]

[Guid("YOUR-GUID-HERE")]

public class MyAddin : ISwAddin

// Your plugin implementation

}
You can also include a [ComRegisterFunction] to handle registry entry creation:

[ComRegisterFunction]

public static void RegisterFunction(Type t)

// Add registry entries under HKLM\Software\SolidWorks\AddIns

Or handle registry writes manually in the installer (next step).

✅ 3. Choose an Installer Tool

Recommended options:

 Inno Setup (lightweight, scriptable)

 WiX Toolset (enterprise-grade, highly customizable)

 Advanced Installer (GUI + free version for basic installs)

✅ 4. Configure the Installer

You'll want to:

🗂 Copy Files:

 Copy your compiled .dll (add-in)

 Any WPF dependencies

 Optional: config files, resources, etc.

🧠 Register the Plugin (COM + SolidWorks AddIn)

SolidWorks expects registry keys like:

[HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\AddIns\{YOUR-GUID-HERE}]

@="Your Addin Description"

"Title"="MyPlugin"

"Description"="My SolidWorks Plugin"

"LoadAtStartup"=dword:00000001

You can use the installer script to create these.

💻 Optionally Register COM:

If you want to register your .dll as a COM server:

 Either call [Link] inside the installer


 Or use a built-in function in WiX/Inno to register a .NET assembly

✅ 5. (Optional) Detect SolidWorks Installation

You can check for existing SolidWorks installs by reading:

HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Applications\PDMWorks

Or similar keys, depending on SolidWorks version.

📦 Sample: Inno Setup Script (Simplified)

[Setup]

AppName=My SolidWorks Plugin

AppVersion=1.0

DefaultDirName={pf}\MyPlugin

DefaultGroupName=MyPlugin

[Files]

Source: "[Link]"; DestDir: "{app}"; Flags: regserver

[Registry]

Root: HKLM; Subkey: "Software\SolidWorks\AddIns\{YOUR-GUID-HERE}"; ValueType: string;


ValueName: ""; ValueData: "MyPlugin Description"

Root: HKLM; Subkey: "Software\SolidWorks\AddIns\{YOUR-GUID-HERE}"; ValueType: dword;


ValueName: "LoadAtStartup"; ValueData: 1

[Run]

Filename: "[Link]"; Parameters: """{app}\[Link]"" /codebase"; StatusMsg: "Registering


plugin..."; Flags: runhidden

You can build this .iss file with Inno Setup and compile it into an .exe installer.

🔄 What the Installer Will Do

✔️Copy the plugin .dll to a known location


✔️Register the DLL as COM (via regasm)
✔️Write the registry key SolidWorks uses to detect plugins
✔️Optionally, create desktop/start menu shortcuts or uninstall entries
Pro Tips

 Always test the installer on a clean environment or VM to ensure dependencies (e.g., .NET
Framework, registry access) are handled.

 Use x86 or x64 carefully depending on SolidWorks version.

 Sign your assembly and installer for smoother installs on enterprise systems.

🧠 TL;DR

 ✅ Build your add-in as a .NET Framework class library with proper COM attributes

 ✅ Use an installer like Inno Setup or WiX Toolset

 ✅ Installer should:

o Copy plugin DLLs

o Register COM components

o Add registry keys under SolidWorks\AddIns

 ✅ Optional: add uninstall support, detect SolidWorks versions, install dependencies

Let me know if you'd like a starter Inno Setup script, WiX template, or help generating your plugin
GUIDs or registry keys. I can walk you through it!

You might also like