Yes, exclude all of the ESRI references. The code I posted is in C# and I don't have a VB.NET version. This is an untested conversion of the first routine:
myBase.OnAfterInstall(savedState);
Dim regAsmPath As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles), "ArcGIS\bin\ESRIRegAsm.exe")
Dim appPath As String = System.Reflection.Assembly.GetExecutingAssembly().Location
Dim args As String = """" & appPath & """ /p:Desktop /s"
Dim startInfo As System.Diagnostics.ProcessStartInfo = new System.Diagnostics.ProcessStartInfo()
startInfo.FileName = regAsmPath
startInfo.Arguments = args
System.Diagnostics.Process.Start(startInfo)
Well, I was a bit impatient and attempted to build the Setup package --- I found this,http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/How_to_deploy_a_custom_...Which says to add an entirely NEW assembly/project soley for the purpose of adding the Installer Class file (instead of just having it inside of the target assembly that I want to register/install) -- the code they suggest is about midway down that page:Imports System.ComponentModel
Imports System.Configuration.Install
Public Class Installer1
Public Sub New()
MyBase.New()
'This call is required by the Component Designer.
InitializeComponent()
'Add initialization code after the call to InitializeComponent.
End Sub
Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
MyBase.Install(stateSaver)
'Register the custom component.
'-----------------------------
'The default location of the ESRIRegAsm utility.
'Note how the whole string is embedded in quotes because of the spaces in the path.
Dim cmd1 As String = """" + Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + "\ArcGIS\bin\ESRIRegAsm.exe" + """"
'Obtain the input argument (via the CustomActionData Property) in the setup project.
'An example CustomActionData property that is passed through might be something like:
'/arg1="[ProgramFilesFolder]\[ProductName]\bin\ArcMapClassLibrary_Implements.dll",
'which translates to the following on a default install:
'C:\Program Files\MyGISApp\bin\ArcMapClassLibrary_Implements.dll.
Dim part1 As String = Me.Context.Parameters.Item("arg1")
'Add the appropriate command line switches when invoking the ESRIRegAsm utility.
'In this case: /p:Desktop = means the ArcGIS Desktop product, /s = means a silent install.
Dim part2 As String = " /p:Desktop /s"
'It is important to embed the part1 in quotes in case there are any spaces in the path.
Dim cmd2 As String = """" + part1 + """" + part2
'Call the routing that will execute the ESRIRegAsm utility.
Dim exitCode As Integer = ExecuteCommand(cmd1, cmd2, 10000)
End Sub
Public Overrides Sub Uninstall(ByVal savedState As System.Collections.IDictionary)
MyBase.Uninstall(savedState)
'Unregister the custom component.
'---------------------------------
'The default location of the ESRIRegAsm utility.
'Note how the whole string is embedded in quotes because of the spaces in the path.
Dim cmd1 As String = """" + Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles) + "\ArcGIS\bin\ESRIRegAsm.exe" + """"
'Obtain the input argument (via the CustomActionData Property) in the setup project.
'An example CustomActionData property that is passed through might be something like:
'/arg1="[ProgramFilesFolder]\[ProductName]\bin\ArcMapClassLibrary_Implements.dll",
'which translates to the following on a default install:
'C:\Program Files\MyGISApp\bin\ArcMapClassLibrary_Implements.dll.
Dim part1 As String = Me.Context.Parameters.Item("arg1")
'Add the appropriate command line switches when invoking the ESRIRegAsm utility.
'In this case: /p:Desktop = means the ArcGIS Desktop product, /u = means unregister the Custom Component, /s = means a silent install.
Dim part2 As String = " /p:Desktop /u /s"
'It is important to embed the part1 in quotes in case there are any spaces in the path.
Dim cmd2 As String = """" + part1 + """" + part2
'Call the routing that will execute the ESRIRegAsm utility.
Dim exitCode As Integer = ExecuteCommand(cmd1, cmd2, 10000)
End Sub
Public Shared Function ExecuteCommand(ByVal Command1 As String, ByVal Command2 As String, ByVal Timeout As Integer) As Integer
'Set up a ProcessStartInfo using your path to the executable (Command1) and the command line arguments (Command2).
Dim ProcessInfo As ProcessStartInfo = New ProcessStartInfo(Command1, Command2)
ProcessInfo.CreateNoWindow = True
ProcessInfo.UseShellExecute = False
'Invoke the process.
Dim Process As Process = Process.Start(ProcessInfo)
Process.WaitForExit(Timeout)
'Finish.
Dim ExitCode As Integer = Process.ExitCode
Process.Close()
Return ExitCode
End Function
End Class
However, I didn't see how this related to the code you provided. Well, actually, I didn't put much effort into attempting to modify it because I thought this would actually perform the register for me. But it doesn't do as expected --- I ran the Setup.exe on a workstation and everything installed just fine! BUT! It did not register the .dll(s) with ArcGIS/Map -- and I had to select the "add from file" command from the Customize menu. And this actually did add the new toolbar.Anyway -- Thanks for your help and I'll attempt to alter the Installer class with the translated VB.NET code you've provided.Thanks!!!!!jamesEDIT: I think I will re-try with the entirely different Assembly that contains the new Installer class. I was a bit confused on whether or not I could just use the existing one in my target assembly and just replace/update the code in the Installer class file. Probably something really simple was left out.