diff --git a/Launcher2/LauncherMain.cs b/Launcher2/LauncherMain.cs index ae2e27d2e..f607f340c 100644 --- a/Launcher2/LauncherMain.cs +++ b/Launcher2/LauncherMain.cs @@ -38,6 +38,8 @@ namespace Launcher2 private GUIProgressBar progressBar; private GUIButton downloadButton; + GUIButton launchButton; + public bool FullScreenEnabled { get { return settings.FullScreenEnabled; } @@ -104,8 +106,8 @@ namespace Launcher2 guiRoot = new GUIFrame(new Rectangle(0,0,graphicsWidth, graphicsHeight), Color.Transparent); guiRoot.Padding = new Vector4(40.0f, 40.0f, 40.0f, 40.0f); - GUIButton button = new GUIButton(new Rectangle(0,0,100,30), "START", Alignment.BottomRight, GUI.Style, guiRoot); - button.OnClicked = LaunchClick; + launchButton = new GUIButton(new Rectangle(0,0,100,30), "START", Alignment.BottomRight, GUI.Style, guiRoot); + launchButton.OnClicked = LaunchClick; int y = 50; @@ -360,7 +362,8 @@ namespace Launcher2 if (string.IsNullOrWhiteSpace(latestVersionFolder)) return false; button.Enabled = false; - + launchButton.Enabled = false; + XDocument doc = null; try @@ -371,6 +374,7 @@ namespace Launcher2 catch (Exception e) { SetUpdateInfoBox("Error while updating: " + e.Message); + launchButton.Enabled = true; return false; } @@ -420,12 +424,14 @@ namespace Launcher2 { updateInfoText.Text = "Update failed"; SetUpdateInfoBox("Error while installing the update: "+e.Message); + launchButton.Enabled = true; return; - } + } UpdaterUtil.CleanUnnecessaryFiles(latestVersionFiles); updateInfoText.Text = "The game was updated succesfully!"; + launchButton.Enabled = true; //MessageBox.Show("Download completed!"); return; @@ -442,16 +448,13 @@ namespace Launcher2 WebClient webClient = new WebClient(); webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed); - //webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged); - - - + if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } - string fileDir = Path.GetDirectoryName(filesToDownload[filesDownloaded]); + string fileDir = dir+"\\"+Path.GetDirectoryName(filesToDownload[filesDownloaded]); if (!string.IsNullOrWhiteSpace(fileDir) && !Directory.Exists(fileDir)) { Directory.CreateDirectory(fileDir); diff --git a/Subsurface/Source/Utils/UpdaterUtil.cs b/Subsurface/Source/Utils/UpdaterUtil.cs index b1dbac8a3..368e72d93 100644 --- a/Subsurface/Source/Utils/UpdaterUtil.cs +++ b/Subsurface/Source/Utils/UpdaterUtil.cs @@ -150,7 +150,7 @@ namespace Subsurface File.Move(file, fileRelPath); } - Directory.Delete(updateFileFolder); + Directory.Delete(updateFileFolder, true); } public static void CleanUnnecessaryFiles(List filesToKeep) diff --git a/Subsurface_Solution.v12.suo b/Subsurface_Solution.v12.suo index 60b92d540..c7e248a4d 100644 Binary files a/Subsurface_Solution.v12.suo and b/Subsurface_Solution.v12.suo differ