Hi Michael
I read @Markus.Koechl's notes about this and that makes complete sense, but if you would like a separate menu definitions file for each Vault, and are interested in an off-the-wall idea, here's one for you.
- Store the MenuDefinitions.xml in the same place in each Vault, say $/Configuration/VDS/MenuDefinitions.xml
- Create a small add-in that captures the OnLogOn event
- In the event handler you can
- Check for C:\ProgramData\Autodesk\Vault 2025\Extensions\DataStandard\Vault.Custom\MenuDefinitions.xml
- Calculate the checksum for that file - https://adndevblog.typepad.com/manufacturing/2012/07/how-to-calculate-checksum.html
- Compare that with the checksum of the current version of $/Configuration/VDS/MenuDefinitions.xml ( the CkSum property of the file)
- If it matches, VDS is configured for that Vault
- If it doesn't match
- Download $/Configuration/VDS/MenuDefinitions.xml
- Copy it to C:\ProgramData\Autodesk\Vault 2025\Extensions\DataStandard\Vault.Custom
- Get the details of the running instance of Vault Pro
- Start a new instance of Vault Pro, which will then use the correct MenuDefinitions.xml
- Kill the running instance
This code shows how to kill Vault Pro from an add-in
public void OnLogOn(IApplication application)
{
System.Diagnostics.Process nProcess = System.Diagnostics.Process.GetCurrentProcess();
int nProcessID = nProcess.Id;
string sProcessName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
DialogResult res = MessageBox.Show("Hello World Extension loaded by process " + sProcessName + " with ID " + nProcessID.ToString() + " Close (Y/N)", "Close", MessageBoxButtons.YesNo);
if (res == DialogResult.Yes)
{
nProcess.Kill();
}
}
Hope that's of interest.
Nick