예제 #1
0
		private static void ProcessXRDllFile(InputFile file)
		{
			TestLoad(file.File);
			string zipFile = Zipper.MakeZipFileName(file.File, false);
			Zipper.ZipFile(file.File, zipFile, genData);
			rm.AddResource(GetDLLName(file), Utils.ReadFile(zipFile));
			File.Delete(zipFile);
		}
		private static void AddFile(ref ArrayList files, string file, bool mangleName, string resourceName)
		{
			if(!File.Exists(file))
				throw new Exception("E1006 File not found: " + file);
			string pfile = Path.GetFullPath(file);
			InputFile ipfile = new InputFile(pfile, mangleName);
			ipfile.ResourceName = resourceName;
			if(!files.Contains(ipfile)) files.Add(ipfile);
		}
예제 #3
0
		private static string GetDLLName(InputFile file)
		{
			try
			{
				if(file.MangleName)
				{
					string temp = starter.AssemblyInfoGen.GetFullDLLName(file.File);
					return MangleDllName(temp);
				}
				else
				{
					if(file.ResourceName == null)
					{
						return Path.GetFileNameWithoutExtension(file.File).ToLower();
					}
					else if(file.ResourceName.Equals("@"))
					{
						return starter.AssemblyInfoGen.GetFullDLLName(file.File);
					}
					else if(file.ResourceName.Equals("#"))
					{
						string temp = starter.AssemblyInfoGen.GetFullDLLName(file.File);
						int k = temp.IndexOf(',');
						if(k <= 0) return temp;
						return temp.Substring(0, k);
					}
					else
					{
						return file.ResourceName;
					}
				}
			}
			catch(Exception ex)
			{
				PrintWarning("1001 Cannot process assembly metadata!", ex);
				return Path.GetFileNameWithoutExtension(file.File);
			}
		}
예제 #4
0
		private static void ProcessFile(int i, InputFile file, ColorConsole c)
		{
			FileInfo fi = new FileInfo(file.File);
			lastLength = fi.Length;
			if(c != null) c.SetColor(Help.COL_NETZ);
			Logger.Log2((i < 10 ? " " : string.Empty) + i.ToString() + "|  ");
			if(c != null) c.Reset();
			Logger.Log(file.File);
			Logger.Log2(Netz.LOGPREFIX + Utils.FormatFileSize(fi.Length));
			fi = null;
			if(file.File.ToLower().EndsWith(".exe"))
			{
				ProcessExeFile(file.File);
			}
			else if(file.File.ToLower().EndsWith(".dll"))
			{
				ProcessDllFile(file);
			}
			else throw new Exception("E1010 Unsupported file type suffix");
		}