diff --git a/GitInstaller/GitInstaller/GitInstaller.csproj b/GitInstaller/GitInstaller/GitInstaller.csproj
index 89714e7..84e606b 100644
--- a/GitInstaller/GitInstaller/GitInstaller.csproj
+++ b/GitInstaller/GitInstaller/GitInstaller.csproj
@@ -71,6 +71,9 @@
MSBuild:Compile
Designer
+
+ ManualWindow.xaml
+
@@ -89,6 +92,10 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
diff --git a/GitInstaller/GitInstaller/Installer.cs b/GitInstaller/GitInstaller/Installer.cs
index 770f340..6481d8f 100644
--- a/GitInstaller/GitInstaller/Installer.cs
+++ b/GitInstaller/GitInstaller/Installer.cs
@@ -95,13 +95,6 @@ async void GetVersions()
Releases.Add(robj);
}
}
-
- //Old
- //if(!Array.Exists(Settings.Ignored_Tags, x => x == robj.Tag))
- //{
- // idcount++;
- // Releases.Add(robj);
- //}
}
_window.cb_versions.SelectedIndex = 0;
@@ -109,7 +102,7 @@ async void GetVersions()
_window.prog_loading.IsIndeterminate = false;
if(Releases.Count < 1)
{
- MessageBox.Show("No releases found for this repository! Can't progress with the installation...");
+ MessageBox.Show("No releases found for this repository! Can't progress with the installation...", "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
Environment.Exit(2);
return;
}
@@ -178,21 +171,6 @@ async void DownloadAssets()
assetcount++;
}
}
-
- //Old
- //if (!Array.Exists(Settings.Ignored_Files, x => x == asset.Filename))
- //{
- // string installfname = Path.Combine(_installdir, asset.Filename);
- // await client.DownloadFileTaskAsync(new Uri(asset.DownloadUrl), installfname);
- // downloadedfiles.Add(installfname);
- // assetcount++;
- // _window.WriteLog($"Asset downloaded... ({assetcount}/{maxcount})");
- //}
- //else
- //{
- // _window.WriteLog($"Asset \"{asset.Filename}\" will be ignored...");
- // assetcount++;
- //}
}
catch (Exception ex)
{
diff --git a/GitInstaller/GitInstaller/MainWindow.xaml.cs b/GitInstaller/GitInstaller/MainWindow.xaml.cs
index d0afd6f..51717b6 100644
--- a/GitInstaller/GitInstaller/MainWindow.xaml.cs
+++ b/GitInstaller/GitInstaller/MainWindow.xaml.cs
@@ -40,7 +40,12 @@ public MainWindow()
}
else
{
- MessageBox.Show("The Installer can't progress because the settings file couldn't loaded!");
+ ManualWindow mwin = new ManualWindow();
+ if(mwin.ShowDialog() == true)
+ {
+ return;
+ }
+ MessageBox.Show("The Installer can't progress because the settings file couldn't loaded!", "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
Environment.Exit(1);
}
}
@@ -66,7 +71,7 @@ private void UninstallClicked(object sender, RoutedEventArgs e)
if (result == System.Windows.Forms.DialogResult.OK)
{
if (!Uninstaller.DoUninstall(fbd.SelectedPath))
- System.Windows.Forms.MessageBox.Show("Couldn't uninstall the software, read the log for more informations!");
+ MessageBox.Show("Couldn't uninstall the software, read the log for more informations!", "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
else
WriteLog("Software was uninstalled successfuly!");
}
@@ -109,7 +114,7 @@ private void VersionChanged(object sender, SelectionChangedEventArgs e)
{
if (ex.HResult != -2146233086)
{
- MessageBox.Show("There was an unexpected error while changing the version!");
+ MessageBox.Show("There was an unexpected error while changing the version!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
throw ex;
}
}
diff --git a/GitInstaller/GitInstaller/ManualWindow.xaml b/GitInstaller/GitInstaller/ManualWindow.xaml
new file mode 100644
index 0000000..c5249f3
--- /dev/null
+++ b/GitInstaller/GitInstaller/ManualWindow.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GitInstaller/GitInstaller/ManualWindow.xaml.cs b/GitInstaller/GitInstaller/ManualWindow.xaml.cs
new file mode 100644
index 0000000..b77c7ce
--- /dev/null
+++ b/GitInstaller/GitInstaller/ManualWindow.xaml.cs
@@ -0,0 +1,57 @@
+using Newtonsoft.Json;
+using System;
+using System.Diagnostics;
+using System.IO;
+using System.Windows;
+
+namespace GitInstaller
+{
+ ///
+ /// Interaktionslogik für ManualWindow.xaml
+ ///
+ public partial class ManualWindow : Window
+ {
+ public ManualWindow()
+ {
+ InitializeComponent();
+ bt_confirm.Click += ClickConfirm;
+ }
+
+ private void ClickConfirm(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+
+ Uri url = new Uri(tb_url.Text);
+ if (url.Host != "github.com" && url.Host != "www.github.com")
+ {
+ MessageBox.Show("Invalid URL. Needs to be a github.com url!", "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
+ return;
+ }
+
+ string ustr = url.AbsoluteUri;
+ ustr = ustr.Replace("://", "");
+
+ Settings.SettingsFile sfile = new Settings.SettingsFile() {
+ ignored_files = new string[]{ "" },
+ ignored_tags = new string[] { "" },
+ project = ustr.Split('/')[2],
+ uninstall = false,
+ unzip = true,
+ preview = true,
+ user = ustr.Split('/')[1],
+ repo = ustr.Split('/')[2]
+ };
+ string jsondata = JsonConvert.SerializeObject(sfile);
+ File.WriteAllText("config.json", jsondata);
+ Process.Start("GitInstaller.exe");
+ Environment.Exit(4);
+ }
+ catch(Exception ex)
+ {
+ MessageBox.Show("Error creating configuration file... => " + ex.Message, "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
+ return;
+ }
+ }
+ }
+}
diff --git a/GitInstaller/GitInstaller/Properties/AssemblyInfo.cs b/GitInstaller/GitInstaller/Properties/AssemblyInfo.cs
index 32d48be..6c28fe3 100644
--- a/GitInstaller/GitInstaller/Properties/AssemblyInfo.cs
+++ b/GitInstaller/GitInstaller/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.6.0.0")]
-[assembly: AssemblyFileVersion("1.6.0.0")]
+[assembly: AssemblyVersion("1.7.1.0")]
+[assembly: AssemblyFileVersion("1.7.1.0")]
diff --git a/GitInstaller/GitInstaller/Uninstaller.cs b/GitInstaller/GitInstaller/Uninstaller.cs
index 980e051..7dec9c5 100644
--- a/GitInstaller/GitInstaller/Uninstaller.cs
+++ b/GitInstaller/GitInstaller/Uninstaller.cs
@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace GitInstaller
{
diff --git a/GitInstaller/GitInstaller/Utils.cs b/GitInstaller/GitInstaller/Utils.cs
index b3a4790..8fa06af 100644
--- a/GitInstaller/GitInstaller/Utils.cs
+++ b/GitInstaller/GitInstaller/Utils.cs
@@ -3,11 +3,27 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.IO;
namespace GitInstaller
{
public static class Utils
{
+ public enum ZipType
+ {
+ File,
+ Directory,
+ None
+ }
+
+ public static ZipType FileOrDir(string path)
+ {
+ if (path.EndsWith("/"))
+ return ZipType.Directory;
+ else
+ return ZipType.File;
+ }
+
public static bool HasWildcard(string value, string wildcard, string wildcardchar = "*")
{
diff --git a/GitInstaller/GitInstaller/ZipArchiveExtensions.cs b/GitInstaller/GitInstaller/ZipArchiveExtensions.cs
index 728977e..e4fb029 100644
--- a/GitInstaller/GitInstaller/ZipArchiveExtensions.cs
+++ b/GitInstaller/GitInstaller/ZipArchiveExtensions.cs
@@ -1,10 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
+using System.IO;
using System.IO.Compression;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
namespace GitInstaller
{
diff --git a/GitInstaller/GitInstaller/ZipSettings.cs b/GitInstaller/GitInstaller/ZipSettings.cs
index 4979d22..f03052b 100644
--- a/GitInstaller/GitInstaller/ZipSettings.cs
+++ b/GitInstaller/GitInstaller/ZipSettings.cs
@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -17,7 +15,10 @@ public ZipSettings() { }
public string GetSubfolder(string fname, string sub = "")
{
- SubFolder sf = Subfolders.Find(x => x.Files.Find(y => y == fname) != null);
+ SubFolder sf = null;
+ string ffolder = fname.Replace(fname.Split('/')[fname.Split('/').Length - 1], "").Replace(fname.Split('\\')[fname.Split('\\').Length - 1],"");
+ sf = Subfolders.Find(x => x.Directories.Find(y => y == ffolder) != null);
+ sf = Subfolders.Find(x => x.Files.Find(y => y == fname) != null);
if (sf == null)
return "";
@@ -52,7 +53,11 @@ public static ZipSettings FromStream(Stream stream)
sub.Name = dict.Key;
foreach (JToken token in dict.Value.Children().ToList())
{
- sub.Files.Add(token.Value());
+ Utils.ZipType ztype = Utils.FileOrDir(token.Value());
+ if (ztype == Utils.ZipType.File)
+ sub.Files.Add(token.Value());
+ else if (ztype == Utils.ZipType.Directory)
+ sub.Directories.Add(token.Value());
}
}
zs.Subfolders.Add(sub);
@@ -71,6 +76,7 @@ public class SubFolder
{
public string Name;
public List Files = new List();
+ public List Directories = new List();
}
}
}