Custom Component Depoloyment (ESRI) – better to use TARGETDIR

I think ESRI may be wrong on how to properly set up a custom installer for your custom dll’s for ArcMap etc.

How to deploy a custom component using a setup project


custom install


It’s basically implying that you should use:


Which translates to soemthing like “C:\Program Files(x86)\MyCompany\bin\foo.dll”

But this may not always be true, what happens when your user wants to install to a custom installation directory?  The ESRIRegAsm.exe tool will always fire against – C:\Program Files(x86)\MyCompany\bin\foo.dll, and not where the user selected to install! – it’s basically hard wired so that means your customers could have problems trying to install your software.  It’s better to use:


Which is basically the value you get back from this stage in the installation process (although it’s not very clear as you don’t see that as a variable in the properties window for this stage!):

install folder


This will then run ESRIRegAsm.exe against where the user decided to install your dll’s, properly installing the dlls into ArcMap etc.  This is, I believe more foolproof.  However if I have got this wrong, I’m happy to be proved wrong 🙂

Custom Component Depoloyment (ESRI) – better to use TARGETDIR

Creating a Convex Hull with Points

Using a point featureclass as the input and a target polygon featureclass as the output to put the convex hull into, just use the following code:

def CreateConvex(inputfc, outputfc):
    pointArray = arcpy.Array()
    totalrows = arcpy.GetCount_management(inputfc)
    print "Points total is {0}".format(int(totalrows.getOutput(0)))

    #Loop through points in FC (points)
    desc = arcpy.Describe(inputfc)
    shapefieldname = desc.ShapeFieldName
    fields = ["SHAPE@"]
    with arcpy.da.SearchCursor(inputfc, fields) as cursor:
        for row in cursor:
        pnt = row[0].getPart()

    pointMultipoint = arcpy.Multipoint(pointArray)
    pointArray.removeAll() #frees up memory
    convexPolygon = pointMultipoint.convexHull()

    #Insert into output featureclass
    insertCursor = arcpy.da.InsertCursor(outputfc, ("SHAPE@"))
    del insertCursor #This actually inserts the row - very important!
    print "Inserted convex polygon"
Creating a Convex Hull with Points

Update: Bing Maps and Ordnance Survey data in ArcGIS Server 9.3.1

Apparently it is a known problem for OS data to not line up with Bing Maps service and in order to get round this you have to re-project all your British National Grid data to the WGS 1984 Web Mercator (Auxiliary Sphere) coordinate system.  How rubbish is that!

Anyway this problem is apparently known to ESRI and it is apparently fixed in verison 10 (it was tested by ESRI support in a beta 10 version).  So I guess we will have to wait until thats out and a few service packs have been released until we can feel confident with rolling out version 10.

On that note I’ll talk about this issue in about another year to 18 months (I would have thought!)

Update: Bing Maps and Ordnance Survey data in ArcGIS Server 9.3.1