예제 #1
0
파일: Program.cs 프로젝트: Crae/rhiexec
        private static void WriteVersionInfoToLog(string[] args)
        {
            // Apparently sometimes OSInfo can fail; we'd rather write the log file
            // and continue installing than have this information.
            // Fixes http://dev.mcneel.com/bugtrack/?q=68442
            try
            {
                Logger.Log(LogLevel.Info, string.Format("Start: rhiexec\nversion {0}\n{1}\n{2} {3} {4} {5}",
                                                        System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
                                                        InstallerEngine.Is64BitProcess() ? "64-bit" : "32-bit",
                                                        OSInfo.Name, OSInfo.Edition, OSInfo.ServicePack, OSInfo.VersionString));
            }
            catch
            {
                Logger.Log(LogLevel.Warning, "System information could not be loaded");
            }

            try
            {
                StringBuilder msg = new StringBuilder();
                msg.Append("arguments: ");
                foreach (string arg in args)
                {
                    msg.Append("\r\n\"").Append(arg).Append("\"");
                }
                Logger.Log(LogLevel.Info, msg.ToString());
            }
            catch
            {
                Logger.Log(LogLevel.Warning, "command line arguments could not be printed");
            }

            Logger.Log(LogLevel.Info, "Logging started: " + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture));
        }
예제 #2
0
파일: RhinoInfo.cs 프로젝트: Crae/rhiexec
 private RegistryKey OpenPluginKey(RegistryKey RegRoot)
 {
     if (this.RhinoVersion.Major == 4 && this.RhinoVersion.Minor == 0)
     {
         if (InstallerEngine.Is64BitProcess())
         {
             // Installer running in 64-bit process
             if (this.OS == OSPlatform.x86)
             {
                 if (RegRoot == Registry.LocalMachine)
                 {
                     return(RegRoot.CreateSubKey(string.Format(CultureInfo.InvariantCulture, @"Software\Wow6432Node\McNeel\Rhinoceros\4.0\{0}\Plug-ins", this.BuildDate)));
                 }
                 else
                 {
                     return(RegRoot.CreateSubKey(string.Format(CultureInfo.InvariantCulture, @"Software\McNeel\Rhinoceros\4.0\{0}\Plug-ins", this.BuildDate)));
                 }
             }
         }
         else
         {
             // Installer running in 32-bit process
             if (this.OS == OSPlatform.x86)
             {
                 return(RegRoot.CreateSubKey(string.Format(CultureInfo.InvariantCulture, @"Software\McNeel\Rhinoceros\4.0\{0}\Plug-ins", this.BuildDate)));
             }
         }
         throw new UnsupportedPlatformException(this.OS.ToString());
     }
     else if (this.RhinoVersion.Major == 5)
     {
         if (InstallerEngine.Is64BitProcess())
         {
             // Installer running in 64-bit process
             if (this.OS == OSPlatform.x86)
             {
                 if (RegRoot == Registry.LocalMachine)
                 {
                     return(RegRoot.CreateSubKey(@"Software\Wow6432Node\McNeel\Rhinoceros\5.0\Plug-ins"));
                 }
                 else
                 {
                     return(RegRoot.CreateSubKey(@"Software\McNeel\Rhinoceros\5.0\Plug-ins"));
                 }
             }
             else if (this.OS == OSPlatform.x64)
             {
                 return(RegRoot.CreateSubKey(@"Software\McNeel\Rhinoceros\5.0x64\Plug-ins"));
             }
         }
         else
         {
             // Installer running in 32-bit process
             if (this.OS == OSPlatform.x86)
             {
                 return(RegRoot.CreateSubKey(@"Software\McNeel\Rhinoceros\5.0\Plug-ins"));
             }
         }
         throw new UnsupportedPlatformException(this.OS.ToString());
     }
     else
     {
         throw new RhinoVersionNotSupportedException("OpenCurrentUserPluginKey doesn't support Rhino version " + RhinoVersion);
     }
 }