How to set up Visual Studio so you can deploy your AutoCAD .net DLL via an MSI file or .exe Installer
We want our commands “auto loaded”. This means that your commands will be ready, without “netloading”.
After trawling through blogs, and through painful trial and error - here are my findings: the instructional video I wish I had if I was starting from the beginning:
I made a small mistake: within your “ApplicationFolder” Make sure you have another folder called “name-whatever-you-want.bundle” - with a .bundle
suffix. Put your contents in there. Sorry for the mistake.
Steps:
Install “Microsoft Visual Studio Installer Projects”
-
Go to the Visual Studio Market Place
-
Search for for: “Microsoft Visual Studio Installer Projects”
-
Filter by the appropriate Visual Studio version you are using
Setup Visual Studio
- Install DLLs in this location:
[ProgramFilesFolder]\Autodesk\ApplicationPlugins
- Dump all your things in a
my-name-is.bundle
folder. Make sure it ends with.bundle
. Put thePackageContents.xml
file as the first file in the bundle folder. - Dump your DLLs in a “Contents” folder within the
.bundle
. This is convention. Make sure your module name reflects the path location of your dll (see the xml file below).
Here is an image which sets it out clearly:
Set up PackageContext.xml
Here is but one example - there are many ways of doing this. (Change the names and file paths to suit your needs) or refer to the examples in the reference links below:
<?xml version="1.0" encoding="utf-8" ?>
<ApplicationPackage
SchemaVersion="1.0"
Version="1.0"
ProductCode=""
HelpFile=""
Name="PrecastTools"
Description="Tools for Precast"
Author="Ben Koshy" >
<CompanyDetails
Name="Tek1"
Phone="0411022502"
Url="www.tek1.com.au"
Email="ben.chenathara@gmail.com" />
<Components>
<RuntimeRequirements
OS="Win64"
Platform="AutoCAD" />
<ComponentEntry
AppName="PrecastTooks"
ModuleName="./Contents/PrecastTools.dll"
AppDescription="Helps handle brick snaps"
LoadOnCommandInvocation="True"
LoadOnAutoCADStartup="False">
<Commands GroupName="Commands">
<Command Global="Hey" Local="IJustMetYouAndThisIsCrazy" />
<Command Global="SPLITBRICKS" Local="SPLITBRICKS" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>
Distribute
Build and then distribute your MSI or your exe Installer.