Skip to content

Feature request: add an updater #1575

Open

Description

@xan2622

Hi.

Sourcegit is evolving quickly, with frequent updates and ongoing development. Thank you for improving it this much!

That being said, these frequent updates mean that users often have to go to GitHub, download the latest release file, extract its contents and manually replace the previously extracted folder. While this process is simple, it can still feel very repetitive.

Hence this suggestion:
Could you please consider adding an updater inside Sourcegit?

Maybe these projects can help achieve this task:

Activity

  1. massimopaganigh commented on Jul 15, 2025

    @massimopaganigh
    Contributor

    Several issues had already been opened in the past on this topic.
    At the time I understood that there was no intention to implement it since there are other update methods available besides downloading the file manually from GitHub such as WinGet.
    Please read #1159 as reference.

  2. goran-w commented on Dec 5, 2025

    @goran-w
    Contributor

    WinGet is no longer an option (instead Scoop is recommended), see #1931 (comment).

  3. goran-w commented on Dec 5, 2025

    @goran-w
    Contributor

    Auto-update would be very nice to have given the rapid release rate of SourceGit (usually once a week or so).

    However, using a package manager (like Scoop) can conflict with the idea of in-app auto-update functionality (see ScoopInstaller/Scoop#3691).

    Also, it may be difficult for the app itself to know which way it was originally installed.

    At the very least, given the current situation, the README should be updated to explain not only how to install the application (via the different available methods) but also how to update it! For package managers it's usually just a couple of extra command lines, which may seem trivial but would be very helpful to new users.

    For example, to update using Scoop, run the following commands :
    scoop update (refresh manifests and Scoop itself)
    scoop update sourcegit

    BTW, see #1159 (comment) for a .bat script I use to update SourceGit via curl.

  4. massimopaganigh commented on Dec 9, 2025

    @massimopaganigh
    Contributor

    Auto-update would be very nice to have given the rapid release rate of SourceGit (usually once a week or so).

    However, using a package manager (like Scoop) can conflict with the idea of in-app auto-update functionality (see ScoopInstaller/Scoop#3691).

    Also, it may be difficult for the app itself to know which way it was originally installed.

    At the very least, given the current situation, the README should be updated to explain not only how to install the application (via the different available methods) but also how to update it! For package managers it's usually just a couple of extra command lines, which may seem trivial but would be very helpful to new users.

    For example, to update using Scoop, run the following commands : scoop update (refresh manifests and Scoop itself) scoop update sourcegit

    BTW, see #1159 (comment) for a .bat script I use to update SourceGit via curl.

    Hi @goran-w,
    maybe the application path could be used in order to understand the way it was originally installed.
    Scoop (Winget and many others package managers) should use a default installation path.
    An auto-update logic can be implemented and used without any conflict after ensuring that the application is not inside any of those paths.

  5. goran-w commented on Dec 9, 2025

    @goran-w
    Contributor

    Hi @goran-w, maybe the application path could be used in order to understand the way it was originally installed. Scoop (Winget and many others package managers) should use a default installation path. An auto-update logic can be implemented and used without any conflict after ensuring that the application is not inside any of those paths.

    Yes - at least that would distinguish "standard" cases of the documented ways to install (i.e via Scoop etc).

    Also, for the case of detecting that SourceGit is indeed installed via Scoop, it might be possible to spawn a script that auto-updates SourceGit via Scoop (after closing SourceGit to avoid locked files etc).

  6. goran-w commented on Dec 12, 2025

    @goran-w
    Contributor

    At the very least, given the current situation, the README should be updated to explain not only how to install the application (via the different available methods) but also how to update it! For package managers it's usually just a couple of extra command lines, which may seem trivial but would be very helpful to new users.

    For example, to update using Scoop, run the following commands (the 1st line will refresh manifests and Scoop itself, before updating SourceGit on the 2nd line) :
    scoop update
    scoop update sourcegit

    @love-linger could you add this to the README.md file?

  7. Danielku15 commented on Dec 24, 2025

    @Danielku15
    Contributor

    Related: #478

    I think Velopack could be a good solution without reinventing the wheel. Cross platform, well integratable with GitHub Releases etc.

    Considering SourceGit has already some update checking mechanism I think replacing it with Velopack to ship installers and updaters could be feasable. If @love-linger gives a thumbs-up I could spin-up a PoC.

  8. tehXor commented on Jan 10, 2026

    @tehXor

    scoop is a security nightmare even compared to the already-not-so-great winget. Among a lot of bad to questionable designs, with Scoop if any used scoop bucket alone gets compromised (not the vendor repo and an attacker would still be miles away from obtaining private vendor keys for signing and such) anybody using Scoop at that point has a fully compromised machine because in Scoop manifests itself can run arbitrary commands (yey! at least it is fast and convenient, no?).

    I'd strongly advice against ever using Scoop on any machine meant for more then just your weekend activity. And I think most people who research Scoop and winget a little bit will get to the same conclusion (and depending on what they work they might already rule out winget).

    For the winget route you could maintain an own Manifest endpoint which users would need to add manually but what could then be in your automatic pipeline. And then deploy to the winget main repo and accept delays or only even deploy every x versions (not all fancy speed and some even like to wait when they get at least some stability/security in return).

    Regardless the update path and everything said, a signed binary would be great anyway. In know it costs around ~500$ a year and will add some complexity and cost 2-3 working days but it is an actual security improvement and makes updates simpler in that sense that not that much trust is needed for the updater/update way (well for a broken beyond repair design like Scoop it wouldn't help but hey 😅).

  9. lisngt commented on Mar 3, 2026

    @lisngt

    I have created a temporary Python script to download and update the current Win-x64 version. You can modify it as needed for your local setup.

    import requests
    import urllib.request
    import zipfile
    import os
    from pathlib import Path
    
    
    def main():
        # Configuration
        api_url = "https://api.github.com/repos/sourcegit-scm/sourcegit/releases/latest"
        target_dir = r"absolute_path_to_your_local_source_git_folder"
        zip_pattern = "win-x64.zip"
        
        try:
            print("Fetching latest release information from GitHub API...")
            headers = {
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
            }
            response = requests.get(api_url, headers=headers, timeout=10)
            response.raise_for_status()
            
            # Parse JSON response
            release_data = response.json()
            
            # Find the download link for sourcegit_*.win-x64.zip
            print(f"Searching for {zip_pattern} download link...")
            download_link = None
            
            for asset in release_data.get('assets', []):
                filename = asset.get('name', '')
                if 'sourcegit_' in filename and zip_pattern in filename:
                    download_link = asset.get('browser_download_url')
                    print(f"Found: {filename}")
                    break
            
            if not download_link:
                print(f"Error: Could not find download link for {zip_pattern} file")
                print("Available assets:")
                for asset in release_data.get('assets', []):
                    print(f"  - {asset.get('name', 'Unknown')}")
                return False
            
            print(f"Download URL: {download_link}")
            
            # Download the file
            print("Downloading file...")
            zip_filename = "sourcegit.zip"
            urllib.request.urlretrieve(download_link, zip_filename)
            print(f"Downloaded to {zip_filename}")
            
            # Extract to target directory
            print(f"Extracting to {target_dir}...")
            with zipfile.ZipFile(zip_filename, 'r') as zip_ref:
                zip_ref.extractall(target_dir)
            
            # Clean up
            os.remove(zip_filename)
            print(f"Successfully extracted all files to {target_dir}")
            print("Cleanup complete!")
            return True
            
        except Exception as e:
            print(f"Error: {e}")
            import traceback
            traceback.print_exc()
            return False
    
    
    if __name__ == "__main__":
        main()
    
    
  10. YerayAlonso commented on Mar 3, 2026

    @YerayAlonso

    Worth to mention here Chocolatey (and UniGetUI).
    To be honest, I don't know if they are more or less secure than winget and scoop.
    But the v2026.05 seems to be in Chocolatey, while winget includes up to v2026.04.

  11. XeonG commented on May 19, 2026

    @XeonG

    Just created one for powershell,
    Run with: "powershell -ExecutionPolicy Bypass -File Update-SourceGit.ps1"
    Will create a windows shortcut in the same folder to use the next time.

    Save in 'Update-SourceGit.ps1'

    # Run with: "powershell -ExecutionPolicy Bypass -File Update-SourceGit.ps1"
    # Will create a windows shortcut in the same folder to use another time.
    # Automatically uses the folder where this script is located
    $targetDir = if ($PSScriptRoot) { $PSScriptRoot } else { Split-Path -Parent $MyInvocation.MyCommand.Definition }
    $apiUrl = "https://api.github.com/repos/sourcegit-scm/sourcegit/releases/latest"
    $zipPattern = "win-x64.zip"
    
    try {
        Write-Host "[INFO] Fetching latest release..." -ForegroundColor Cyan
        $release = Invoke-RestMethod -Uri $apiUrl -Headers @{ "User-Agent" = "PowerShell" }
        $asset = $release.assets | Where-Object { $_.name -like "*sourcegit_*$zipPattern" } | Select-Object -First 1
    
        if (-not $asset) {
            throw "Could not find asset matching: *sourcegit_*$zipPattern"
        }
    
        $zipPath = Join-Path $env:TEMP "sourcegit_update.zip"
        Write-Host "[INFO] Downloading $($asset.name)..." -ForegroundColor Cyan
        Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $zipPath -UseBasicParsing
    
        $tempExtractDir = Join-Path $env:TEMP "sourcegit_extract_temp"
        Write-Host "[INFO] Extracting to temporary location..." -ForegroundColor Cyan
        Expand-Archive -Path $zipPath -DestinationPath $tempExtractDir -Force
    
        # Detect if the ZIP contains a single root wrapper folder
        $subFolders = Get-ChildItem -Path $tempExtractDir -Directory
        if ($subFolders.Count -eq 1) {
            $sourcePath = $subFolders[0].FullName
            Write-Host "[INFO] Detected root folder '$($subFolders[0].Name)'. Flattening to $targetDir..." -ForegroundColor Yellow
        } else {
            $sourcePath = $tempExtractDir
            Write-Host "[INFO] Extracting directly to $targetDir..." -ForegroundColor Yellow
        }
    
        # Copy all contents to target, preserving subfolders but skipping the wrapper
        Copy-Item -Path "$sourcePath\*" -Destination $targetDir -Recurse -Force
    
        Write-Host "[SUCCESS] Update complete. Files are now in: $targetDir" -ForegroundColor Green
    
        $WshShell = New-Object -ComObject WScript.Shell
        $Shortcut = $WshShell.CreateShortcut("$PSScriptRoot\Update-SourceGit.lnk")
        $Shortcut.TargetPath = "powershell.exe"
        $Shortcut.Arguments = "-ExecutionPolicy Bypass -File `"$PSScriptRoot\Update-SourceGit.ps1`""
        $Shortcut.Save()
        Write-Host "Shortcut created: Update-SourceGit.lnk"
    
    }
    catch {
        Write-Host "[ERROR] Update failed: $_" -ForegroundColor Red
    }
    finally {
        # Cleanup temp files
        if (Test-Path $zipPath)      { Remove-Item $zipPath -Force }
        if (Test-Path $tempExtractDir) { Remove-Item $tempExtractDir -Recurse -Force }
    }
    
  12. goran-w commented on Jun 10, 2026

    @goran-w
    Contributor

    @love-linger Could Updatum be used to implement (built-in) cross-platform auto-update functionality (via its NuGet package)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions