patton44

Updating custom tools in ArcMap through vbScript

Discussion created by patton44 on Apr 21, 2010
I need to update a set of custom tools I created in ArcMap. The tools are part of a custom application created with VB .NET. I have added two new tools. The custom app is on many, many computers. Rather than going around to each and every computer and uninstalling and reinstalling the application I have created a vbScript that updates the dll and tlb file on each machine. I am using Wscript. I overwrite the existing dll with the updated one and register it using RegSvr32. I then overwrite the existing tlb file with the updated tlb file.

The dll and tlb files are updated but the new tools are not correctly added. In ArcMap they show up as missing (the circle symbol with a slash through it).

I am pretty sure I was able to get this to work in the past but now it is not working properly. In the past I was using VS 2005 and ArcMap 9.2. Now I am using VS 2008 and ArcGIS 9.3. Is there another method that I should use to update an existing dll and tlb file? Below is the vbScript I am using. Thanks for any advice.

' COPY THE UPDATED DLL, TLB AND INI FILES TO THE USER'S COMPUTER

Dim oShell

Set oDll = objFSO.GetFile(sSrcDll)
Set oShell = CreateObject("Wscript.Shell")
oDll.Copy sTargetDll,1
oShell.Run "RegSvr32 /s" & chr(34) & sTargetDll & chr(34)
oLogFile.WriteLine(sTargetDll & " was updated.")
oLogFile.WriteLine(" ")
Set oTlb = objFSO.GetFile(sSrcTlb)
oTlb.Copy sTargetTlb,1
oLogFile.WriteLine(sTargetTlb & " was updated.")
oLogFile.WriteLine(" ")
Set oIni = objFSO.GetFile(sSrcIni)
oIni.Copy sTargetIni,1
oLogFile.WriteLine(sTargetIni & " was updated.")
oLogFile.WriteLine(" ")

Outcomes