namespace Insight.Setup.Constants
{
    public static class Deploy
    {
        public static class Runtime
        {
            public static class Core
            {
                public const string Version = "7.0.2";
                public const string Download = "https://download.visualstudio.microsoft.com/download/pr/df7da01f-1f17-4728-92b7-778e9607da8f/7c18246830f8c78591f02f25aa368dcf/dotnet-runtime-7.0.2-win-x64.exe";

                public static DirectoryInfo Directory => new DirectoryInfo($@"{Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)}/dotnet/shared/Microsoft.NETCore.App");
            }

            public static class Asp
            {
                public const string Version = "7.0.2";
                public const string Download = "https://download.visualstudio.microsoft.com/download/pr/3ecad4f7-1342-4688-ae4a-38908c61f4a2/391a9010acad2e312e3d1e766bedfac7/aspnetcore-runtime-7.0.2-win-x64.exe";

                public static DirectoryInfo Directory => new DirectoryInfo($@"{Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)}/dotnet/shared/Microsoft.AspNetCore.App");
            }
        }

        public static class Updater
        {
            public const string Name = "Updater";
            public const string ServiceName = "insight_updater";
            public const string Description = "Insight Updater";

            public static Uri UpdateHref(Uri api) => new($"{api.AbsoluteUri}/{Name}/windows");
        }

        public static class Agent
        {
            public const string Name = "Agent";
            public const string ServiceName = "insight_agent";
            public const string Description = "Insight Agent";
        }

        public static DirectoryInfo GetAppDirectory(string appName)
            => new($"{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Webmatic/Insight/{appName}");

        public static FileInfo GetAppExecutable(string appName)
            => new($"{GetAppDirectory(appName).FullName}/{appName.ToLower()}.exe");

        public static Uri GetUpdateHref(Uri api, string appName)
            => new($"{api.AbsoluteUri}/update/{appName.ToLower()}/windows");
    }
}