public void LoadPage() { base.SetBanner(Properties.Resources.Banner); Net.FileDownloader downloader = new Net.FileDownloader(); downloader.DownloadFailed += new EventHandler <Net.FileDownloadErrorEventArgs>(downloader_DownloadFailed); downloader.DownloadComplete += new EventHandler <Net.FileDownloadingEventArgs>(downloader_DownloadComplete); //,downloader.DownloadFile(@"http://www.pmuniverse.net/Installer/license.rtf", System.IO.Path.GetTempFileName()); downloader.DownloadFile(@"http://www.pmuniverse.net/Installer/license.rtf", licenseMemoryStream = new MemoryStream()); }
public void LoadPage() { base.SetBanner(Properties.Resources.Banner); Net.FileDownloader downloader = new Net.FileDownloader(); downloader.DownloadFailed += new EventHandler<Net.FileDownloadErrorEventArgs>(downloader_DownloadFailed); downloader.DownloadComplete += new EventHandler<Net.FileDownloadingEventArgs>(downloader_DownloadComplete); //,downloader.DownloadFile(@"http://www.pmuniverse.net/Installer/license.rtf", System.IO.Path.GetTempFileName()); downloader.DownloadFile(@"http://www.pmuniverse.net/Installer/license.rtf", licenseMemoryStream = new MemoryStream()); }
public void Install() { if (!Globals.InPortableMode) { Uninstall(); } UpdateStatus("Updating folder permissions..."); // Create the folder if (Directory.Exists(installOptions.DestinationDirectory) == false) { Directory.CreateDirectory(installOptions.DestinationDirectory); } if (!Globals.InPortableMode) { // Set the folder permissions AclManager Acl = new AclManager(installOptions.DestinationDirectory, AclManager.GetNormalUsersGroupName(), "F"); Acl.SetAcl(); } // Time to download the installation file... Net.FileDownloader downloader = new Net.FileDownloader(); // First let's subscribe to the events downloader.DownloadUpdate += delegate(object sender, Net.FileDownloadingEventArgs e) { // Display the progress of the download UpdateStatus("Downloading latest installation files... [" + e.Percent + "% complete]"); UpdateProgress(e.Percent); }; downloader.DownloadComplete += delegate(object sender, Net.FileDownloadingEventArgs e) { // The installation files have been downloaded, so we can continue installing them InstallationFilesDownloaded(); }; downloader.DownloadFailed += delegate(object sender, Net.FileDownloadErrorEventArgs e) { // Uh oh! The download failed! }; // Now we actually download the file if (File.Exists(installOptions.DestinationDirectory + "\\InstallationFiles-MapEditor.zip")) { InstallationFilesDownloaded(); } else { downloader.DownloadFile(installOptions.DownloadURL, installOptions.DestinationDirectory + "\\InstallationFiles-MapEditor.zip"); } //if (InstallComplete != null) // InstallComplete(this, EventArgs.Empty); }
public void Install() { if (!Globals.InPortableMode) { Uninstall(); } UpdateStatus("Updating folder permissions..."); // Create the folder if (Directory.Exists(installOptions.DestinationDirectory) == false) { Directory.CreateDirectory(installOptions.DestinationDirectory); } if (!Globals.InPortableMode) { // Set the folder permissions AclManager Acl = new AclManager(installOptions.DestinationDirectory, AclManager.GetNormalUsersGroupName(), "F"); Acl.SetAcl(); } // Time to download the installation file... Net.FileDownloader downloader = new Net.FileDownloader(); // First let's subscribe to the events downloader.DownloadUpdate += delegate(object sender, Net.FileDownloadingEventArgs e) { // Display the progress of the download UpdateStatus("Downloading latest installation files... [" + e.Percent + "% complete]"); UpdateProgress(e.Percent); }; downloader.DownloadComplete += delegate(object sender, Net.FileDownloadingEventArgs e) { // The installation files have been downloaded, so we can continue installing them InstallationFilesDownloaded(); }; downloader.DownloadFailed += delegate(object sender, Net.FileDownloadErrorEventArgs e) { // Uh oh! The download failed! }; // Now we actually download the file if (File.Exists(installOptions.DestinationDirectory + "\\InstallationFiles-Client.zip")) { InstallationFilesDownloaded(); } else { downloader.DownloadFile(installOptions.DownloadURL, installOptions.DestinationDirectory + "\\InstallationFiles-Client.zip"); } }