Skip to content

[Feature Request] Auto-Updater #1159

Closed
Closed

Description

@avalanchas

Description

Sourcegit should have a way to auto-update, or install a new version on top of the currently running one.
This would allow users to stay up-to-date without having to manually visit Github, then close the program and overwrite the existing version. Manual install can lead to errors (like duplication) or user fatigue towards updates (which can have security implications down the line)

For this, something like the following requirements have to be met

  • regularly check online for new version
  • on user-confirmation (or automatically) download update package
  • restart running software
  • during restart, replace files in the background

Activity

  1. mithom commented on Apr 7, 2025

    @mithom
    Contributor

    if you wait 1 day after the dialog popup, you can use the commandline winget to automatically update to the new version.
    maybe there is a world where the program knows about this and (on windows) uses winget to check for updates instead of the github repository to then automatically run this command

    winget upgrade sourcegit-scm.sourcegit

  2. goran-w commented on Apr 8, 2025

    @goran-w
    Contributor

    The README mentions Scoop (on Windows) as an alternative to winget, but SourceGit is also available on Chocolatey (for Windows) : https://community.chocolatey.org/packages/sourcegit

  3. goran-w commented on Apr 8, 2025

    @goran-w
    Contributor

    winget upgrade sourcegit.sourcegit

    I think it should be simply:

    winget upgrade SourceGit

    At least if it was installed like this:

    winget install SourceGit

  4. mithom commented on Apr 8, 2025

    @mithom
    Contributor

    you can use sourcegit as that is the name, but you can also use the id to avoid conflicts:

    Image
    apparently i was mistaken and it should be sourcegit-scm.sourcegit

  5. goran-w commented on Apr 8, 2025

    @goran-w
    Contributor

    Scoop and Chocolatey seem to update earlier - right now both have SourceGit at v2025.12 while winget is still at v2025.11.

  6. self-assigned this
    on Apr 8, 2025
  7. added
    not-planned
    on Apr 8, 2025
  8. avalanchas commented on Apr 11, 2025

    @avalanchas
    Author

    apt and dpkg on linux don't work that way unfortunately. If anybody has a similar tip for Linux I'd appreciate it a lot

  9. aikawayataro commented on Apr 11, 2025

    @aikawayataro
    Contributor

    @avalanchas you can use deb repository for apt, check README for installation tips. This way SourceGit will be updated when you do your regular apt update && apt upgrade routine.

  10. goran-w commented on Dec 5, 2025

    @goran-w
    Contributor

    Apparently, winget is no longer an option for installing / updating SourceGit, see #1931 (comment).

  11. goran-w commented on Dec 5, 2025

    @goran-w
    Contributor

    FWIW, here's a Windows .bat script I use to update SourceGit (in the directory where the script file resides), from the latest release on GitHub (using curl which is nowadays included in Windows 10/11)...

    @echo off
    
    net FILE >nul 2>&1
    if %errorLevel% NEQ 0 (
    
        echo Current permissions inadequate, restarting with elevation request...
        powershell -Command "Start-Process -Verb RunAs -FilePath '%0'"
        exit /b
    
    ) else (
    
        echo Administrative permissions confirmed.
    
        cd /d %~dp0
    
        echo Current directory:
        cd
        echo.
    
        echo Downloading...
    
        for /f "tokens=1,* delims=:" %%A in ('curl -Ls https://api.github.com/repos/sourcegit-scm/sourcegit/releases/latest ^| find "browser_download_url"') do (
    
            echo %%B | FINDSTR "win-x64" && (
    
                curl -kOL %%B
    
                echo Unpacking...
                tar -xf %%~nxB
    
                echo Replacing...
                copy /Y SourceGit\* .
    
                echo Cleaning up...
                del %%~nxB
                rmdir /S /Q SourceGit
    
                rem echo "Unblocking downloaded EXE...""
                rem echo.>SourceGit.exe:Zone.Identifier
    
                echo Done.
                echo.
            )
        )
    )
    
    pause
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

not-planned

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions