Question re pdxinfo buildNumber and sideloaded updates

I know third-party apps can't presently auto-update, but I still want to use buildNumber and playdate.metadata with pdxinfo to track versions of my app (in my own way—not automated) and to allow sideloaded updates.

But the docs warn: "Please do not maintain this value by hand as a mistake may lead to a game update not being recognized. If in doubt, leave it out."

How big a no-no are we talking? Is that warning really aimed at Season 1 devs making apps for first-party distribution? Can I safely disregard that and make use of buildNumber manually with my itchi.io release?

It seems like omitting it would be worse than maintaining it by hand: at least by hand people MIGHT be able to sideload an update if I remember to increment it. (Which I will!) But if I omit it, sideloaded updates will ALWAYS fail (requiring delete-and-start-fresh), won't they?

My intent is to let people re-sideload the same app, without first deleting the old one—and have it properly update without losing their game progress data.

TIA!

1 Like

It's fine. :slight_smile: We recommend incrementing it using a script of some sort when doing a release build to ensure it goes up every release. If you happen to do a release with the same build number it will not be updated automatically via the Games app on users devices.

2 Likes

Thanks. "Automatically" meaning, once they upload the new version to their account on play.date, right?

Yup, that is right. Now I have to write another sentence to get my post greater than 20 characters. :slight_smile:

2 Likes

I made a shell script that automatically backs up the pdxinfo file and increments the buildNumber entry by 1. It can be used in a Nova task or also VSCode etc.

#!/bin/sh

# Path to pdx info to be updated
FILE=./source/pdxinfo

# Path to folder for pdxinfo backup. Also add this folder to you .gitignore file
BAK=./tmp

echo "> Backing up pdxinfo\n"
cp $FILE $BAK

echo "> BACKED UP:"
cat $BAK/pdxinfo
echo "\n"

BUILD=$(cat $FILE | grep buildNumber | tr -dc '0-9')
echo "> CURRENT BUILD: $BUILD"

BUILD=$((BUILD+1))
echo "> NEW BUILD: $BUILD"

echo "> WRITING NEW BUILD NUMBER: $BUILD"
# Make sure you already have a buildNumber=0 (or any number) in your pdxinfo
sed -i '' "s/buildNumber=[0-9]*/buildNumber=$BUILD/g" $FILE
echo "\n"

echo "> UPDATED pdxinfo:"
cat $FILE

I hope this is useful.

greetings,
Mario

9 Likes

I also made a gist for that here -> Update the buildNumber in pdxinfo file of a Playdate project · GitHub

2 Likes

Would there be a way to make that work for the Vscode Lua Template? Someway in Powershell preferably.

I don’t know the VSCode template but I’ll have a look.