It’s been a long time since I’ve dabbled with software deployment technology, which is absolutely fine by me (in my experience installation issues are some of the gnarliest to deal with, so – presumably like the majority of developers, with apologies to Install specialists – I prefer not having to care about them, myself). But last week I had to put together a few installers - as an internal test - for some of our Plugins of the Month, and ended up deciding the process was worth documenting, especially where it relates to the RegDL component I created and published earlier in the year.
Over the course of the next few posts, I’m going to step through the process I used to create a (relatively) simple installer for the upcoming “BrowsePhotosynth for AutoCAD” Plugin of the Month, which will be based on the code developed in the series culminating in this post. (The code has been polished a fair bit since then, by the way, but you’ll see all that soon enough. :-)
This project is quite interesting as it demonstrates a number of requirements:
- [Part 1 – Basic file installation]
- We have standard AutoCAD dependencies we want to exclude from the installer
- We want to publish the source for the plugin along with the binaries
- We have a number of 3rd party components to install
- [Part 2 – Registry stuff]
- We want to use the RegDL tool to simplify installation
- i.e. no manual Registry editing to enable demand-loading
- We have a COM DLL that also requires registration
- We want to use the RegDL tool to simplify installation
- [Part 3 – User interface tweaks]
- We’d like to customise the UI for the installer
- To add a custom banner
- To remove the “install for everyone” option
- We’d like to customise the UI for the installer
Which hopefully means that while we’re looking at a specific sample application to deploy, it is interesting enough to be relevant to anyone choosing a similar approach to creating an installer.
Without further ado, let’s start with our basic Visual Studio (in my case 2008) solution, and add in a custom Installer project:
We might add a simple Setup project, but the Setup Wizard will simplify a few steps for us:
We start by being welcomed to the Setup Project Wizard…
Next we select our project type – a standard Windows application deployment:
Next we select our project inputs. There are a number of inputs in the solution we want to select:
- Browser project
- Primary output from Browser
- Source files from Browser
- Importer project
- Primary output from Importer
- Source files from Importer
- Content files from Importer
- Processor project
- Primary output from Processor
- Source files from Processor
We can also enter some additional files here, but it’s pretty easy to add them later, too:
Then we get a summary of our setup project choices:
When we select “Finish”, we get warned that not all project dependencies could be parsed, which is a quirk of one of the 3rd party component modules we’re using and safe to ignore:
We can see in the Solution Explorer that a good deal of the heavy lifting has already been taken care of:
Which leaves us to head on into the detail, where the devil is no doubt lurking… :-)
We certainly want some of the standard dependencies to be excluded, to stop them from being installed:
- AcCui.dll
- AcTcMgd.dll
- AcWindows.dll
- AdWindows.dll
- All core AutoCAD modules that the project uses
- ADNPlugin-PhotosynthProcessor.dll
- This is also a project output
- Interop.ComUtilitiesLib.dll
- We have this twice in the list and only need it installed once
You’ll notice I’ve excluded neither AcMgd.dll nor AcDbMgd.dll: these two are going to be installed, but only for the RegDL tool to be able to load in the custom .NET types that our managed assembly uses (so we can generate demand-loading keys for it).
We’ll put these two DLLs in a custom location beneath the main application folder (which we’ll call “Install”), so they don’t cause a conflict with the standard AutoCAD DLLs, in case we get installed there. To create a new install location, we need to hop on across to the File System view:
Here’s where we can add custom install locations for our application files and source:
We can also create a hierarchy of folders, where our various files will end up being installed:Individual files can be told to be installed into these various locations via their properties window:
We can also add new files into the installation set directly from this view (by right-clicking in the File System tree and selecting Add, then browsing to the file to be added):
In case you’re interested in testing it, the installer can already be built and used: you should see a set of files and folders created in the selected location, although no Registry entries are – as yet – being created.
I’ve taken the liberty of omitting a few steps in the above process, where I added a few files “manually”: I wanted to include the overall solution file in the root “Source” folder, as well as the .vdproj file in an “Installer” folder beneath it, but those are changes that are quite specific to my needs and will, in any case, be obvious from the project I provide at the end of the series.
In the next post we’ll focus on all things Registry-related – making appropriate loading settings for AutoCAD demand-loading and for COM.