private static string GetVersion(VersionTypes versionType, bool isCore) { try { Assembly _EntryAssembly = Assembly.GetEntryAssembly(); AssemblyName[] _AllAssembly = _EntryAssembly.GetReferencedAssemblies(); Assembly _ExecutingAssembly = Assembly.GetExecutingAssembly(); Assembly _ass = isCore ? _ExecutingAssembly : _EntryAssembly; switch (versionType) { case VersionTypes.Long: return(_ass.GetName().Version.ToString()); //this.ToolTip = _ToolTip; case VersionTypes.Short: return(_ass.GetName().Version.Major.ToString() + '.' + _ass.GetName().Version.Minor.ToString()); case VersionTypes.Medium: return(_ass.GetName().Version.Major.ToString() + '.' + _ass.GetName().Version.Minor.ToString() + '.' + _ass.GetName().Version.Build.ToString()); default: return(string.Empty); } } catch { return("0.12.22.22"); } }
private static string GetVersionFromAssembly(Assembly assembly, VersionTypes versionType) { switch (versionType) { case VersionTypes.AssemblyVersion: return(assembly.GetName().Version.ToString()); case VersionTypes.FileVersion: return(GetFileVersionFromAssembly(assembly)); default: throw new ArgumentOutOfRangeException(nameof(versionType), versionType, null); } }
private static string GetVersionFromFile(FileInfo file, VersionTypes versionType) { switch (versionType) { case VersionTypes.AssemblyVersion: return(AssemblyName.GetAssemblyName(file.FullName).Version.ToString()); case VersionTypes.FileVersion: return(FileVersionInfo.GetVersionInfo(file.FullName).FileVersion); default: throw new ArgumentOutOfRangeException(nameof(versionType), versionType, null); } }
/// <summary> /// Start the Build with given filename, version, and build type. /// </summary> /// <param name="filename"></param> /// <param name="version"></param> /// <param name="build"></param> public void Build(string filename, VersionTypes version, BuildTypes build) { // build the command to call vsvars32.bat string initvar; switch (version) { case VersionTypes.VisualStudio2003: initvar = config.Get("VSVARS32_2003"); break; case VersionTypes.VisualStudio2005: initvar = config.Get("VSVARS32_2005"); break; default: throw new ArgumentOutOfRangeException("version=" + version); } initvar = String.Format("call \"{0}\"", initvar); // build the command to build the solution/project string buildcmd = new ConfigManager().Get("buildCommand"); buildcmd = buildcmd.Replace("{FILENAME}", StringUtil.Quote(filename)); buildcmd = buildcmd.Replace("{BUILDTYPE}", StringUtil.Quote(build.ToString())); string command = initvar + Environment.NewLine + buildcmd; //// setting up the dos environment //Dictionary<string, string> dosEnv = new Dictionary<string, string>(); //dosEnv.Add("PATH", StringUtil.Merge(MicrosoftDotNetPath, Environment.GetEnvironmentVariable("PATH"), ";")); // run the commands. ExeRunner r = new ExeRunner(); try { r.Run(command); } catch (Exception ex) { Debug.Write(ex.ToString()); // WARNING: absorb error only! } finally { log.AddRange(r.Log); } }
public static void Initialize(VersionTypes version, ResourceManager resourceManager, CultureInfo cultureInfo) { //언어리소스 로드 I18n.Load(resourceManager, cultureInfo); //버전 설정 VersionUtils.VersionType = version; //버전 처리 if (!VersionUtils.IsAdvertising) { //광고 버전이 아니면 체험판 확인 VersionUtils.IsTrial = new LicenseInformation().IsTrial(); //VersionUtils.IsTrial = true; } else { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); } //기본설정 로드 SettingManager.Instance.Load(); //시작 디바이스 설정 if (!VersionUtils.IsFull) { SettingManager.Instance.UpdateNLoad(SettingManager.KEY_DEVICE_TYPE, VersionUtils.IsTouchscreen ? DeviceTypes.TouchScreen : DeviceTypes.Mouse); } //히스토리 로드 HistorygManager.Instance.Load(); //프로퍼티 설정 KeyboardControlManager.Instance.ConnectionInfo = ConnectionManager.Instance.ConnectionInfo; PointingControlManager.Instance.ConnectionInfo = ConnectionManager.Instance.ConnectionInfo; PointingControlManager.Instance.SettingInfo = SettingManager.Instance.SettingInfo; if (CellularDataUtil == null) { CellularDataUtil = new CellularDataUtils(); } }
private void detectClientVersion() { try { var hash = UtilityLibrary.GetEverquestExecutableHash(AppDomain.CurrentDomain.BaseDirectory); if (hash == "") { MessageBox.Show("Please run this patcher in your Everquest directory."); this.Close(); return; } switch (hash) { case "85218FC053D8B367F2B704BAC5E30ACC": currentVersion = VersionTypes.Secrets_Of_Feydwer; splashLogo.Image = Properties.Resources.sof; break; case "859E89987AA636D36B1007F11C2CD6E0": case "EF07EE6649C9A2BA2EFFC3F346388E1E78B44B48": //one of the torrented uf clients, used by B&R too currentVersion = VersionTypes.Underfoot; splashLogo.Image = Properties.Resources.underfoot; break; case "A9DE1B8CC5C451B32084656FCACF1103": //p99 client case "BB42BC3870F59B6424A56FED3289C6D4": //vanilla titanium currentVersion = VersionTypes.Titanium; splashLogo.Image = Properties.Resources.titanium; break; case "368BB9F425C8A55030A63E606D184445": currentVersion = VersionTypes.Rain_Of_Fear; splashLogo.Image = Properties.Resources.rof; break; case "240C80800112ADA825C146D7349CE85B": case "A057A23F030BAA1C4910323B131407105ACAD14D": //This is a custom ROF2 from a torrent download currentVersion = VersionTypes.Rain_Of_Fear_2; splashLogo.Image = Properties.Resources.rof; break; case "6BFAE252C1A64FE8A3E176CAEE7AAE60": //This is one of the live EQ binaries. case "AD970AD6DB97E5BB21141C205CAD6E68": //2016/08/27 currentVersion = VersionTypes.Broken_Mirror; splashLogo.Image = Properties.Resources.brokenmirror; break; default: currentVersion = VersionTypes.Unknown; break; } if (currentVersion == VersionTypes.Unknown) { if (MessageBox.Show("Unable to recognize the Everquest client in this directory, open a web page to report to devs?", "Visit", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes) { System.Diagnostics.Process.Start("https://github.com/Xackery/eqemupatcher/issues/new?title=A+New+EQClient+Found&body=Hi+I+Found+A+New+Client!+Hash:+" + hash); } txtList.Text = "Unable to recognize the Everquest client in this directory, send to developers: " + hash; } else { //txtList.Text = "You seem to have put me in a " + clientVersions[currentVersion].FullName + " client directory"; } //MessageBox.Show(""+currentVersion); //txtList.Text += "\r\n\r\nIf you wish to help out, press the scan button on the bottom left and wait for it to complete, then copy paste this data as an Issue on github!"; } catch (UnauthorizedAccessException err) { MessageBox.Show("You need to run this program with Administrative Privileges" + err.Message); return; } }
/// <summary> /// Returns the version string of the specified type in assembly embedded in the specified file /// </summary> /// <param name="assemblyFile"></param> /// <param name="embeddedAssemblyName"></param> /// <param name="versionType"></param> /// <returns></returns> public static string ReadEmbeddedAssemblyVersion(FileInfo assemblyFile, string embeddedAssemblyName, VersionTypes versionType) { Assembly ass = Assembly.LoadFile(assemblyFile.FullName); string resourceName = ass.GetManifestResourceNames().FirstOrDefault(x => x.IndexOf(embeddedAssemblyName, StringComparison.InvariantCultureIgnoreCase) != -1); if (resourceName != null) { using (Stream resourceStream = ass.GetManifestResourceStream(resourceName)) { if (resourceStream == null) { return(null); } using (DeflateStream compressedString = new DeflateStream(resourceStream, CompressionMode.Decompress)) { MemoryStream memStream = new MemoryStream(); compressedString.CopyTo(memStream); memStream.Position = 0; byte[] rawAssembly = new byte[memStream.Length]; memStream.Read(rawAssembly, 0, rawAssembly.Length); Assembly reference = Assembly.Load(rawAssembly); return(Read(reference, versionType)); } } } return(null); }
/// <summary> /// Returns the version string of the specified type /// </summary> /// <param name="assembly"></param> /// <param name="versionType"></param> /// <returns></returns> public static string Read(Assembly assembly, VersionTypes versionType) { return(GetVersionFromAssembly(assembly, versionType)); }
/// <summary> /// Returns the version string of the specified type /// </summary> /// <param name="filePath"></param> /// <param name="versionType"></param> /// <returns></returns> public static string Read(string filePath, VersionTypes versionType) { return(Read(new FileInfo(filePath), versionType)); }
/// <summary> /// Returns the version string of the specified type /// </summary> /// <param name="file"></param> /// <param name="versionType"></param> /// <returns></returns> public static string Read(FileInfo file, VersionTypes versionType) { return(GetVersionFromFile(file, versionType)); }
public VersionField(bool nullable,VersionTypes VersionType) : base(int.MinValue,nullable) { _versionType=VersionType; }
public VersionField(int fieldLength,VersionTypes VersionType) :base(fieldLength,true) { }
private void detectClientVersion() { try { var hash = UtilityLibrary.GetEverquestExecutableHash(AppDomain.CurrentDomain.BaseDirectory); if (hash == "") { MessageBox.Show("Please run this patcher in your Everquest directory."); this.Close(); return; } switch (hash) { case "85218FC053D8B367F2B704BAC5E30ACC": currentVersion = VersionTypes.Secrets_Of_Feydwer; splashLogo.Image = Properties.Resources.sof; break; case "859E89987AA636D36B1007F11C2CD6E0": case "EF07EE6649C9A2BA2EFFC3F346388E1E78B44B48": //one of the torrented uf clients, used by B&R too currentVersion = VersionTypes.Underfoot; splashLogo.Image = Properties.Resources.underfoot; break; case "A9DE1B8CC5C451B32084656FCACF1103": //p99 client case "BB42BC3870F59B6424A56FED3289C6D4": //vanilla titanium currentVersion = VersionTypes.Titanium; splashLogo.Image = Properties.Resources.titanium; break; case "368BB9F425C8A55030A63E606D184445": currentVersion = VersionTypes.Rain_Of_Fear; splashLogo.Image = Properties.Resources.rof; break; case "240C80800112ADA825C146D7349CE85B": case "A057A23F030BAA1C4910323B131407105ACAD14D": //This is a custom ROF2 from a torrent download currentVersion = VersionTypes.Rain_Of_Fear_2; splashLogo.Image = Properties.Resources.rof; break; case "6BFAE252C1A64FE8A3E176CAEE7AAE60": //This is one of the live EQ binaries. currentVersion = VersionTypes.Broken_Mirror; splashLogo.Image = Properties.Resources.brokenmirror; break; default: currentVersion = VersionTypes.Unknown; break; } if (currentVersion == VersionTypes.Unknown) { if (MessageBox.Show("Unable to recognize the Everquest client in this directory, open a web page to report to devs?", "Visit", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes) { System.Diagnostics.Process.Start("https://github.com/Xackery/eqemupatcher/issues/new?title=A+New+EQClient+Found&body=Hi+I+Found+A+New+Client!+Hash:+" + hash); } txtList.Text = "Unable to recognize the Everquest client in this directory, send to developers: " + hash; } else { txtList.Text = "You seem to have put me in a " + clientVersions[currentVersion].FullName + " client directory"; } //MessageBox.Show(""+currentVersion); txtList.Text += "\r\n\r\nIf you wish to help out, press the scan button on the bottom left and wait for it to complete, then copy paste this data as an Issue on github!"; } catch (UnauthorizedAccessException err) { MessageBox.Show("You need to run this program with Administrative Privileges" + err.Message); return; } }
/// <summary> /// Returns the version string of the specified type /// </summary> /// <param name="type"></param> /// <param name="versionType"></param> /// <returns></returns> public static string Read(Type type, VersionTypes versionType) { return(Read(type.Assembly, versionType)); }
public VersionField(int fieldLength,bool nullable,VersionTypes VersionType) : base(fieldLength,nullable){ _versionType=VersionType; }
public VersionField(string FieldName,FieldType type,bool Nullable,int fieldLength,VersionTypes VersionType):base(FieldName,type,Nullable,fieldLength) { _versionType=VersionType; }
public VersionField(string FieldName,FieldType type,int fieldLength,VersionTypes VersionType) :this(FieldName,type,true,fieldLength,VersionType) { }
public VersionField(string FieldName,FieldType type,bool Nullable,VersionTypes VersionType):this(FieldName,type,Nullable,0,VersionType) { }
public VersionField(string FieldName,FieldType type,VersionTypes VersionType):this(FieldName,type,true,0,VersionType) { }