Code: Select all
public void Install()
{
string[] filePaths = Directory.GetFiles(Application.StartupPath, "*.zip");
FastZip fastZip = new FastZip();
string fileFilter = null;
foreach (string s in filePaths)
{
pbInstaller.Value = 0;
lblInstalling.Text = "Installing: " + 0 + "%";
//Thread.Sleep(50); // Make it look like its finding more things to install
// will always overwrite if target filenames already exist
fastZip.ExtractZip(s, Application.StartupPath, fileFilter);
for (int i = 0; i <= 100; i++)
{
lblPercent.Text = "Installing: " + i + "%";
pbInstaller.Value = i;
Thread.Sleep(50); // Slow it down a little
if (i == 100)
{
pbInstaller.Value = 100;
lblPercent.Text = "Installing: " + 100 + "%";
Thread.Sleep(50); // Simulate waite while new zip gets ready
}
}
}
}
crzy