Using the SDK / API to determine SDL Trados studio version

Hi

How to I get the current version and edition of Studio from a C# plugin running inside Studio?

This post: https://community.sdl.com/developers-more/developers/language-developers/f/57/t/118 talks about stuff that I can't see exists anymore in the SDK.

Many thanks in advance.

Best regards

Ruvan

Parents
  • Hi.  How about this?

    using System;
    using System.Diagnostics;
    using System.IO;
    using System.Reflection;
    using System.Resources;

    public static string Version() { var x86Folderpath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); const string exeRelativepath = @"SDL\SDL Trados Studio\Studio4\SDLTradosStudio.exe"; var exeFullpath = Path.Combine(x86Folderpath, exeRelativepath); var assembly = Assembly.LoadFrom(exeFullpath); var resourceManager = new ResourceManager("Sdl.TranslationStudio.Application.StringResources", assembly); var version = string.Format(resourceManager.GetString("Version"), $"- {FileVersionInfo.GetVersionInfo(exeFullpath).FileVersion}"); return version; }
Reply
  • Hi.  How about this?

    using System;
    using System.Diagnostics;
    using System.IO;
    using System.Reflection;
    using System.Resources;

    public static string Version() { var x86Folderpath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); const string exeRelativepath = @"SDL\SDL Trados Studio\Studio4\SDLTradosStudio.exe"; var exeFullpath = Path.Combine(x86Folderpath, exeRelativepath); var assembly = Assembly.LoadFrom(exeFullpath); var resourceManager = new ResourceManager("Sdl.TranslationStudio.Application.StringResources", assembly); var version = string.Format(resourceManager.GetString("Version"), $"- {FileVersionInfo.GetVersionInfo(exeFullpath).FileVersion}"); return version; }
Children