Improved installation script a bit
This commit is contained in:
		@@ -15,6 +15,7 @@ OutputDir=userdocs:projekti/NadekoInstallerOutput
 | 
			
		||||
OutputBaseFilename=NadekoBot-setup-{#version}
 | 
			
		||||
AppReadmeFile=http://nadekobot.readthedocs.io/en/1.4/Commands%20List/
 | 
			
		||||
ArchitecturesInstallIn64BitMode=x64
 | 
			
		||||
UsePreviousSetupType=no
 | 
			
		||||
 | 
			
		||||
[Files]
 | 
			
		||||
;install 
 | 
			
		||||
@@ -39,8 +40,12 @@ Filename: "{app}\{#sysfolder}\credentials.json"; Flags: postinstall shellexec ru
 | 
			
		||||
Name: "{app}\NadekoBot"; Filename: "{app}\{#sysfolder}\NadekoBot.exe"; IconFilename: "{app}\{#sysfolder}\nadeko_icon.ico"
 | 
			
		||||
Name: "{app}\credentials"; Filename: "{app}\{#sysfolder}\credentials.json" 
 | 
			
		||||
Name: "{app}\data"; Filename: "{app}\{#sysfolder}\data" 
 | 
			
		||||
 | 
			
		||||
; desktop shortcut 
 | 
			
		||||
Name: "{commondesktop}\NadekoBot"; Filename: "{app}\NadekoBot";
 | 
			
		||||
Name: "{commondesktop}\NadekoBot"; Filename: "{app}\NadekoBot"; Tasks: desktopicon
 | 
			
		||||
; desktop icon checkbox
 | 
			
		||||
[Tasks]
 | 
			
		||||
Name: desktopicon; Description: "Create a &desktop shortcut";
 | 
			
		||||
 | 
			
		||||
[Registry]
 | 
			
		||||
;make the app run as administrator
 | 
			
		||||
 
 | 
			
		||||
@@ -47,31 +47,31 @@ namespace NadekoBot.Services
 | 
			
		||||
                string.Join(",", responseStrings.Keys),
 | 
			
		||||
                sw.Elapsed.TotalSeconds);
 | 
			
		||||
 | 
			
		||||
            //improper string format checks
 | 
			
		||||
            var compareTo = responseStrings["en-us"]
 | 
			
		||||
                .Select(x =>
 | 
			
		||||
                {
 | 
			
		||||
                    return (StringKey: x.Key, Placeholders: formatFinder.Matches(x.Value).Cast<Match>().Select(y => y.Value).ToArray());
 | 
			
		||||
                })
 | 
			
		||||
                .ToDictionary(x => x.StringKey, x => x.Placeholders);
 | 
			
		||||
            ////improper string format checks
 | 
			
		||||
            //var compareTo = responseStrings["en-us"]
 | 
			
		||||
            //    .Select(x =>
 | 
			
		||||
            //    {
 | 
			
		||||
            //        return (StringKey: x.Key, Placeholders: formatFinder.Matches(x.Value).Cast<Match>().Select(y => y.Value).ToArray());
 | 
			
		||||
            //    })
 | 
			
		||||
            //    .ToDictionary(x => x.StringKey, x => x.Placeholders);
 | 
			
		||||
 | 
			
		||||
            var errors = responseStrings
 | 
			
		||||
                .Select(a => (a.Key, a.Value.Select(x =>
 | 
			
		||||
                    {
 | 
			
		||||
                        if (!compareTo.ContainsKey(x.Key))
 | 
			
		||||
                            return (StringKey: x.Key, Placeholders: new HashSet<string>(), Missing: true);
 | 
			
		||||
                        var hs = new HashSet<string>(compareTo[x.Key]);
 | 
			
		||||
                        hs.SymmetricExceptWith(formatFinder.Matches(x.Value).Cast<Match>().Select(y => y.Value).ToArray());
 | 
			
		||||
                        return (StringKey: x.Key, Placeholders: hs, Missing: false);
 | 
			
		||||
                    })
 | 
			
		||||
                    .Where(x => x.Placeholders.Any() || x.Missing)))
 | 
			
		||||
                .Where(x => x.Item2.Any());
 | 
			
		||||
            //var errors = responseStrings
 | 
			
		||||
            //    .Select(a => (a.Key, a.Value.Select(x =>
 | 
			
		||||
            //        {
 | 
			
		||||
            //            if (!compareTo.ContainsKey(x.Key))
 | 
			
		||||
            //                return (StringKey: x.Key, Placeholders: new HashSet<string>(), Missing: true);
 | 
			
		||||
            //            var hs = new HashSet<string>(compareTo[x.Key]);
 | 
			
		||||
            //            hs.SymmetricExceptWith(formatFinder.Matches(x.Value).Cast<Match>().Select(y => y.Value).ToArray());
 | 
			
		||||
            //            return (StringKey: x.Key, Placeholders: hs, Missing: false);
 | 
			
		||||
            //        })
 | 
			
		||||
            //        .Where(x => x.Placeholders.Any() || x.Missing)))
 | 
			
		||||
            //    .Where(x => x.Item2.Any());
 | 
			
		||||
 | 
			
		||||
            var str = string.Join("\n", errors.Select(x => $"------{x.Item1}------\n" +
 | 
			
		||||
                                        string.Join("\n", x.Item2.Select(y =>
 | 
			
		||||
                                            y.StringKey + ": " + (y.Missing ? "MISSING" : string.Join(", ", y.Placeholders))))));
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(str))
 | 
			
		||||
                _log.Warn($"Improperly Formatted strings:\n{str}");
 | 
			
		||||
            //var str = string.Join("\n", errors.Select(x => $"------{x.Item1}------\n" +
 | 
			
		||||
            //                            string.Join("\n", x.Item2.Select(y =>
 | 
			
		||||
            //                                y.StringKey + ": " + (y.Missing ? "MISSING" : string.Join(", ", y.Placeholders))))));
 | 
			
		||||
            //if (!string.IsNullOrWhiteSpace(str))
 | 
			
		||||
            //    _log.Warn($"Improperly Formatted strings:\n{str}");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private string GetLocaleName(string fileName)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user