Acme.PROJECTNAME.Install.ArchiveReader.CreateFileFromResource C# (CSharp) Method

CreateFileFromResource() private static method

private static CreateFileFromResource ( string resourceFileName, string diskFileName ) : void
resourceFileName string
diskFileName string
return void
		private static void CreateFileFromResource(string resourceFileName, string diskFileName)
		{
			try
			{
				StringBuilder sb = new StringBuilder();
				Assembly asm = Assembly.GetExecutingAssembly();
				System.IO.Stream manifestStream = asm.GetManifestResourceStream(resourceFileName);
				try
				{
					BinaryReader theReader = new BinaryReader(manifestStream);
					FileStream outputStream = new FileStream(diskFileName, FileMode.Create);
					BinaryWriter theWriter = new BinaryWriter(outputStream); byte[] theFileRead = new byte[manifestStream.Length];
					manifestStream.Read(theFileRead, 0, theFileRead.Length);
					theWriter.Write(theFileRead);
					theReader.Close();
					theWriter.Close();
				}
				catch (Exception ex) { }
				finally
				{
					manifestStream.Close();
				}
			}
			catch (Exception ex)
			{
				throw;
			}
		}