tags:

views:

121

answers:

1

Please forgive my noob-ness on this, but how do I package LAME.exe w/ a C# setup project? Currently, I have LAME being called like:

//use stringbuilder to create arguments    
var psinfo = new ProcessStartInfo( @"lame.exe")
    {
         Arguments = sb.ToString(),
         WorkingDirectory = Application.StartupPath,
         WindowStyle = ProcessWindowStyle.Hidden 
    };
var p = Process.Start( psinfo );
p.WaitForExit();

This works in debug and release modes on the development machine, but when I create a setup project for this, it never creates the MP3. LAME and the compiled code reside in the same directory when installed. Help!

A: 

WindowStyle = ProcessWindowStyle.Hidden

Comment this out so you can actually read the error message that lame produces. Using a separate EXE is brittle this way, you cannot detect nor diagnose it failing to do its job. You might see something from Process.ExitCode, non-zero values are supposed to indicate failure.

Hans Passant
Unfortunately, that didn't help. The LAME process didn't stay on the screen long enough to be useful.
CitizenX
Run it with cmd.exe /k lame.exe *options* so the console window stays open.
Hans Passant
Thanks, Hans. Turns out it was a directory issue.
CitizenX
I should have specified more detail: the problem was in the call to LAME. It contained a directory with a name like "this place". The problem wasn't with the deployment. Thanks, again, Hans for helping me troubleshoot this.
CitizenX