From 9a3c51815a20aa3c2908f476dd150fffc08dbf5a Mon Sep 17 00:00:00 2001 From: tippfehlr <46620049+tippf3hlr@users.noreply.github.com> Date: Sun, 13 Feb 2022 04:30:56 +0100 Subject: [PATCH] Add DisplayVersion to Windows registry on install (+typo) (#4730) Winget relies on this value to get the version of a program. If it's missing winget will just download the newest version even if the program is up to date. See https://github.com/microsoft/winget-cli/issues/1255 --- .github/workflows/windows.yml | 3 ++- tools/windows_installer/supertuxkart-64bit-mingw.nsi | 4 +++- tools/windows_installer/supertuxkart-github-actions.nsi | 2 ++ tools/windows_installer/supertuxkart-mingw.nsi | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b8ea68284..345ac0814 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -258,11 +258,12 @@ jobs: cp supertuxkart-github-actions.nsi $arch.nsi sed -i "s/define APPNAMEANDVERSION \"\"/define APPNAMEANDVERSION \"SuperTuxKart ${{ env.release_tag }}\"/g" $arch.nsi sed -i "s/define ARCH \"\"/define ARCH \"$arch\"/g" $arch.nsi + sed -i "s/define VERSION \"\"/define VERSION \"${{ env.release_tag }}\"/g" $arch.nsi sed -i "s/OutFile \"\"/OutFile \"SuperTuxKart-${{ env.release_tag }}-installer-$arch.exe\"/g" $arch.nsi for filename in $(ls ../../build-$arch/bin) do file="\\\\$filename" - sed -i "286a\ DELETE /REBOOTOK \"\$INSTDIR$file\"" $arch.nsi + sed -i "288a\ DELETE /REBOOTOK \"\$INSTDIR$file\"" $arch.nsi done # Print result #cat $arch.nsi diff --git a/tools/windows_installer/supertuxkart-64bit-mingw.nsi b/tools/windows_installer/supertuxkart-64bit-mingw.nsi index 7533b9e36..cf5d63075 100644 --- a/tools/windows_installer/supertuxkart-64bit-mingw.nsi +++ b/tools/windows_installer/supertuxkart-64bit-mingw.nsi @@ -28,7 +28,7 @@ ;General ; Version information - ; TOOD get these from the source code directly + ; TODO get these from the source code directly !define VERSION_MAJOR 1 !define VERSION_MINOR 2 !define VERSION_REVISION 0 @@ -38,6 +38,7 @@ ;Name and file !define APPNAME "SuperTuxKart" !define APPNAMEANDVERSION "${APPNAME} ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_BUILD}" + !define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_BUILD}" !define DESCRIPTION "3D open-source arcade racer with a variety characters, tracks, and modes to play" Name "${APPNAMEANDVERSION}" @@ -239,6 +240,7 @@ Section "Install" SecMain WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "Publisher" "${APPNAME}" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "DisplayIcon" "$\"$INSTDIR\icon.ico$\"" + WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "DisplayVersion" "${VERSION}" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "HelpLink" "$\"${HELPURL}$\"" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "URLInfoAbout" "$\"${ABOUTURL}$\"" diff --git a/tools/windows_installer/supertuxkart-github-actions.nsi b/tools/windows_installer/supertuxkart-github-actions.nsi index 7d9f6fb36..a9cff4732 100644 --- a/tools/windows_installer/supertuxkart-github-actions.nsi +++ b/tools/windows_installer/supertuxkart-github-actions.nsi @@ -39,6 +39,7 @@ Unicode True !define APPNAME "SuperTuxKart" !define APPNAMEANDVERSION "" !define ARCH "" + !define VERSION "" !define DESCRIPTION "3D open-source arcade racer with a variety characters, tracks, and modes to play" Name "${APPNAMEANDVERSION}" @@ -257,6 +258,7 @@ Section "Install" SecMain WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "Publisher" "SuperTuxKart Team" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "DisplayIcon" "$\"$INSTDIR\icon.ico$\"" + WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "DisplayVersion" "${VERSION}" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "HelpLink" "${HELPURL}" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "URLUpdateInfo" "${UPDATEURL}" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "URLInfoAbout" "${ABOUTURL}" diff --git a/tools/windows_installer/supertuxkart-mingw.nsi b/tools/windows_installer/supertuxkart-mingw.nsi index d3f3663f2..011b2917a 100644 --- a/tools/windows_installer/supertuxkart-mingw.nsi +++ b/tools/windows_installer/supertuxkart-mingw.nsi @@ -28,7 +28,7 @@ ;General ; Version information - ; TOOD get these from the source code directly + ; TODO get these from the source code directly !define VERSION_MAJOR 1 !define VERSION_MINOR 2 !define VERSION_REVISION 0 @@ -38,6 +38,7 @@ ;Name and file !define APPNAME "SuperTuxKart" !define APPNAMEANDVERSION "${APPNAME} ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_BUILD}" + !define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_BUILD}" !define DESCRIPTION "3D open-source arcade racer with a variety characters, tracks, and modes to play" Name "${APPNAMEANDVERSION}" @@ -238,6 +239,7 @@ Section "Install" SecMain WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "Publisher" "${APPNAME}" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "DisplayIcon" "$\"$INSTDIR\icon.ico$\"" + WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "DisplayVersion" "${VERSION}" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "HelpLink" "$\"${HELPURL}$\"" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" WriteRegStr HKLM "${ADD_REMOVE_KEY_NAME}" "URLInfoAbout" "$\"${ABOUTURL}$\""