How I Version Products in Unreal Engine

While waiting for this to be added to Unreal I came up with an alternative. This python script will update the version in your DefaultGame.ini.

import configparser

import sys

import argparse

def main(argv): parser = argparse.ArgumentParser() parser.add_argument(‘Workspace’, help=‘The path to the project that you're wanting to use!’) parser.add_argument(‘NewVersion’, help=‘The new version to set for the project.’) args = parser.parse_args()

config_file = args.Workspace + ‘/Config/DefaultGame.ini’

config = configparser.ConfigParser() config.optionxform=str config.read(config_file) config[’/Script/EngineSettings.GeneralProjectSettings’][‘ProjectVersion’] = args.NewVersion

with open(config_file, ‘w’) as configfile: config.write(configfile)

if name == “main”: main(sys.argv[1:])

 

It's not ideal as something like this should be added to UBT, but it doesn't exist (unless that PR gets merged) so this will work for now.

All you have to do is py C:\UEVersion.py %WORKSPACE% 1.0.0.%PLASTICSCM_CHANGESET_ID%.%BUILD_NUMBER% or something similar. This is from my Jenkins project so I can automate changing the version numbers.

 

until next time