How do I create an install for a custom SolidWorks addin?

Discussion in 'SolidWorks' started by solidworks311, May 13, 2008.

  1. I created an addin using Visual Studio 2005. How do I create an
    install so all users will have the addin added to SolidWorks and have
    the addin enabled by default?
     
    solidworks311, May 13, 2008
    #1
  2. solidworks311

    sturner Guest

    Official answer is too long to give here.
    Quick answer:
    Create a simple text file called Register.reg containing the following
    text:

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Solidworks\AddInsStartup\{GUID of your
    application}]
    @=dword:00000001

    [HKEY_LOCAL_MACHINE\SOFTWARE\SolidWorks\Addins\{GUID of your
    application}]
    @=dword:00000000
    "Description"="Addin description"
    "Title"="Addin Title"



    Now create a simple text file called Register.bat in the same folder
    as the addin dll. Add the following line:
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm /codebase
    addindllname.dll


    On each client, double click those 2 files to install the addin.
     
    sturner, May 16, 2008
    #2
  3. solidworks311

    That70sTick Guest

    Usually I generate the text for registry entries by drag-dropping the
    addin DLL into SW and then copy-paste the resulting entries from the
    registry (using Regedit). Don't forget to uninstall and unregister
    the DLL afterward.
     
    That70sTick, May 16, 2008
    #3
  4. I use InnoSetup to create installers for my products. I have listed
    the Code section of the installer script of one of my products, a 3DS
    file import add-in for SolidWorks. Replace the GUID with that of your
    add-in. 'strFileName' is the name of your add-in DLL.

    RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\SolidWorks
    \Applications\3DS Import for SolidWorks 2007', 'CLSID',
    '{553dc0fe-8b50-4a9b-93ab-009ea92d395e}');
    RegWriteStringValue(HKEY_CLASSES_ROOT, 'CLSID
    \{553dc0fe-8b50-4a9b-93ab-009ea92d395e}', '', '3D Studio 3DS file
    import add-in for SolidWorks developed by SYCODE (www.sycode.com)');
    RegWriteStringValue(HKEY_CLASSES_ROOT, 'CLSID
    \{553dc0fe-8b50-4a9b-93ab-009ea92d395e}\InProcServer32', '',
    ExpandConstant('{app}') + '\' + strFileName);

    The above works for add-ins developed in VC 6.0 for SolidWorks 2007
    and earlier. For add-ins developed in VC 2005 for SolidWorks 2008, I
    simply add the "regserver" flag on the add-in DLL in the installer
    script and let the installer register the DLL on the target computer.
    This helps because the uninstaller unregisters the add-in
    automatically.

    InnoSetup (www.innosetup.com) is an excellent piece of freeware and I
    use it to create installers for all my products, 101 of them. Its very
    robust, flexible and ends up making really small installer EXE files.
    Highly recommended.

    Hope this helps.

    Deelip Menezes
    www.deelip.com
     
    Deelip Menezes, May 17, 2008
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.