Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                /* Create a new instance of SEInstallData object. */
                SEInstallDataLib.SEInstallData installData = new SEInstallDataLib.SEInstallData();

                /* Beware: installData.GetVersion() appends 'x64' to end of string if x64 installation! */
                /* This comes from HKEY_LOCAL_MACHINE\SOFTWARE\Unigraphics Solutions\Solid Edge\Version XXX\CurrentVersion\Build */

                /* Solid Edge version */
                Version version = new Version(
                    installData.GetMajorVersion(),
                    installData.GetMinorVersion(),
                    installData.GetServicePackVersion(),
                    installData.GetBuildNumber());

                /* Parasolid version */
                Version parasolidVersion = new Version(
                    installData.GetParasolidMajorVersion(),
                    installData.GetParasolidMinorVersion());

                /* Solid Edge language.  i.e. 'English', 'German', etc. */
                CultureInfo cultureInfo = new CultureInfo(installData.GetLanguageID());

                /* Get path to Solid Edge program directory.  Typically, 'C:\Program Files\Solid Edge XXX\Program'. */
                DirectoryInfo programDirectory = new DirectoryInfo(installData.GetInstalledPath());

                /* Get path to Solid Edge installation directory.  Typically, 'C:\Program Files\Solid Edge XXX'. */
                DirectoryInfo installationDirectory = programDirectory.Parent;

                /* Get path to Solid Edge template directory.  Typically, 'C:\Program Files\Solid Edge XXX\Template'. */
                DirectoryInfo templateDirectory = new DirectoryInfo(Path.Combine(programDirectory.Parent.FullName, "Template"));

                /* Get path to Solid Edge training directory.  Typically, 'C:\Program Files\Solid Edge XXX\Training'. */
                DirectoryInfo trainingDirectory = new DirectoryInfo(Path.Combine(programDirectory.Parent.FullName, "Training"));

                // Output info to screen.
                Console.WriteLine("Language: '{0}'", cultureInfo);
                Console.WriteLine("Version: '{0}'", version);
                Console.WriteLine("VersionString: '{0}'", installData.GetVersion());
                Console.WriteLine("ParasolidVersion: '{0}'", parasolidVersion);
                Console.WriteLine("InstallFolderPath: '{0}'", installationDirectory.FullName);
                Console.WriteLine("ProgramFolderPath: '{0}'", programDirectory.FullName);
                Console.WriteLine("TemplateFolderPath: '{0}'", templateDirectory.FullName);
                Console.WriteLine("TrainingFolderPath: '{0}'", trainingDirectory.FullName);
            }
            catch (System.Exception ex)
            {
#if DEBUG
                System.Diagnostics.Debugger.Break();
#endif
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 2
0
        static string GetSolidEdgeInstallPath()
        {
            SEInstallDataLib.SEInstallData installData = new SEInstallDataLib.SEInstallData();
            /* Get path to Solid Edge program directory.  Typically, 'C:\Program Files\Solid Edge XXX\Program'. */
            DirectoryInfo programDirectory = new DirectoryInfo(installData.GetInstalledPath());

            /* Get path to Solid Edge installation directory.  Typically, 'C:\Program Files\Solid Edge XXX'. */
            DirectoryInfo installationDirectory = programDirectory.Parent;

            return(installationDirectory.FullName);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            try
            {
                /* Create a new instance of SEInstallData object. */
                SEInstallDataLib.SEInstallData installData = new SEInstallDataLib.SEInstallData();

                /* Beware: installData.GetVersion() appends 'x64' to end of string if x64 installation! */
                /* This comes from HKEY_LOCAL_MACHINE\SOFTWARE\Unigraphics Solutions\Solid Edge\Version XXX\CurrentVersion\Build */

                /* Solid Edge version */
                Version version = new Version(
                    installData.GetMajorVersion(),
                    installData.GetMinorVersion(),
                    installData.GetServicePackVersion(),
                    installData.GetBuildNumber());

                /* Parasolid version */
                Version parasolidVersion = new Version(
                    installData.GetParasolidMajorVersion(),
                    installData.GetParasolidMinorVersion());

                /* Solid Edge language.  i.e. 'English', 'German', etc. */
                var cultureInfo = new CultureInfo(installData.GetLanguageID());

                /* Get path to Solid Edge program directory.  Typically, 'C:\Program Files\Solid Edge XXX\Program'. */
                var programDirectory = new DirectoryInfo(installData.GetInstalledPath());

                /* Get path to Solid Edge installation directory.  Typically, 'C:\Program Files\Solid Edge XXX'. */
                var installationDirectory = programDirectory.Parent;

                /* Get path to Solid Edge template directory.  Typically, 'C:\Program Files\Solid Edge XXX\Template'. */
                var templateDirectory = new DirectoryInfo(Path.Combine(programDirectory.Parent.FullName, "Template"));

                /* Get path to Solid Edge training directory.  Typically, 'C:\Program Files\Solid Edge XXX\Training'. */
                var trainingDirectory = new DirectoryInfo(Path.Combine(programDirectory.Parent.FullName, "Training"));

                // Output info to screen.
                Console.WriteLine("Language: '{0}'", cultureInfo);
                Console.WriteLine("Version: '{0}'", version);
                Console.WriteLine("VersionString: '{0}'", installData.GetVersion());
                Console.WriteLine("ParasolidVersion: '{0}'", parasolidVersion);
                Console.WriteLine("InstallFolderPath: '{0}'", installationDirectory.FullName);
                Console.WriteLine("ProgramFolderPath: '{0}'", programDirectory.FullName);
                Console.WriteLine("TemplateFolderPath: '{0}'", templateDirectory.FullName);
                Console.WriteLine("TrainingFolderPath: '{0}'", trainingDirectory.FullName);
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 4
0
        static DirectoryInfo GetTrainingDirectory()
        {
            /* Create a new instance of SEInstallData object. */
            SEInstallDataLib.SEInstallData installData = new SEInstallDataLib.SEInstallData();

            /* Get path to Solid Edge program directory.  Typically, 'C:\Program Files\Solid Edge XXX\Program'. */
            DirectoryInfo programDirectory = new DirectoryInfo(installData.GetInstalledPath());

            /* Get path to Solid Edge training directory.  Typically, 'C:\Program Files\Solid Edge XXX\Training'. */
            DirectoryInfo trainingDirectory = new DirectoryInfo(Path.Combine(programDirectory.Parent.FullName, "Training"));

            return(trainingDirectory);
        }
        /// <summary>
        /// Returns the path to the Solid Edge program folder.
        /// </summary>
        /// <remarks>
        /// Typically 'C:\Program Files\Solid Edge XXX\Program'.
        /// </remarks>
        public static string GetProgramFolderPath()
        {
            var installData = new SEInstallDataLib.SEInstallData();

            try
            {
                /* Get path to Solid Edge program directory. */
                return(installData.GetInstalledPath());
            }
            finally
            {
                if (installData != null)
                {
                    Marshal.ReleaseComObject(installData);
                }
            }
        }
Ejemplo n.º 6
0
 // Restituisce string con i dati della versione
 public string VersioneSolidEdgeEInstallata()
 {
     string versione = "";
     try
         {
         installData = new SEInstallDataLib.SEInstallData();
         builderNumber = installData.GetBuildNumber();
         installFolder = new DirectoryInfo(installData.GetInstalledPath());
         cultureInfo = new CultureInfo(installData.GetLanguageID());
         majorVersion = installData.GetMajorVersion();
         minorVersion = installData.GetMinorVersion();
         parasolidMajorVersion = installData.GetParasolidMajorVersion();
         parasolidMinorVersion = installData.GetParasolidMinorVersion();
         parasolidVersion = new Version(installData.GetParasolidVersion());
         servicePackVersion = installData.GetServicePackVersion();
         version = new Version(installData.GetVersion());
         versione = string.Format("Versione di Solid Edge :  {1}\nVersione parasolid :  {0}\nCartella di installazione :  {2}", parasolidVersion.ToString(), version.ToString(), installFolder.FullName);
         }
     catch (System.Exception ex)
         {
         Console.WriteLine(ex.Message);
         }
     finally
         {
         if (installData != null)
             {
             Marshal.ReleaseComObject(installData);
             installData = null;
             }
         }
     return versione;
 }