Package is empty - Workaround?

Started by NanoSector, December 28, 2012, 03:58:11 PM

Previous topic - Next topic

NanoSector

I thought about using 7zip, yes, before realizing that tinkering with the settings for DotNetZip may of have worked, which it did in the end. I'm still new to C# so I might of have made a mistake in my command line call in my program when using RAR.exe. Thanks for showing me your code :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

I just figured my PHP might be useful to someone ;)

NanoSector

Quote from: Arantor on December 30, 2012, 04:19:32 PM
I just figured my PHP might be useful to someone ;)
Yeah. If only I were writing it in PHP... :P
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

*shrug* I shared it because it covers more than just the code.

NanoSector

Quote from: Arantor on December 30, 2012, 04:24:52 PM
*shrug* I shared it because it covers more than just the code.
True, it covers how to use 7zip too. I might even port my program to use 7zip later on when users are gonna complain the packages are too big, but I think most users will not care. Thanks though :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

If you're building a .NET app, it's already going to be a multi-MB download in the first place. Bundling the 7zip CLI executable (licence permitting) will add a few hundred KB at most.

NanoSector

Quote from: Arantor on December 30, 2012, 04:29:12 PM
If you're building a .NET app, it's already going to be a multi-MB download in the first place. Bundling the 7zip CLI executable (licence permitting) will add a few hundred KB at most.
I'll try to build a better zipping process using 7zip now, just to see how this works. DotNetZip is an external library too.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Just remember that 7zip isn't a library, you can't use it as such.

NanoSector

Can't get it to run, sorry :S

            // Start the ZIP process.
            Directory.CreateDirectory(workingDirectory + "/temp");
            bool stat = CopyFolderContents(workingDirectory + "/Package", workingDirectory + "/temp");
            if (stat == false)
                MessageBox.Show("Unable to compile package; an error occured while copying files.", "Compiling Project", MessageBoxButtons.OK, MessageBoxIcon.Error);

            Directory.CreateDirectory(workingDirectory + "/temp/files");
            stat = CopyFolderContents(workingDirectory + "/Source", workingDirectory + "/temp/files");
            if (stat == false)
                MessageBox.Show("Unable to compile package; an error occured while copying files.", "Compiling Project", MessageBoxButtons.OK, MessageBoxIcon.Error);

            string cmdText = "7za a -rtzip \"" + sf.FileName + "\" \"" + workingDirectory + "/temp\"";
            System.Diagnostics.Process.Start("CMD.exe", cmdText);

            Directory.Delete(workingDirectory + "/temp");


I know it errors when entering the last line but it's not that what I'm worried about.

It opens a cmd.exe process, jumps to the directory but does nothing more.
This is the cmd.exe window:
http://prntscr.com/no0ee

Dunno what I did wrong :-\
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Probably because you're calling the wrong thing? 7za != 7z

NanoSector

Quote from: Arantor on December 30, 2012, 05:37:09 PM
Probably because you're calling the wrong thing? 7za != 7z
The executable is called 7za.exe in my project. The 7z command only works if someone has the actual program installed :-\
Even when I had the .exe added in my code it would do the same thing.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

*shrug* It worked for me, can't say any more than that.

NanoSector

Quote from: Arantor on December 30, 2012, 05:42:49 PM
*shrug* It worked for me, can't say any more than that.
Well, that leaves me with my old working code, thanks for trying to help me anyway :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: