Self updating AddIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi!
I made an AddIn that is actively used at my company. And by actively I mean by the users and the developer (me), so there are frequent updates for the AddIn holding new features and bug fixes.
Currently when a new version goes live, a Email is sent to ALL of the end-users that they need to run the installer to get the latest .dll file on their computer.
To avoid that someone forgets or ignores the email I would like to compare the AddIn .dll files the local one stored under
C:\Program Files\Autodesk\Inventor 2014\Bin
And the one on the network drive ( or maybe in the future, on the FTP server ). I did some research and found a way to do this check.
Dim myFileVersionInfo As FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo("C:\Program Files\Autodesk\Inventor 2014\Bin\xxxx.dll") Dim serverFileVersionInfo As FileVersionInfo serverFileVersionInfo = FileVersionInfo.GetVersionInfo("T:\Inventor\Tools\xxxxx\xxxxx.dll") Debug.Print(String.Compare(myFileVersionInfo.ProductVersion, serverFileVersionInfo.ProductVersion))
When this result = -1 the local file is out of date and the .dll file should be replaced. Problem is.. When Inventor is running the .dll file cannot be replaced. How should I handle this?
My check is currently situated in the activate sub
Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate ' This method is called by Inventor when it loads the AddIn. ' The AddInSiteObject provides access to the Inventor Application object. ' The FirstTime flag indicates if the AddIn is loaded for the first time. ' Initialize AddIn members. m_inventorApplication = addInSiteObject.Application ' Check for the file FileVersionCheck() End Sub
Please kudo if this post was helpfull
Please accept as solution if your problem was solved
Inventor 2014 SP2