Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c17fddf

Browse files
committed
fix dotnet 8 thing for arch
1 parent 1ce81c5 commit c17fddf

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

AffinityScripts/AffinityLinuxInstaller.py

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,8 +2985,8 @@ def install_dependencies(self):
29852985
return self.install_popos_dependencies()
29862986

29872987
commands = {
2988-
"arch": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "wine", "winetricks", "wget", "curl", "p7zip", "tar", "jq", "zstd", "dotnet-sdk"],
2989-
"cachyos": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "wine", "winetricks", "wget", "curl", "p7zip", "tar", "jq", "zstd", "dotnet-sdk"],
2988+
"arch": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "wine", "winetricks", "wget", "curl", "p7zip", "tar", "jq", "zstd", "dotnet-core-8.0"],
2989+
"cachyos": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "wine", "winetricks", "wget", "curl", "p7zip", "tar", "jq", "zstd", "dotnet-core-8.0"],
29902990
"endeavouros": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "wine", "winetricks", "wget", "curl", "p7zip", "tar", "jq", "zstd", "dotnet-sdk"],
29912991
"xerolinux": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "wine", "winetricks", "wget", "curl", "p7zip", "tar", "jq", "zstd", "dotnet-sdk"],
29922992
"fedora": ["sudo", "dnf", "install", "-y", "wine", "winetricks", "wget", "curl", "p7zip", "p7zip-plugins", "tar", "jq", "zstd", "dotnet-sdk-8.0"],
@@ -5440,8 +5440,31 @@ def check_dotnet_sdk(self):
54405440
self.log("You may need to add /usr/bin to your PATH or restart your terminal", "info")
54415441
return True # Return True anyway since package is installed
54425442

5443-
elif self.distro in ["arch", "cachyos", "endeavouros", "xerolinux"]:
5444-
# Check via pacman
5443+
elif self.distro in ["arch", "cachyos"]:
5444+
# Check via pacman for dotnet-core-8.0
5445+
success, stdout, _ = self.run_command(
5446+
["pacman", "-Q", "dotnet-core-8.0"],
5447+
check=False,
5448+
capture=True
5449+
)
5450+
if success and stdout and "dotnet-core-8.0" in stdout:
5451+
self.log(".NET SDK package found via pacman (dotnet-core-8.0)", "success")
5452+
# Try common paths
5453+
common_paths = ["/usr/bin/dotnet", "/usr/local/bin/dotnet"]
5454+
for path in common_paths:
5455+
if Path(path).exists():
5456+
success, stdout, _ = self.run_command(
5457+
[path, "--version"],
5458+
check=False,
5459+
capture=True
5460+
)
5461+
if success and stdout:
5462+
version = stdout.strip()
5463+
self.log(f".NET SDK found at {path}: {version}", "success")
5464+
return True
5465+
return True # Package is installed
5466+
elif self.distro in ["endeavouros", "xerolinux"]:
5467+
# Check via pacman for dotnet-sdk (other Arch-based distros might use different package name)
54455468
success, stdout, _ = self.run_command(
54465469
["pacman", "-Q", "dotnet-sdk"],
54475470
check=False,
@@ -5654,7 +5677,9 @@ def patch_affinity_dll(self, app_name):
56545677
self.log("Failed to install .NET SDK automatically", "warning")
56555678
self.log("Settings patching will be skipped.", "warning")
56565679
self.log("You can install .NET SDK manually:", "info")
5657-
if self.distro in ["arch", "cachyos", "endeavouros", "xerolinux"]:
5680+
if self.distro in ["arch", "cachyos"]:
5681+
self.log(" sudo pacman -S dotnet-core-8.0", "info")
5682+
elif self.distro in ["endeavouros", "xerolinux"]:
56585683
self.log(" sudo pacman -S dotnet-sdk", "info")
56595684
elif self.distro in ["fedora", "nobara"]:
56605685
self.log(" sudo dnf install dotnet-sdk-8.0", "info")
@@ -5950,8 +5975,8 @@ def install_dotnet_sdk(self):
59505975
return True
59515976

59525977
commands = {
5953-
"arch": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "dotnet-sdk"],
5954-
"cachyos": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "dotnet-sdk"],
5978+
"arch": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "dotnet-core-8.0"],
5979+
"cachyos": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "dotnet-core-8.0"],
59555980
"endeavouros": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "dotnet-sdk"],
59565981
"xerolinux": ["sudo", "pacman", "-S", "--needed", "--noconfirm", "dotnet-sdk"],
59575982
"fedora": ["sudo", "dnf", "install", "-y", "dotnet-sdk-8.0"],
@@ -6009,7 +6034,9 @@ def fix_affinity_settings(self):
60096034
if not self.install_dotnet_sdk():
60106035
self.log("Failed to install .NET SDK automatically", "error")
60116036
self.log("Please install .NET SDK manually:", "info")
6012-
if self.distro in ["arch", "cachyos", "endeavouros", "xerolinux"]:
6037+
if self.distro in ["arch", "cachyos"]:
6038+
self.log(" sudo pacman -S dotnet-core-8.0", "info")
6039+
elif self.distro in ["endeavouros", "xerolinux"]:
60136040
self.log(" sudo pacman -S dotnet-sdk", "info")
60146041
elif self.distro in ["fedora", "nobara"]:
60156042
self.log(" sudo dnf install dotnet-sdk-8.0", "info")

0 commit comments

Comments
 (0)