Hey guys,
I need to know how to call some code when Dynamo is still starting.
I have done this in grasshopper (similar to dynamo) like this:
public override GH_LoadingInstruction PriorityLoad() { Grasshopper.Instances.DocumentServer.DocumentAdded += DocumentAdded; var directoryToCopyUpdates = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\AppData\Roaming\Grasshopper\Libraries\SwecoGrasshopperLibrariesCopier_TS2017i.exe"; Process.Start(directoryToCopyUpdates); return GH_LoadingInstruction.Proceed; }
The trick here was that if any package contains a overwrite of PriorityLoad function that is called before grasshopper starts.