Through the Interface: Building an Installer Part 1

Kean Walmsley

May 2015

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30


« Photo Scene Editor Competition | Main | Building an Installer – Part 2 »

September 13, 2010

Building an Installer – Part 1

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
  • [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

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:

Add a new project to the solution

We might add a simple Setup project, but the Setup Wizard will simplify a few steps for us:

Select a new Setup Wizard project

We start by being welcomed to the Setup Project Wizard…

Wizard Welcome

Next we select our project type – a standard Windows application deployment:

Project type selection

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

Project outputs to include

We can also enter some additional files here, but it’s pretty easy to add them later, too:

Additonal files to include

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:

Cannot get references for ComUtilities-dll

We can see in the Solution Explorer that a good deal of the heavy lifting has already been taken care of:

Our newly created Installer project

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).

Excluding a few core filesWe’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:

Let's go add a new file location

Here’s where we can add custom install locations for our application files and source:

Add a new folder for Install files

We can also create a hierarchy of folders, where our various files will end up being installed:Our new install locationsIndividual files can be told to be installed into these various locations via their properties window:

Change AcDbMgd-dll to install to our sub-folder 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):

Add our RegDL executable to the Install folderIn 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.

Our installed application files and source

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.

blog comments powered by Disqus


10 Random Posts