diff --git a/GitInstaller/GitInstaller/Installer.cs b/GitInstaller/GitInstaller/Installer.cs index 6481d8f..56c5213 100644 --- a/GitInstaller/GitInstaller/Installer.cs +++ b/GitInstaller/GitInstaller/Installer.cs @@ -239,6 +239,11 @@ await Task.Run(() => { _window.bt_install.IsEnabled = true; } + /// + /// Checks if there already exists an installation inside the directory or if its a fresh installation + /// + /// The installation directory + /// True if a gituninstaller.cfg was found, else returns false internal bool IsUpdate(string directory) { string fpath = Path.Combine(directory, "gituninstaller.cfg"); diff --git a/GitInstaller/GitInstaller/Properties/AssemblyInfo.cs b/GitInstaller/GitInstaller/Properties/AssemblyInfo.cs index 6c28fe3..da0b29b 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.7.1.0")] -[assembly: AssemblyFileVersion("1.7.1.0")] +[assembly: AssemblyVersion("1.7.2.0")] +[assembly: AssemblyFileVersion("1.7.2.0")] diff --git a/GitInstaller/GitInstaller/Uninstaller.cs b/GitInstaller/GitInstaller/Uninstaller.cs index 7dec9c5..8c587fb 100644 --- a/GitInstaller/GitInstaller/Uninstaller.cs +++ b/GitInstaller/GitInstaller/Uninstaller.cs @@ -23,6 +23,9 @@ public Uninstaller(string loca, string[] fs, string[] dirs) directories.AddRange(dirs); } + /// + /// Generates a gituninstaller.cfg file inside the installation directory + /// public void GenerateFile() { string fname = Path.Combine(location, "gituninstaller.cfg"); @@ -46,6 +49,11 @@ public void GenerateFile() File.WriteAllLines(fname, flines.ToArray()); } + /// + /// Uninstall the installation at the location. Won't work if it can't find a gituninstaller.cfg file! + /// + /// The location of the installation + /// True if uninstall was a success, else returns false public static bool DoUninstall(string flocation) { MainWindow.Instance.prog_loading.IsIndeterminate = true; diff --git a/GitInstaller/GitInstaller/Utils.cs b/GitInstaller/GitInstaller/Utils.cs index 8fa06af..ea9ecf3 100644 --- a/GitInstaller/GitInstaller/Utils.cs +++ b/GitInstaller/GitInstaller/Utils.cs @@ -16,6 +16,11 @@ public enum ZipType None } + /// + /// Checks if the ZipType of the path is ZipType.File or ZipType.Directory + /// + /// The path of the file/directory + /// A ZipType object (either ZipType.Directory or ZipType.File) public static ZipType FileOrDir(string path) { if (path.EndsWith("/")) @@ -24,6 +29,13 @@ public static ZipType FileOrDir(string path) return ZipType.File; } + /// + /// Checks if value has wildcard in it + /// + /// The value to check if the wildcard is inside + /// The wildcard search value + /// The character representing the wildcard + /// True if wildcard is inside value or false otherwise public static bool HasWildcard(string value, string wildcard, string wildcardchar = "*") { diff --git a/GitInstaller/GitInstaller/ZipArchiveExtensions.cs b/GitInstaller/GitInstaller/ZipArchiveExtensions.cs index e4fb029..ac4a660 100644 --- a/GitInstaller/GitInstaller/ZipArchiveExtensions.cs +++ b/GitInstaller/GitInstaller/ZipArchiveExtensions.cs @@ -3,9 +3,15 @@ namespace GitInstaller { - // From https://stackoverflow.com/questions/14795197/forcefully-replacing-existing-files-during-extracting-file-using-system-io-compr/30425148 public static class ZipArchiveExtensions { + // From https://stackoverflow.com/questions/14795197/forcefully-replacing-existing-files-during-extracting-file-using-system-io-compr/30425148 + /// + /// Extracts a ZipArchive to a destination (with overwrite functionality) + /// + /// The archive to unpack + /// The destination directory + /// If true, it will overwrite the content inside the destination directory public static void ExtractToDirectory(this ZipArchive archive, string destinationDirectoryName, bool overwrite) { Uninstaller uninstaller = new Uninstaller(destinationDirectoryName); @@ -38,6 +44,12 @@ public static void ExtractToDirectory(this ZipArchive archive, string destinatio } //Added by daRedLoCo + /// + /// Extracts a ZipArchive to a destination (with overwrite functionality and ZipSettings inside the archive) + /// + /// The archive to unpack + /// The destination directory + /// If true, it will overwrite the content inside the destination directory public static void ExtractWithSettings(this ZipArchive archive, string destinationDirectoryName, bool overwrite) { ZipSettings settings = null; diff --git a/GitInstaller/GitInstaller/ZipSettings.cs b/GitInstaller/GitInstaller/ZipSettings.cs index f03052b..97bf030 100644 --- a/GitInstaller/GitInstaller/ZipSettings.cs +++ b/GitInstaller/GitInstaller/ZipSettings.cs @@ -13,7 +13,12 @@ public class ZipSettings public ZipSettings() { } - public string GetSubfolder(string fname, string sub = "") + /// + /// Gets the subfolder of a file + /// + /// The file to fetch the subfolder for + /// The subfolder for the file + public string GetSubfolder(string fname) { SubFolder sf = null; string ffolder = fname.Replace(fname.Split('/')[fname.Split('/').Length - 1], "").Replace(fname.Split('\\')[fname.Split('\\').Length - 1],""); @@ -25,6 +30,11 @@ public string GetSubfolder(string fname, string sub = "") return sf.Name; } + /// + /// Returns the ZipSettings from a File + /// + /// The file containing the ZipSettings + /// A ZipSettings object public static ZipSettings FromFile(string fname) { if (File.Exists(fname)) @@ -35,6 +45,11 @@ public static ZipSettings FromFile(string fname) return null; } + /// + /// Returns the ZipSettings from a Stream + /// + /// The stream with the ZipSettings + /// A ZipSettings object public static ZipSettings FromStream(Stream stream) { using (StreamReader reader = new StreamReader(stream))