diff --git a/RuckZuck_Tool/InstallSwPanel.xaml b/RuckZuck_Tool/InstallSwPanel.xaml index 0c98050..be2d51d 100644 --- a/RuckZuck_Tool/InstallSwPanel.xaml +++ b/RuckZuck_Tool/InstallSwPanel.xaml @@ -169,11 +169,11 @@ - + diff --git a/RuckZuck_Tool/InstallSwPanel.xaml.cs b/RuckZuck_Tool/InstallSwPanel.xaml.cs index 12129b6..3ee5bdd 100644 --- a/RuckZuck_Tool/InstallSwPanel.xaml.cs +++ b/RuckZuck_Tool/InstallSwPanel.xaml.cs @@ -829,7 +829,7 @@ private void miCreateExe_Click(object sender, RoutedEventArgs e) } } - private void miCreateArtifact_Click(object sender, RoutedEventArgs e) + /*private void miCreateArtifact_Click(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = Cursors.Wait; try @@ -906,7 +906,7 @@ private void miCreateArtifact_Click(object sender, RoutedEventArgs e) { Mouse.OverrideCursor = null; } - } + }*/ } diff --git a/RuckZuck_Tool/MainWindow.xaml b/RuckZuck_Tool/MainWindow.xaml index 82e8b1f..3039448 100644 --- a/RuckZuck_Tool/MainWindow.xaml +++ b/RuckZuck_Tool/MainWindow.xaml @@ -87,7 +87,7 @@ - Version:{0} Copyright (c) 2017 by Roger Zander + Version:{0} Copyright (c) 2018 by Roger Zander diff --git a/RuckZuck_Tool/NewSWPanelxaml.xaml.cs b/RuckZuck_Tool/NewSWPanelxaml.xaml.cs index f561314..40200a0 100644 --- a/RuckZuck_Tool/NewSWPanelxaml.xaml.cs +++ b/RuckZuck_Tool/NewSWPanelxaml.xaml.cs @@ -190,6 +190,12 @@ private void Button_Click(object sender, RoutedEventArgs e) return; } + if(((List)dgSourceFiles.ItemsSource).Count(t=>!string.IsNullOrEmpty(t.URL)) == 0) + { + if (MessageBox.Show("one File-URL is empty !", "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Warning) != MessageBoxResult.OK) + return; + } + AddSoftware oSoftware = new AddSoftware(); oSoftware.Architecture = tbArchitecture.Text; oSoftware.ContentID = tbContentId.Text; @@ -197,7 +203,7 @@ private void Button_Click(object sender, RoutedEventArgs e) try { - oSoftware.Files = ((List)dgSourceFiles.ItemsSource); + oSoftware.Files = ((List)dgSourceFiles.ItemsSource).Where(t=> !string.IsNullOrEmpty(t.URL)).ToList(); } catch { } try diff --git a/RuckZuck_Tool/Properties/AssemblyInfo.cs b/RuckZuck_Tool/Properties/AssemblyInfo.cs index 52263a0..6de9a04 100644 --- a/RuckZuck_Tool/Properties/AssemblyInfo.cs +++ b/RuckZuck_Tool/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Zander Tools")] [assembly: AssemblyProduct("RuckZuck")] -[assembly: AssemblyCopyright("Copyright © 2017 by Roger Zander")] +[assembly: AssemblyCopyright("Copyright © 2018 by Roger Zander")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.0.*")] -[assembly: AssemblyFileVersion("1.6.0.4")] +[assembly: AssemblyVersion("1.6.1.*")] +[assembly: AssemblyFileVersion("1.6.1.1")] diff --git a/RuckZuck_Tool/Properties/Resources.Designer.cs b/RuckZuck_Tool/Properties/Resources.Designer.cs index d2a7044..d40adf0 100644 --- a/RuckZuck_Tool/Properties/Resources.Designer.cs +++ b/RuckZuck_Tool/Properties/Resources.Designer.cs @@ -70,7 +70,7 @@ internal Resources() { ///[assembly: AssemblyConfiguration("")] ///[assembly: AssemblyCompany("RuckZuck.tools")] ///[assembly: AssemblyProduct("RZRZRZ")] - ///[assembly: AssemblyCopyright("Copyright © 2017 by Roger Zander")] + ///[assembly: AssemblyCopyright("Copyright © 2018 by Roger Zander")] ///[assembly: AssemblyTrademark("")] ///[assembly: AssemblyCulture("")] ///[ [rest of string was truncated]";. diff --git a/RuckZuck_Tool/Properties/Resources.resx b/RuckZuck_Tool/Properties/Resources.resx index 15afb7a..9c5b816 100644 --- a/RuckZuck_Tool/Properties/Resources.resx +++ b/RuckZuck_Tool/Properties/Resources.resx @@ -127,7 +127,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("RuckZuck.tools")] [assembly: AssemblyProduct("RZRZRZ")] -[assembly: AssemblyCopyright("Copyright © 2017 by Roger Zander")] +[assembly: AssemblyCopyright("Copyright © 2018 by Roger Zander")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] @@ -156,6 +156,8 @@ namespace RuckZuck_WCF { private static string _sURL = "UDP"; public static bool DisableBroadcast = false; + public static string ipfs_GW_URL = "https://gateway.ipfs.io/ipfs"; + public static string sURL { get @@ -305,9 +307,6 @@ namespace RuckZuck_WCF { try { - //oClient.DefaultRequestHeaders.Add("AuthenticatedToken", Token); - //oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(contentType)); - if (string.IsNullOrEmpty(Searchstring)) //FullCatalog? { if (File.Exists(Path.Combine(Environment.ExpandEnvironmentVariables("%TEMP%"), "rzcat.json"))) //Cached content exists @@ -315,7 +314,7 @@ namespace RuckZuck_WCF try { DateTime dCreationDate = File.GetCreationTime(Path.Combine(Environment.ExpandEnvironmentVariables("%TEMP%"), "rzcat.json")); - if ((DateTime.Now - dCreationDate) < new TimeSpan(0, 30, 0)) + if ((DateTime.Now - dCreationDate) < new TimeSpan(0, 30, 0)) //Cache for 30min { //return cached Content string jRes = File.ReadAllText(Path.Combine(Environment.ExpandEnvironmentVariables("%TEMP%"), "rzcat.json")); @@ -446,20 +445,12 @@ namespace RuckZuck_WCF return false; } - public static async void TrackDownloads(string contentID) - { - contentID.ToString(); - //depreciated - } - //vNext 5.9.2017 public static async void TrackDownloads2(long SWId, string Architecture) { try { - //oClient.DefaultRequestHeaders.Add("AuthenticatedToken", Token); - //oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(contentType)); await oClient.GetStringAsync(sURL + "/rest/TrackDownloadsNew?SWId=" + SWId.ToString() + "&arch=" + WebUtility.UrlEncode(Architecture)); } catch { } @@ -492,6 +483,29 @@ namespace RuckZuck_WCF return null; } + + /// <summary> + /// Get IPFS.io hash + /// </summary> + /// <param name="contentID"></param> + /// <param name="fileName"></param> + /// <returns></returns> + public static string GetIPFS(string contentID, string fileName) + { + try + { + var response = oClient.GetStringAsync(sURL + "/rest/GetIPFS?Id=" + contentID + "&file=" + fileName); + response.Wait(5000); + + if (response.IsCompleted) + { + return response.Result.Trim('"'); + } + } + catch { } + + return ""; + } } public class GetSoftware @@ -520,9 +534,9 @@ namespace RuckZuck_WCF public bool isInstalled { get; set; } - public string XMLFile { get; set; } + //public string XMLFile { get; set; } - public string IconFile { get; set; } + //public string IconFile { get; set; } public string IconURL { @@ -534,7 +548,7 @@ namespace RuckZuck_WCF } else { - return "File://" + IconFile; + return ""; // "File://" + IconFile; } //return "https://ruckzuck.azurewebsites.net/wcf/RZService.svc/rest/GetIcon?id=" + IconId.ToString(); } @@ -585,10 +599,11 @@ namespace RuckZuck_WCF public string[] PreRequisites { get; set; } //vNext 5.9.2017 - public long SWId { get { return IconId; } set { IconId = value; } } + //public long SWId { get { return IconId; } set { IconId = value; } } + public long SWId { get; set; } //remove if SWId is in place 5.9.2017 - public long IconId { get; set; } + //public long IconId { get; set; } public string IconURL {