• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help change single file lzma maker to multiple in c#
#1
Question 
guys i use this code to create my files for App updater.
with this code i can just select one files every time and also the output copied to clipboard and zipped files crated in same directory near unzipped files.
BUT:
i need to edit this code for:

1)possible to select multiple files (all files with files in folders and sub folders) or i think its better give a folder address to add all files also the files in sub folders.
2)put output data on a file named "info.xml" except clipboard in somewhere.(each data for each files in per line)
an example for output data on clipboard is:
CSHARP Code
  1. <ContentFile Name="logo.bmp" Size="109976" SHA1Hash="280EFF2ADD6557E90C542263B1C7971F8EBF19A8" CompressedSize="8625" />

3) at last put zipped files (lzma format) on the other place with same files names and folders and sub folders with included files.

Guys i need full code.
Thank you for Help

this is my code:

CSHARP Code
  1. namespace UpdateBuilder
  2. {
  3. public partial class MainFrm : Form
  4. {
  5.  
  6. public string fileName = "";
  7. public string output = "";
  8.  
  9. public MainFrm()
  10. {
  11. InitializeComponent();
  12. }
  13.  
  14. private void browseBtn_Click(object sender, EventArgs e)
  15. {
  16. // Show a file browsing dialog
  17. OpenFileDialog dialog = new OpenFileDialog();
  18. dialog.Filter = "All files (*.*)|*.*";
  19. dialog.InitialDirectory = Directory.GetCurrentDirectory();
  20. dialog.Title = "Select a file to build";
  21. if (dialog.ShowDialog() == DialogResult.OK)
  22. {
  23. // Place the selected file's path in the input textbox
  24. inBox.Text = dialog.FileName;
  25. fileName = dialog.SafeFileName;
  26. }
  27. }
  28.  
  29. private void buildBtn_Click(object sender, EventArgs e)
  30. {
  31. if (inBox.Text != "")
  32. {
  33. // Disable all controls
  34. inBox.Enabled = false;
  35. browseBtn.Enabled = false;
  36. buildBtn.Enabled = false;
  37.  
  38. // Start the converion utility
  39. ProcessStartInfo startInfo = new ProcessStartInfo();
  40. startInfo.FileName = "lzma.exe";
  41. startInfo.Arguments = "e " + inBox.Text + " " + inBox.Text + ".lzma -d21";
  42. startInfo.CreateNoWindow = true;
  43. startInfo.WindowStyle = ProcessWindowStyle.Hidden;
  44.  
  45. using (Process p = Process.Start(startInfo))
  46. {
  47. // And wait for it to finish
  48. while (!p.HasExited)
  49. {
  50. Thread.Sleep(100);
  51. }
  52. }
  53.  
  54. // Generate that final string
  55. FileInfo inFile = new FileInfo(inBox.Text);
  56. FileInfo outFile = new FileInfo(inBox.Text + ".lzma");
  57. output = "<ContentFile Name=\"" + fileName + "\" Size=\"" + inFile.Length.ToString() + "\" SHA1Hash=\"" + HashCalc.GetSHA1Hash(inBox.Text) + "\" CompressedSize=\"" + outFile.Length.ToString() + "\" />";
  58.  
  59. // Re-enable the controls
  60. inBox.Enabled = true;
  61. browseBtn.Enabled = true;
  62. buildBtn.Enabled = true;
  63.  
  64. // Show notice and copy output to clipboard
  65. Clipboard.SetText(output);
  66. MessageBox.Show("Build succeeded.\nCopied output to clipboard.");
  67. }
  68. else
  69. {
  70. MessageBox.Show("Please select a file to build.");
  71. }
  72. }
  73.  
  74. }
  75. }
  Reply
#2
pleas some one help me
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Using Cheat Engine 6.2 to change BO2 address values wzlrsaur 6 4,606 08-06-2013, 06:28
Last Post: 14th
  [Release] Box maker E-losev 4 1,630 07-17-2013, 04:18
Last Post: E-losev
  Mw3 Feed Color Change?? aluzion 5 2,597 07-16-2013, 19:52
Last Post: barata
  Change death animation Keouf 3 1,493 07-05-2013, 18:39
Last Post: Nekochan
  [Release] Black Ops Single Player/Zombie Trainer V3.6 Craig87 52 40,686 07-01-2013, 15:12
Last Post: explosivebanana55
Wink Preview Black ops 2 - CFG file dump SLiiTH3R 11 9,827 06-09-2013, 16:01
Last Post: dylankrajewski
  Using Cheat Engine with Zombies Single Player kikkawa 3 6,224 06-03-2013, 01:18
Last Post: kikkawa
  [Release] Modern Warfare 3 Fast File Sounds master131 5 10,404 05-21-2013, 16:46
Last Post: ZURA.
Information How to change text messages in MP (.ff edit) giofrida 5 2,111 05-02-2013, 20:05
Last Post: Pozzuh
Brick [Release] MW3 Single Player CONSOLE v1.9.433 can1907 13 15,749 05-01-2013, 15:18
Last Post: vton

Forum Jump:


Users browsing this thread: 1 Guest(s)