net5.0 attempt 2

This commit is contained in:
JFronny 2021-02-03 22:14:47 +01:00
parent 9b1935e7a7
commit e92a074544
7 changed files with 28 additions and 52 deletions

View File

@ -7,29 +7,26 @@ uptool:
- .shared_windows_runners
stage: deploy
script: |
Invoke-WebRequest -Uri https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1
Set-ExecutionPolicy Unrestricted -Scope Process
./dotnet-install.ps1 -Channel 5.0
dotnet build --verbosity:m -p:Configuration=Release
cp ".\UpTool build tool\bin\Release\netcoreapp3.1\package.zip" .\Tools.zip
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\netcoreapp3.1\UpTool2.exe
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\netcoreapp3.1\*.dll
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\netcoreapp3.1\UpTool2.runtimeconfig.json
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\netcoreapp3.1\runtimes
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\netcoreapp3.1\uptool.exe
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\netcoreapp3.1\*.dll
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\netcoreapp3.1\uptool.runtimeconfig.json
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\netcoreapp3.1\runtimes
$asmver = $([Reflection.Assembly]::Loadfile($(pwd).Path + "\\UpTool2\\bin\\Release\\netcoreapp3.1\\UpTool2.dll").GetName().version.ToString())
$pkgtoolver = $([Reflection.Assembly]::Loadfile($(pwd).Path + "\\UpTool build tool\\bin\\Release\\netcoreapp3.1\\pkgtool.dll").GetName().version.ToString())
& "C:\Program Files\7-Zip\7z" a .\Installer-generic.zip .\InstallerCLI\bin\Release\netcoreapp3.1\Installer.exe
& "C:\Program Files\7-Zip\7z" a .\Installer-generic.zip .\InstallerCLI\bin\Release\netcoreapp3.1\*.dll
& "C:\Program Files\7-Zip\7z" a .\Installer-generic.zip .\InstallerCLI\bin\Release\netcoreapp3.1\Installer.runtimeconfig.json
cp ".\UpTool build tool\bin\Release\net5.0\package.zip" .\Tools.zip
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\net5.0-windows\UpTool2.exe
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\net5.0-windows\*.dll
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\net5.0-windows\UpTool2.runtimeconfig.json
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpTool2\bin\Release\net5.0-windows\runtimes
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\net5.0\uptool.exe
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\net5.0\*.dll
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\net5.0\uptool.runtimeconfig.json
& "C:\Program Files\7-Zip\7z" a .\Release.zip .\UpToolCLI\bin\Release\net5.0\runtimes
$asmver = $([Reflection.Assembly]::Loadfile($(pwd).Path + "\\UpTool2\\bin\\Release\\net5.0-windows\\UpTool2.dll").GetName().version.ToString())
$pkgtoolver = $([Reflection.Assembly]::Loadfile($(pwd).Path + "\\UpTool build tool\\bin\\Release\\net5.0\\pkgtool.dll").GetName().version.ToString())
& "C:\Program Files\7-Zip\7z" a .\Installer-generic.zip .\InstallerCLI\bin\Release\net5.0\Installer.exe
& "C:\Program Files\7-Zip\7z" a .\Installer-generic.zip .\InstallerCLI\bin\Release\net5.0\*.dll
& "C:\Program Files\7-Zip\7z" a .\Installer-generic.zip .\InstallerCLI\bin\Release\net5.0\Installer.runtimeconfig.json
& "C:\Program Files\7-Zip\7z" a .\Installer-generic.zip .\InstallerCLI\Info.txt
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\netcoreapp3.1\Installer.exe
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\netcoreapp3.1\*.dll
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\netcoreapp3.1\Installer.runtimeconfig.json
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\netcoreapp3.1\runtimes
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\net5.0-windows\Installer.exe
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\net5.0-windows\*.dll
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\net5.0-windows\Installer.runtimeconfig.json
& "C:\Program Files\7-Zip\7z" a .\Installer-gui.zip .\Installer\bin\Release\net5.0-windows\runtimes
[System.XML.XMLDocument]$xml=New-Object System.XML.XMLDocument
[System.XML.XMLElement]$app=$xml.CreateElement("app")
$xml.appendChild($app)
@ -58,8 +55,8 @@ uptool:
#cd Installer
#dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
#dotnet publish -r win-x86 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
#cp .\bin\Release\netcoreapp3.1\win-x64\publish\Installer.exe ..\Installer-x64.exe
#cp .\bin\Release\netcoreapp3.1\win-x86\publish\Installer.exe ..\Installer-x86.exe
#cp .\bin\Release\net5.0-windows\win-x64\publish\Installer.exe ..\Installer-x64.exe
#cp .\bin\Release\net5.0-windows\win-x86\publish\Installer.exe ..\Installer-x86.exe
#cd ..
#Installer-x64 and Installer-x86 were also originally artifacts but there doesn't seem to be a x86-64 windows runner
artifacts:

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>..\UpTool2.ico</ApplicationIcon>
</PropertyGroup>

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>UpTool_build_tool</RootNamespace>
<AssemblyName>pkgtool</AssemblyName>

View File

@ -17,9 +17,9 @@ namespace UpTool2
{
internal static class Program
{
public static Form Splash;
public static Form? Splash;
private static int _splashProgress;
private static string _splashMessage;
private static string? _splashMessage;
public static bool Online;
[STAThread]
@ -28,12 +28,7 @@ namespace UpTool2
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
BuildSplash();
//Splash.Show();
//This is here because I had issues with this piece of code under wine in the past
if (args.Any(s => s.TrimStart('-', '/').ToLower() == "wine"))
Splash.Show();
else
new Thread(() => { Splash.ShowDialog(); }).Start();
Splash.Show();
try
{
MutexLock.Lock();
@ -151,22 +146,6 @@ namespace UpTool2
g.DrawString(_splashMessage, smallFont, Brushes.White, bar,
new StringFormat {Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center});
};
int xOff = 0;
int yOff = 0;
bool moving = false;
Splash.MouseDown += (sender, e) =>
{
moving = true;
xOff = e.X;
yOff = e.Y;
};
Splash.MouseUp += (sender, e) => moving = false;
Splash.MouseMove += (sender, e) =>
{
if (!moving) return;
Splash.Left = Cursor.Position.X - xOff;
Splash.Top = Cursor.Position.Y - yOff;
};
Splash.Load += (sender, e) => Splash.BringToFront();
Splash.FormClosed += (sender, e) => Splash.Dispose();
}

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<LangVersion>8</LangVersion>
<Deterministic>false</Deterministic>

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>uptool</AssemblyName>
<Deterministic>false</Deterministic>
<AssemblyVersion>1.0.*</AssemblyVersion>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<Deterministic>false</Deterministic>
<AssemblyVersion>1.0.*</AssemblyVersion>
</PropertyGroup>