From 3b5dc0e57a64d2eed7fe05d9fa35e8de8b6a75f3 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 11 Nov 2020 20:16:15 +0000 Subject: WinGui: Move to .NET 5 runtime. (This requires the Microsoft .NET 5 runtime to be installed on the machine) Changed the configruation to make the UI platform agnostic. This will allow it to run on ARM64 natively (in theory) with if provided with an ARM64 native hb.dll --- win/CS/HandBrake.Installer/Product.wxs | 17 +++++-- win/CS/HandBrake.Interop/HandBrake.Interop.csproj | 10 ++-- win/CS/HandBrake.Worker/HandBrake.Worker.csproj | 7 ++- win/CS/HandBrake.sln | 34 ++++++------- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 25 +++++---- win/CS/HandBrakeWPF/Installer/Installer64.nsi | 62 +++-------------------- win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi | 60 +++------------------- win/CS/HandBrakeWPF/Views/ShellView.xaml.cs | 1 - 8 files changed, 64 insertions(+), 152 deletions(-) (limited to 'win') diff --git a/win/CS/HandBrake.Installer/Product.wxs b/win/CS/HandBrake.Installer/Product.wxs index 4e9ae37db..2496869f8 100644 --- a/win/CS/HandBrake.Installer/Product.wxs +++ b/win/CS/HandBrake.Installer/Product.wxs @@ -53,11 +53,6 @@ = 603) OR (VersionNT64 = 601)]]> - - - = "#528040")]]> - - @@ -72,6 +67,8 @@ + + @@ -83,6 +80,16 @@ + + + + + + + + + + diff --git a/win/CS/HandBrake.Interop/HandBrake.Interop.csproj b/win/CS/HandBrake.Interop/HandBrake.Interop.csproj index b7cd952c9..439879efb 100644 --- a/win/CS/HandBrake.Interop/HandBrake.Interop.csproj +++ b/win/CS/HandBrake.Interop/HandBrake.Interop.csproj @@ -10,14 +10,10 @@ https://github.com/HandBrake/HandBrake git Video Transcoder - x64 - x64 + AnyCPU + AnyCPU - - - x64 - - + diff --git a/win/CS/HandBrake.Worker/HandBrake.Worker.csproj b/win/CS/HandBrake.Worker/HandBrake.Worker.csproj index 705a494be..125e32bb5 100644 --- a/win/CS/HandBrake.Worker/HandBrake.Worker.csproj +++ b/win/CS/HandBrake.Worker/HandBrake.Worker.csproj @@ -2,8 +2,7 @@ Exe - net48 - true + net5.0 HandBrake.Worker HandBrake Team HandBrake Team @@ -14,8 +13,8 @@ https://github.com/HandBrake/HandBrake git 1.4.0.0 - x64 - x64 + AnyCPU + AnyCPU handbrakepineapple.ico HandBrake.Worker diff --git a/win/CS/HandBrake.sln b/win/CS/HandBrake.sln index ae7432bdb..b16c55766 100644 --- a/win/CS/HandBrake.sln +++ b/win/CS/HandBrake.sln @@ -9,7 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution build.xml = build.xml EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.Worker", "HandBrake.Worker\HandBrake.Worker.csproj", "{F8370F37-B226-4830-AEE7-6D7AE403E3D2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandBrake.Worker", "HandBrake.Worker\HandBrake.Worker.csproj", "{F8370F37-B226-4830-AEE7-6D7AE403E3D2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandBrake.Interop", "HandBrake.Interop\HandBrake.Interop.csproj", "{ED5C8D53-0988-4CEB-934A-6B1D840C6335}" EndProject @@ -19,24 +19,24 @@ Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "HandBrake.Installer", "Hand EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Debug|x64.ActiveCfg = Debug|x64 - {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Debug|x64.Build.0 = Debug|x64 - {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Release|x64.ActiveCfg = Release|x64 - {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Release|x64.Build.0 = Release|x64 - {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Debug|x64.ActiveCfg = Debug|x64 - {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Debug|x64.Build.0 = Debug|x64 - {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Release|x64.ActiveCfg = Release|x64 - {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Release|x64.Build.0 = Release|x64 - {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Debug|x64.ActiveCfg = Debug|x64 - {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Debug|x64.Build.0 = Debug|x64 - {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Release|x64.ActiveCfg = Release|x64 - {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Release|x64.Build.0 = Release|x64 - {02684A37-C3E0-43F6-A4F0-2465AFEDD6DF}.Debug|x64.ActiveCfg = Debug|x64 - {02684A37-C3E0-43F6-A4F0-2465AFEDD6DF}.Release|x64.ActiveCfg = Release|x64 + {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8370F37-B226-4830-AEE7-6D7AE403E3D2}.Release|Any CPU.Build.0 = Release|Any CPU + {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED5C8D53-0988-4CEB-934A-6B1D840C6335}.Release|Any CPU.Build.0 = Release|Any CPU + {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3A8A5D8-2793-42FD-ADC5-9A296F1C4335}.Release|Any CPU.Build.0 = Release|Any CPU + {02684A37-C3E0-43F6-A4F0-2465AFEDD6DF}.Debug|Any CPU.ActiveCfg = Debug|x64 + {02684A37-C3E0-43F6-A4F0-2465AFEDD6DF}.Release|Any CPU.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index e65dcbe80..516d90706 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -2,8 +2,9 @@ WinExe - net48 + net5.0-windows true + true HandBrake HandBrake Team HandBrake Team @@ -14,8 +15,8 @@ https://github.com/HandBrake/HandBrake git 1.4.0.0 - x64 - x64 + AnyCPU + AnyCPU handbrakepineapple.ico HandBrake @@ -24,14 +25,12 @@ win7-x64 - - x64 - bin\x64\Debug + + bin\Debug - - x64 - bin\x64\Release + + bin\Release @@ -46,11 +45,17 @@ + - + + true + true + *.json + true + diff --git a/win/CS/HandBrakeWPF/Installer/Installer64.nsi b/win/CS/HandBrakeWPF/Installer/Installer64.nsi index bf2411922..5f655e88f 100644 --- a/win/CS/HandBrakeWPF/Installer/Installer64.nsi +++ b/win/CS/HandBrakeWPF/Installer/Installer64.nsi @@ -11,16 +11,9 @@ !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" -;Required .NET framework for 4.7.1 -!define MIN_FRAMEWORK_VER 461308 - SetCompressor lzma ManifestDPIAware true -; Required for Github Actions (or local builds were inetc is not part of the installed NSIS) -; Extract inetc.zip to the HandBrake root directory into a folder called plugins. -!addplugindir /x86-ansi "..\..\..\..\..\..\plugins\Plugins\x86-ansi" - ; MUI 1.67 compatible ------ !include "MUI.nsh" !include WinVer.nsh @@ -125,37 +118,13 @@ Section "HandBrake" SectionApp SetOverwrite ifnewer SectionIn RO ; Read only, always installed - ; Begin Check .NET version - StrCpy $InstallDotNET "No" - Call CheckFramework - StrCmp $0 "1" +3 - StrCpy $InstallDotNET "Yes" - MessageBox MB_OK|MB_ICONINFORMATION "${PRODUCT_NAME} requires that the Microsoft .NET Framework 4.8 is installed. The latest .NET Framework will be downloaded and installed automatically during installation of ${PRODUCT_NAME}." /SD IDOK - Pop $0 - - ; Get .NET if required - ${If} $InstallDotNET == "Yes" - SetDetailsView hide - inetc::get /caption "Downloading Microsoft .NET Framework 4.8" /canceltext "Cancel" "https://go.microsoft.com/fwlink/?linkid=2088631" "$INSTDIR\dotnetfx.exe" /end - Pop $1 - - ${If} $1 != "OK" - Delete "$INSTDIR\dotnetfx.exe" - Abort "Installation cancelled, ${PRODUCT_NAME} requires the Microsoft .NET 4.8 Framework" - ${EndIf} - - ExecWait "$INSTDIR\dotnetfx.exe" - Delete "$INSTDIR\dotnetfx.exe" - - SetDetailsView show - ${EndIf} - ; Install Files File "*.exe" File "*.dll" File "*.template" File "*.config" File "*.pdb" + File "*.config" ; Copy the languages SetOutPath "$INSTDIR\de" @@ -192,12 +161,12 @@ Section "HandBrake" SectionApp SetOutPath "$INSTDIR\pt-BR" SetOverwrite ifnewer - File "pt-BR\*.*" - + File "pt-BR\*.*" + SetOutPath "$INSTDIR\co" SetOverwrite ifnewer - File "co\*.*" - + File "co\*.*" + SetOutPath "$INSTDIR\uk" SetOverwrite ifnewer File "uk\*.*" @@ -264,9 +233,9 @@ Section Uninstall Delete "$INSTDIR\ja\*.*" RMDir "$INSTDIR\ja" Delete "$INSTDIR\pt-BR\*.*" - RMDir "$INSTDIR\pt-BR" + RMDir "$INSTDIR\pt-BR" Delete "$INSTDIR\co\*.*" - RMDir "$INSTDIR\co" + RMDir "$INSTDIR\co" Delete "$INSTDIR\uk\*.*" RMDir "$INSTDIR\uk" @@ -294,20 +263,3 @@ Function "desktopShortcut" SetShellVarContext all CreateShortCut "$DESKTOP\HandBrake.lnk" "$INSTDIR\HandBrake.exe" FunctionEnd - -;Check for .NET framework -Function CheckFrameWork - ; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx - ClearErrors - ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release" - - IfErrors NotDetected - - ${If} $0 >= MIN_FRAMEWORK_VER - StrCpy $0 "1" - ${Else} - NotDetected: - StrCpy $0 "2" - ${EndIf} - -FunctionEnd diff --git a/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi b/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi index b3ed1bd64..1b4076095 100644 --- a/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi +++ b/win/CS/HandBrakeWPF/Installer/MakeNightly64.nsi @@ -11,16 +11,9 @@ !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" -;Required .NET framework for 4.7.1 -!define MIN_FRAMEWORK_VER 461308 - SetCompressor lzma ManifestDPIAware true -; Required for Github Actions (or local builds were inetc is not part of the installed NSIS) -; Extract inetc.zip to the HandBrake root directory into a folder called plugins. -!addplugindir /x86-ansi "..\..\..\..\..\..\plugins\Plugins\x86-ansi" - ; MUI 1.67 compatible ------ !include "MUI.nsh" !include WinVer.nsh @@ -122,37 +115,13 @@ Section "HandBrake" SectionApp SetOutPath "$INSTDIR" SetOverwrite ifnewer SectionIn RO ; Read only, always installed - - ; Begin Check .NET version - StrCpy $InstallDotNET "No" - Call CheckFramework - StrCmp $0 "1" +3 - StrCpy $InstallDotNET "Yes" - MessageBox MB_OK|MB_ICONINFORMATION "${PRODUCT_NAME} requires that the Microsoft .NET Framework 4.8 is installed. The latest .NET Framework will be downloaded and installed automatically during installation of ${PRODUCT_NAME}." /SD IDOK - Pop $0 - - ; Get .NET if required - ${If} $InstallDotNET == "Yes" - SetDetailsView hide - inetc::get /caption "Downloading Microsoft .NET Framework 4.8" /canceltext "Cancel" "https://go.microsoft.com/fwlink/?linkid=2088631" "$INSTDIR\dotnetfx.exe" /end - Pop $1 - - ${If} $1 != "OK" - Delete "$INSTDIR\dotnetfx.exe" - Abort "Installation cancelled, ${PRODUCT_NAME} requires the Microsoft .NET 4.8 Framework" - ${EndIf} - - ExecWait "$INSTDIR\dotnetfx.exe" - Delete "$INSTDIR\dotnetfx.exe" - - SetDetailsView show - ${EndIf} ; Install Files File "*.exe" File "*.dll" File "*.template" File "*.config" + File "*.json" File "HandBrake*.pdb" ; Copy the languages @@ -190,12 +159,12 @@ Section "HandBrake" SectionApp SetOutPath "$INSTDIR\pt-BR" SetOverwrite ifnewer - File "pt-BR\*.*" - + File "pt-BR\*.*" + SetOutPath "$INSTDIR\co" SetOverwrite ifnewer - File "co\*.*" - + File "co\*.*" + SetOutPath "$INSTDIR\uk" SetOverwrite ifnewer File "uk\*.*" @@ -260,9 +229,9 @@ Section Uninstall Delete "$INSTDIR\ja\*.*" RMDir "$INSTDIR\ja" Delete "$INSTDIR\pt-BR\*.*" - RMDir "$INSTDIR\pt-BR" + RMDir "$INSTDIR\pt-BR" Delete "$INSTDIR\co\*.*" - RMDir "$INSTDIR\co" + RMDir "$INSTDIR\co" Delete "$INSTDIR\uk\*.*" RMDir "$INSTDIR\uk" @@ -290,19 +259,4 @@ Function "desktopShortcut" CreateShortCut "$DESKTOP\HandBrake Nightly.lnk" "$INSTDIR\HandBrake.exe" FunctionEnd -;Check for .NET framework -Function CheckFrameWork - ; Magic numbers from http://msdn.microsoft.com/en-us/library/ee942965.aspx - ClearErrors - ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release" - - IfErrors NotDetected - ${If} $0 >= MIN_FRAMEWORK_VER - StrCpy $0 "1" - ${Else} - NotDetected: - StrCpy $0 "2" - ${EndIf} - -FunctionEnd diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs index 3c1e70c80..8b6b5b30e 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml.cs @@ -52,7 +52,6 @@ namespace HandBrakeWPF.Views { INotifyIconService notifyIconService = IoC.Get(); this.notifyIcon = new NotifyIcon(); - this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick) }); notifyIconService.RegisterNotifyIcon(this.notifyIcon); StreamResourceInfo streamResourceInfo = Application.GetResourceStream(new Uri("pack://application:,,,/handbrakepineapple.ico")); -- cgit v1.2.3