aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs41
1 files changed, 3 insertions, 38 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
index dc5164465..64500b454 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs
@@ -81,7 +81,7 @@ namespace Tango.PPC.Common.MachineSetup
//Download software package.
var tempFile = TemporaryManager.CreateFile(".zip");
- UpdatingPackagesStatus = "Downloading application package...";
+ UpdatingPackagesStatus = "Downloading software package...";
int fileSize = 0;
UpdatingPackagesProgress = 0;
@@ -100,48 +100,13 @@ namespace Tango.PPC.Common.MachineSetup
LogManager.Log("Connecting to FTP site: " + setup_response.FtpAddress);
ftp.ConnectAsync().Wait();
LogManager.Log("Retrieving download size...");
- fileSize = (int)ftp.GetFileSize(setup_response.ApplicationFtpFilePath);
+ fileSize = (int)ftp.GetFileSize(setup_response.FilePath);
LogManager.Log("Download size: " + fileSize + " bytes.");
LogManager.Log("Starting download...");
- ftp.DownloadAsync(fs, setup_response.ApplicationFtpFilePath).Wait();
+ ftp.DownloadAsync(fs, setup_response.FilePath).Wait();
}
}
- //Extract software package.
- ZipFile.ExtractToDirectory(tempFile, software_package_folder);
-
- //Download embedded package.
- tempFile = TemporaryManager.CreateFile(".zip");
-
- UpdatingPackagesStatus = "Downloading embedded package...";
-
- fileSize = 0;
- UpdatingPackagesProgress = 0;
-
- using (FileStreamWrapper fs = new FileStreamWrapper(tempFile.Path, FileMode.Create, (current) =>
- {
- InvokeUINow(() =>
- {
- Thread.Sleep(10);
- UpdatingPackagesProgress = ((double)current / (double)fileSize) * 100d;
- });
- }))
- {
- using (FtpClient ftp = new FtpClient(setup_response.FtpAddress, setup_response.UserName, setup_response.Password))
- {
- LogManager.Log("Connecting to FTP site: " + setup_response.FtpAddress);
- ftp.ConnectAsync().Wait();
- LogManager.Log("Retrieving download size...");
- fileSize = (int)ftp.GetFileSize(setup_response.EmbeddedFtpFilePath);
- LogManager.Log("Download size: " + fileSize + " bytes.");
- LogManager.Log("Starting download...");
- ftp.DownloadAsync(fs, setup_response.EmbeddedFtpFilePath).Wait();
- }
- }
-
- //Extract embedded package.
- ZipFile.ExtractToDirectory(tempFile, embedded_package_folder);
-
//Synchronize database
String remote_address = setup_response.DbAddress;