Skip to content

Commit

Permalink
Improve how dependencies are checked and installed
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Jul 1, 2024
1 parent b74dece commit 88fa7f5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ To translate WingetUI to other languages or to update an old translation, please
| <img src='https://flagcdn.com/no.svg' width=20> &nbsp; Norwegian (nynorsk) | 100% | [yrjarv](https://github.com/yrjarv) |
| <img src='https://flagcdn.com/nl.svg' width=20> &nbsp; Dutch - Nederlands | 100% | [abbydiode](https://github.com/abbydiode), [Stephan-P](https://github.com/Stephan-P) |
| <img src='https://flagcdn.com/pl.svg' width=20> &nbsp; Polish - Polski | 99% | [KamilZielinski](https://github.com/KamilZielinski), [kwiateusz](https://github.com/kwiateusz), [RegularGvy13](https://github.com/RegularGvy13), [ThePhaseless](https://github.com/ThePhaseless) |
| <img src='https://flagcdn.com/br.svg' width=20> &nbsp; Portuguese (Brazil) | 99% | [maisondasilva](https://github.com/maisondasilva), [ppvnf](https://github.com/ppvnf), [Rodrigo-Matsuura](https://github.com/Rodrigo-Matsuura), [wanderleihuttel](https://github.com/wanderleihuttel) |
| <img src='https://flagcdn.com/br.svg' width=20> &nbsp; Portuguese (Brazil) | 100% | [maisondasilva](https://github.com/maisondasilva), [ppvnf](https://github.com/ppvnf), [Rodrigo-Matsuura](https://github.com/Rodrigo-Matsuura), [thiagojramos](https://github.com/thiagojramos), [wanderleihuttel](https://github.com/wanderleihuttel) |
| <img src='https://flagcdn.com/pt.svg' width=20> &nbsp; Portuguese (Portugal) | 99% | [PoetaGA](https://github.com/PoetaGA), [Tiago_Ferreira](https://github.com/Tiago_Ferreira) |
| <img src='https://flagcdn.com/ro.svg' width=20> &nbsp; Romanian - Română | 100% | [SilverGreen93](https://github.com/SilverGreen93), TZACANEL |
| <img src='https://flagcdn.com/ru.svg' width=20> &nbsp; Russian - Русский | 100% | [bropines](https://github.com/bropines), [DvladikD](https://github.com/DvladikD), [flatron4eg](https://github.com/flatron4eg), [katrovsky](https://github.com/katrovsky), Sergey, sklart |
Expand All @@ -162,7 +162,7 @@ To translate WingetUI to other languages or to update an old translation, please
| <img src='https://flagcdn.com/cn.svg' width=20> &nbsp; Simplified Chinese (China) | 100% | Aaron Liu, adfnekc, [arthurfsy2](https://github.com/arthurfsy2), [bai0012](https://github.com/bai0012), BUGP Association, ciaran, CnYeSheng, Cololi, [FloatStream](https://github.com/FloatStream), [SpaceTimee](https://github.com/SpaceTimee), Yisme |
| <img src='https://flagcdn.com/tw.svg' width=20> &nbsp; Traditional Chinese (Taiwan) | 99% | Aaron Liu, CnYeSheng, Cololi, [Henryliu880922](https://github.com/Henryliu880922), [yrctw](https://github.com/yrctw) |

Last updated: Sun Jun 30 00:12:46 2024
Last updated: Mon Jul 1 14:39:12 2024
<!-- END Autogenerated translations -->


Expand Down
2 changes: 1 addition & 1 deletion src/UniGetUI.PackageEngine.Managers.Dotnet/DotNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public DotNet() : base()
new ManagerDependency(
".NET Tools Outdated",
Path.Join(Environment.SystemDirectory, "windowspowershell\\v1.0\\powershell.exe"),
"-ExecutionPolicy Bypass -NoLogo -NoProfile -Command \"& {dotnet tool install --global dotnet-tools-outdated: ; if($error.count -ne 0){pause}}\"",
"-ExecutionPolicy Bypass -NoLogo -NoProfile -Command \"& {dotnet tool install --global dotnet-tools-outdated --add-source https://api.nuget.org/v3/index.json; if($error.count -ne 0){pause}}\"",
async () => (await CoreTools.Which("dotnet-tools-outdated.exe")).Item1)
];

Expand Down
11 changes: 9 additions & 2 deletions src/UniGetUI.PackageEngine.Managers.Scoop/Scoop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@ public class Scoop : PackageManager
public Scoop(): base()
{
Dependencies = [
// Scoop-Search is required for search to work
new ManagerDependency(
"Scoop-Search",
Path.Join(Environment.SystemDirectory, "windowspowershell\\v1.0\\powershell.exe"),
"-ExecutionPolicy Bypass -NoLogo -NoProfile -Command \"& {scoop install main/scoop-search; if($error.count -ne 0){pause}}\"",
async () => (await CoreTools.Which("scoop-search.exe")).Item1)
async () => (await CoreTools.Which("scoop-search.exe")).Item1),
// GIT is required for scoop updates to work
new ManagerDependency(
"Git",
Path.Join(Environment.SystemDirectory, "windowspowershell\\v1.0\\powershell.exe"),
"-ExecutionPolicy Bypass -NoLogo -NoProfile -Command \"& {scoop install main/git; if($error.count -ne 0){pause}}\"",
async () => (await CoreTools.Which("git.exe")).Item1)
];

Capabilities = new ManagerCapabilities()
Expand All @@ -37,7 +44,7 @@ public Scoop(): base()
CanSkipIntegrityChecks = true,
CanRemoveDataOnUninstall = true,
SupportsCustomArchitectures = true,
SupportedCustomArchitectures = new Architecture[] { Architecture.X86, Architecture.X64, Architecture.Arm64 },
SupportedCustomArchitectures = [Architecture.X86, Architecture.X64, Architecture.Arm64],
SupportsCustomScopes = true,
SupportsCustomSources = true,
Sources = new ManagerSource.Capabilities()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace UniGetUI.PackageEngine.ManagerClasses.Manager
{
public class ManagerProperties
public struct ManagerProperties
{
public bool IsDummy = false;
public string Name { get; set; } = "Unset";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace UniGetUI.PackageEngine.Classes.Manager.ManagerHelpers
{
public class ManagerStatus
public struct ManagerStatus
{
public string Version = "";
public bool Found = false;
Expand Down
4 changes: 3 additions & 1 deletion src/UniGetUI/Assets/Utilities/install_scoop.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
SET unigetuipath=%~dp0..\unigetui.exe
SET unigetuipath=%~dp0..\wingetui.exe
set pwsh=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
echo Scoop Installer Assistant - UniGetUI
echo This script will install Scoop and its dependencies, since it appears that they are not installed on your machine.
Expand All @@ -10,10 +10,12 @@ cls
if %errorlevel% equ 0 (
echo UniGetUI will be restarted to continue.
pause
taskkill /im wingetui.exe /f
taskkill /im unigetui.exe /f
start /b "%unigetuipath%" /i
) else (
pause
taskkill /im wingetui.exe /f
taskkill /im unigetui.exe /f
start /b "%unigetuipath%" /i
)

0 comments on commit 88fa7f5

Please sign in to comment.