I am already 80% finished with my program but this is really what I need to know how.
I want to add progress bar in it so the user will know of it was installed fine.
Here's my code
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog file = new OpenFileDialog();
file.Title = "Choose Package File";
file.InitialDirectory = @"c:\";
file.Filter = "All files (*.*)|*.*|All files (*.*)|*.*";
file.FilterIndex = 2;
file.RestoreDirectory = true;
if (file.ShowDialog() == DialogResult.OK)
{
textBox1.Text = file.FileName;
this.appFile = file.FileName;
}
}
private void button2_Click(object sender, EventArgs e)
{
// It doesn't
string command = "C:/Windows/System32/WindowsPowerShell/v1.0/Powershell.exe";
string cmd = "add-appxpackage ";
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = command;
startInfo.Arguments = cmd + appFile;
process.StartInfo = startInfo;
process.Start();
}