ALIENQuake / ProjectInfinity

Project Infinity - a mod manager for Baldur's Gate Enhanced Edition, Icewind Dale Enhanced Edition, Planescape Torment Enhanced Edition and Enhanced Edition Trilogy (EET).
https://forums.beamdog.com/discussion/74335/project-infinity-public-beta-for-all/p1
71 stars 7 forks source link

[Feature]PI should use system Git if it is already installed, rather than downloading a new copy #46

Open elisimpson opened 1 year ago

elisimpson commented 1 year ago

Is your feature request related to a problem? Please describe. I have Git installed on all my systems already, so PI downloading another copy in unnecessary. Slows down the initial setup.

Describe the solution you'd like PI should check if "git" is available in the PATH and prevent download of local Git if so.

elisimpson commented 8 months ago

@ALIENQuake Hoping this can get worked on. Here's some additional info from the ProjectInfinity-Tools-Download log:

Required Git 2.30.2 is missing Any local Git version is missing Global Git is missing

Git is definitely installed but is not being detected by PI. Is perhaps PI looking for the exact version 2.30.2? I'm currently running 2.43.0

If not, there's something wrong with PI's Git detection code as according to the log it's looking for a "Global Git" install and not finding it.

ALIENQuake commented 8 months ago

@elisimpson Hey,

  1. Can you successfully launch git simply by typing git --version in the console?
  2. What's the outcome of this code executed in Windows PowerShell:
    
    function Get-GitGlobalPath {
    # check if git can be launched as global tool
    $ErrorActionPreference = 'SilentlyContinue'
    $p = Start-Process "git" -ArgumentList '--version' -WindowStyle Hidden -Wait -PassThru 
    $ErrorActionPreference = 'Continue'
    if ($null -ne $p -and $p.ExitCode -eq 0) {
        [version]$global:gitGlobalVersion = (Get-Item ($p.StartInfo.FileName) -Force).VersionInfo.FileVersionRaw
        $gitPath = 'git'
    }
    else {
        $gitPath = $null
    }
    $gitPath
    }

Get-GitGlobalPath

elisimpson commented 8 months ago
  1. yes ... "git version 2.43.0.windows.1"
  2. script outputs "git"

Despite git being available PI always thinks it needs to download a local copy for the Tools dir

ALIENQuake commented 8 months ago

This will be fixed in the next version, no ETA.