Add winget files

This commit is contained in:
niksedk 2022-10-19 21:05:24 +02:00
parent 3a536ce38c
commit 8bc058af92
5 changed files with 126 additions and 1 deletions

View File

@ -32,6 +32,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibSE", "src\libse\LibSE.cs
{DBD4656C-5F40-4067-A70B-C4460DE20F77} = {DBD4656C-5F40-4067-A70B-C4460DE20F77}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "winget", "winget", "{4FE90C81-B6AD-4706-8D1A-C8B1B698DB28}"
ProjectSection(SolutionItems) = preProject
winget\Nikse.SubtitleEdit.installer.yaml = winget\Nikse.SubtitleEdit.installer.yaml
winget\Nikse.SubtitleEdit.locale.en-US.yaml = winget\Nikse.SubtitleEdit.locale.en-US.yaml
winget\Nikse.SubtitleEdit.yaml = winget\Nikse.SubtitleEdit.yaml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -65,6 +72,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4FE90C81-B6AD-4706-8D1A-C8B1B698DB28} = {B1BB9DD1-0EE8-4D43-AAAB-C39D0CC882A9}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E12BDE22-B6A4-4AB6-AF96-F3C0F89C15EC}
EndGlobalSection

View File

@ -18,6 +18,7 @@ namespace UpdateAssemblyInfo
private static readonly Regex AssemblyInfoFileVersionRegex; // e.g.: [assembly: AssemblyVersion("3.4.8.226")]
private static readonly Regex TemplateFileCopyrightRegex; // e.g.: [assembly: AssemblyCopyright("Copyright 2001-2019, Nikse")]
private static readonly Regex AssemblyInfoFileRevisionGuidRegex; // e.g.: [assembly: AssemblyDescription("0e82e5769c9b235383991082c0a0bba96d20c69d")]
static Program()
{
var options = RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant;
@ -92,7 +93,7 @@ namespace UpdateAssemblyInfo
public int CompareTo(VersionInfo vi)
{
int cmp = 1;
var cmp = 1;
if (!ReferenceEquals(vi, null))
{
cmp = Major.CompareTo(vi.Major);
@ -105,6 +106,7 @@ namespace UpdateAssemblyInfo
cmp = Maintenance.CompareTo(vi.Maintenance);
}
}
return cmp;
}
@ -309,6 +311,7 @@ namespace UpdateAssemblyInfo
Console.Write(WorkInProgress);
}
//debug: "..\..\ui\Properties\AssemblyInfo.cs.template" "..\..\src\libse\Properties\AssemblyInfo.cs.template"
private static int Main(string[] args)
{
var myName = Environment.GetCommandLineArgs()[0];
@ -359,6 +362,8 @@ namespace UpdateAssemblyInfo
var tmx14FileName = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(libSeTemplateFileName)) ?? throw new InvalidOperationException(), "SubtitleFormats", "Tmx14.cs");
UpdateTmx14ToolVersion(tmx14FileName, newVersion, oldVersion);
}
UpdateWinGet(newVersion);
UpdateAssemblyInfo(libSeTemplateFileName, newVersion, updateTemplateFile);
UpdateAssemblyInfo(seTemplateFileName, newVersion, updateTemplateFile);
}
@ -378,6 +383,47 @@ namespace UpdateAssemblyInfo
}
}
private static void UpdateWinGet(VersionInfo newVersion)
{
var workingDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly()?.Location);
var dir = Path.Combine(workingDirectory, "winget");
if (!Directory.Exists(dir))
{
dir = Path.Combine(workingDirectory, "..", "winget");
}
if (!Directory.Exists(dir))
{
dir = Path.Combine(workingDirectory, "..", "..", "winget");
}
if (!Directory.Exists(dir))
{
dir = Path.Combine(workingDirectory, "..", "..", "..", "winget");
}
if (!Directory.Exists(dir))
{
dir = Path.Combine(workingDirectory, "..", "..", "..", "..", "winget");
}
if (!Directory.Exists(dir))
{
return;
}
var installer = Path.Combine(dir, "Nikse.SubtitleEdit.installer.yaml");
//PackageVersion: 3.6.7.0
//ReleaseDate: 2022-08-13
//InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/3.6.7/SubtitleEdit-3.6.7-Setup.exe
//InstallerSha256: 66F2BEFD07E2295EE606BC02A4EAACB1E0D2DEBE42B4D167AE45C5CC76F5E9A3
//InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/3.6.7/SubtitleEdit-3.6.7-Setup.exe
//InstallerSha256: 66F2BEFD07E2295EE606BC02A4EAACB1E0D2DEBE42B4D167AE45C5CC76F5E9A3
var locale = Path.Combine(dir, "Nikse.SubtitleEdit.locale.en-US.yaml");
// PackageVersion: 3.6.7.0
var main = Path.Combine(dir, "Nikse.SubtitleEdit.yaml");
// PackageVersion: 3.6.7.0
}
private static string GetGitPath()
{
var envPath = Environment.GetEnvironmentVariable("PATH");

View File

@ -0,0 +1,40 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.2.0.schema.json
PackageIdentifier: Nikse.SubtitleEdit
PackageVersion: 3.6.7.0
InstallerLocale: en-US
MinimumOSVersion: 10.0.0.0
InstallerType: inno
Scope: machine
InstallModes:
- interactive
- silent
- silentWithProgress
UpgradeBehavior: install
FileExtensions:
- srt
- ass
- dfxp
- sbv
- ssa
- stl
- sub
- sup
- vtt
- smi
- itt
- txt
- xml
- mp4
- mkv
ReleaseDate: 2022-08-13
Installers:
- Architecture: x64
InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/3.6.7/SubtitleEdit-3.6.7-Setup.exe
InstallerSha256: 66F2BEFD07E2295EE606BC02A4EAACB1E0D2DEBE42B4D167AE45C5CC76F5E9A3
- Architecture: x86
InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/3.6.7/SubtitleEdit-3.6.7-Setup.exe
InstallerSha256: 66F2BEFD07E2295EE606BC02A4EAACB1E0D2DEBE42B4D167AE45C5CC76F5E9A3
ManifestType: installer
ManifestVersion: 1.2.0

View File

@ -0,0 +1,21 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.2.0.schema.json
PackageIdentifier: Nikse.SubtitleEdit
PackageVersion: 3.6.7.0
PackageLocale: en-US
Publisher: Nikse
PublisherUrl: https://www.nikse.dk/
Author: Nikolaj Olsson
PackageName: Subtitle Edit
PackageUrl: https://www.nikse.dk/subtitleedit
License: GPL-3.0-only
LicenseUrl: https://raw.githubusercontent.com/SubtitleEdit/subtitleedit/main/LICENSE.txt
ShortDescription: Subtitle Edit is a free and open source editor for video subtitles.
Moniker: subtitleedit
Tags:
- open-source
- subtitle-editor
ReleaseNotesUrl: https://raw.githubusercontent.com/SubtitleEdit/subtitleedit/main/Changelog.txt
ManifestType: defaultLocale
ManifestVersion: 1.2.0

View File

@ -0,0 +1,8 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.2.0.schema.json
PackageIdentifier: Nikse.SubtitleEdit
PackageVersion: 3.6.7.0
DefaultLocale: en-US
ManifestType: version
ManifestVersion: 1.2.0