diff --git a/ULauncherPro/MainWindow.xaml.cs b/ULauncherPro/MainWindow.xaml.cs index f46d689..23cc3ea 100644 --- a/ULauncherPro/MainWindow.xaml.cs +++ b/ULauncherPro/MainWindow.xaml.cs @@ -2128,6 +2128,7 @@ void CreateNewEmptyProject(string targetFolder = null) if (results == true) { // TODO check if that folder already exists (automatic naming avoids it, but manual naming could cause it) + rootFolder = NewProject.targetFolder; Console.WriteLine("Create project " + NewProject.newVersion + " : " + rootFolder); if (string.IsNullOrEmpty(rootFolder)) return; diff --git a/ULauncherPro/NewProject.xaml.cs b/ULauncherPro/NewProject.xaml.cs index 5d821b0..3a11f14 100644 --- a/ULauncherPro/NewProject.xaml.cs +++ b/ULauncherPro/NewProject.xaml.cs @@ -22,7 +22,7 @@ public partial class NewProject : Window int previousSelectedTemplateIndex = -1; int previousSelectedModuleIndex = -1; - static string targetFolder = null; + public static string targetFolder { get; private set; } = null; public NewProject(string unityVersion, string suggestedName, string targetFolder, bool nameIsLocked = false) { @@ -355,6 +355,7 @@ private void txtNewProjectFolder_TextChanged(object sender, TextChangedEventArgs { txtNewProjectFolder.BorderBrush = null; btnCreateNewProject.IsEnabled = true; + targetFolder = txtNewProjectFolder.Text; } } } diff --git a/ULauncherPro/Tools.cs b/ULauncherPro/Tools.cs index 1c03e1c..11b799d 100644 --- a/ULauncherPro/Tools.cs +++ b/ULauncherPro/Tools.cs @@ -1708,11 +1708,18 @@ public static Project FastCreateProject(string version, string baseFolder, strin // unzip or copy template if (templateZipPath != null) { - //Console.WriteLine(templateZipPath); + // Console.WriteLine(templateZipPath); if (File.Exists(templateZipPath)) { - TarLib.Tar.ExtractTarGz(templateZipPath, newPath); + try + { + TarLib.Tar.ExtractTarGz(templateZipPath, newPath); + } + catch (Exception ex) + { + SetStatus("Error extract template file:" + ex.Message); + } } else if (Directory.Exists(templateZipPath)) {