Skip to content

Commit

Permalink
Add DisplayVersion to Windows registry on install (+typo) (supertuxka…
Browse files Browse the repository at this point in the history
…rt#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 microsoft/winget-cli#1255
  • Loading branch information
tippfehlr authored and remihb committed Jan 9, 2024
1 parent 82f2517 commit d0c554b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tools/windows_installer/supertuxkart-64bit-mingw.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand Down Expand Up @@ -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}$\""
Expand Down
2 changes: 2 additions & 0 deletions tools/windows_installer/supertuxkart-github-actions.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down
4 changes: 3 additions & 1 deletion tools/windows_installer/supertuxkart-mingw.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand Down Expand Up @@ -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}$\""
Expand Down

0 comments on commit d0c554b

Please sign in to comment.