-1

I am working on a program that needs to extract a WinRar SFX automatically. Is there anyway I can programmatically click a install button once the exe is started with a Process? Here is the code that I have so far.

public bool Extract()
    {
        try
        {
            Process process = new Process();
            process.StartInfo.WorkingDirectory = FilePath;
            process.StartInfo.FileName = FilePath + fileName;

            process.Start();

            process.WaitForExit();
        }
        catch (Exception)
        {
            return false;
        }

        return true;
    }
deggen
  • 9
  • 2
  • possible duplicate of [click on a button in another application from my C# application?](http://stackoverflow.com/questions/4899573/click-on-a-button-in-another-application-from-my-c-sharp-application) – Sinatr Jan 15 '15 at 16:09

1 Answers1

0

You could make the sfx silent with winrar.

Here is a link

Cako
  • 396
  • 3
  • 15
  • I am not making the winrar. It is a file we are downloading. – deggen Jan 15 '15 at 16:22
  • And you need to run it? You could use dotnetzip and extracts it – Cako Jan 15 '15 at 16:23
  • Is there a way to change the directory when extracting with dotnetzip? Ex. The program is in C:/programs but the exe is in C:/Downloads – deggen Jan 15 '15 at 16:32
  • Yes you can, see this http://dotnetzip.herobo.com/DNZHelp/html/5aa95a4f-09cd-2f4a-9b0f-92ee223b075b.htm – Cako Jan 15 '15 at 17:16