From ac9d712a084898521630ee5a7b4a9581f35a784b Mon Sep 17 00:00:00 2001 From: "Emil A. Overbeck" Date: Fri, 27 Feb 2026 15:42:21 +0100 Subject: [PATCH] Use a global installation path for miniforge --- Windows/Components/Core/uninstall_conda.ps1 | 5 +++-- Windows/Components/Diagnostics/generate_report.ps1 | 11 +++++++---- Windows/Components/Python/install.ps1 | 9 +++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Windows/Components/Core/uninstall_conda.ps1 b/Windows/Components/Core/uninstall_conda.ps1 index d00058e4..ffec10d3 100644 --- a/Windows/Components/Core/uninstall_conda.ps1 +++ b/Windows/Components/Core/uninstall_conda.ps1 @@ -41,7 +41,8 @@ $possibleCondaPaths = @( "$env:USERPROFILE\anaconda3", "$env:ProgramData\miniforge3", "$env:ProgramData\miniconda3", - "$env:ProgramData\anaconda3" + "$env:ProgramData\anaconda3", + "C:\DTUApps\miniforge3" ) foreach ($path in $possibleCondaPaths) { @@ -338,4 +339,4 @@ if ($useNativeDialogs) { Write-Host "" } -Write-Host "You can now reinstall conda if needed." -ForegroundColor Green \ No newline at end of file +Write-Host "You can now reinstall conda if needed." -ForegroundColor Green diff --git a/Windows/Components/Diagnostics/generate_report.ps1 b/Windows/Components/Diagnostics/generate_report.ps1 index 6bb56dcf..820cddd7 100644 --- a/Windows/Components/Diagnostics/generate_report.ps1 +++ b/Windows/Components/Diagnostics/generate_report.ps1 @@ -22,6 +22,9 @@ function Refresh-Environment { "$env:USERPROFILE\miniforge3", "$env:USERPROFILE\miniforge3\Scripts", "$env:USERPROFILE\miniforge3\Library\bin", + "C:\DTUApps\miniforge3", + "C:\DTUApps\miniforge3\Scripts", + "C:\DTUApps\miniforge3\Library\bin", "$env:LOCALAPPDATA\Programs\Microsoft VS Code\bin", "${env:ProgramFiles}\Microsoft VS Code\bin", "${env:ProgramFiles(x86)}\Microsoft VS Code\bin" @@ -50,7 +53,7 @@ function Get-SystemInfo { $pythonVersion = $null # First try to find conda Python specifically - $condaPythonPath = "$env:USERPROFILE\miniforge3\python.exe" + $condaPythonPath = "C:\DTUApps\miniforge3\python.exe" if (Test-Path $condaPythonPath) { Write-Host " Found conda Python at: $condaPythonPath" -ForegroundColor Gray $pythonPath = $condaPythonPath @@ -181,7 +184,7 @@ function Test-FirstYearSetup { # Test 1: Miniforge Installation Write-Output "Testing Miniforge Installation..." - $miniforgePath = "$env:USERPROFILE\miniforge3" + $miniforgePath = "C:\DTUApps\miniforge3" if ((Test-Path $miniforgePath) -and ($SystemInfo.CondaPath)) { Write-Output "PASS: Miniforge installed at $miniforgePath" } else { @@ -212,8 +215,8 @@ function Test-FirstYearSetup { Write-Output "Testing DTU Packages..." # Try to use conda Python with environment activation - $condaPythonPath = "$env:USERPROFILE\miniforge3\python.exe" - $condaScriptsPath = "$env:USERPROFILE\miniforge3\Scripts" + $condaPythonPath = "C:\DTUApps\miniforge3\python.exe" + $condaScriptsPath = "C:\DTUApps\miniforge3\Scripts" if (Test-Path $condaPythonPath) { # Use conda Python directly diff --git a/Windows/Components/Python/install.ps1 b/Windows/Components/Python/install.ps1 index 24056186..d07f2f35 100644 --- a/Windows/Components/Python/install.ps1 +++ b/Windows/Components/Python/install.ps1 @@ -22,7 +22,8 @@ $condaPaths = @( "$env:USERPROFILE\anaconda3\Scripts\conda.exe", "$env:ProgramData\miniforge3\Scripts\conda.exe", "$env:ProgramData\miniconda3\Scripts\conda.exe", - "$env:ProgramData\anaconda3\Scripts\conda.exe" + "$env:ProgramData\anaconda3\Scripts\conda.exe", + "C:\DTUApps\miniforge3\Scripts\conda.exe" ) $condaFound = $false @@ -93,9 +94,9 @@ if (-not $condaFound) { # Install Miniforge silently Write-Host "Installing Miniforge..." Write-Host "Installer path: $installerPath" - Write-Host "Installation directory: $env:USERPROFILE\miniforge3" + Write-Host "Installation directory: C:\DTUApps\miniforge3" try { - $process = Start-Process -FilePath $installerPath -ArgumentList "/S /D=$env:USERPROFILE\miniforge3" -Wait -PassThru + $process = Start-Process -FilePath $installerPath -ArgumentList "/S /D=C:\DTUApps\miniforge3" -Wait -PassThru if ($process.ExitCode -ne 0) { Write-Host "Miniforge installation failed with exit code: $($process.ExitCode)" throw "Miniforge installation failed" @@ -113,7 +114,7 @@ if (-not $condaFound) { } # Add Miniforge to PATH - $miniforgePath = "$env:USERPROFILE\miniforge3\Scripts" + $miniforgePath = "C:\DTUApps\miniforge3\Scripts" $currentPath = [Environment]::GetEnvironmentVariable("PATH", "User") if ($currentPath -notlike "*$miniforgePath*") { $newPath = "$currentPath;$miniforgePath"