Skip to content

Commit

Permalink
tweak(steam): Remove drm wrapped file after build
Browse files Browse the repository at this point in the history
  • Loading branch information
TwentyPast4 committed Jun 29, 2024
1 parent 3093a37 commit a52b172
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pbpy/pbsteamcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,20 @@ def publish_build(branch_type, steamcmd_exec_path, publish_stagedir, app_script,
drm_command.extend(["+drm_wrap", drm_exe_path, drm_output, "drmtoolp", "0", "+quit"])
pblog.info("Wrapping game with steamworks DRM...")
drm_proc = pbtools.run_with_output(drm_command)
pbtools.remove_file(drm_exe_path) # remove original file in any case
if drm_proc.returncode != 0:
pblog.error("Drm wrapping failed(%d)" % drm_proc.returncode)
if Path.exists(drm_output):
pbtools.remove_file(drm_output)
return False

shutil.move(drm_output, drm_exe_path)
shutil.move(drm_output, drm_exe_path) # move drm-wrapped file to location of original

command.extend(["+run_app_build", script_path, "+quit"])
proc = pbtools.run(command)
result = proc.returncode

if Path.is_file(drm_exe_path):
pbtools.remove_file(drm_exe_path) # remove drm wrapped file, so that a subsequent build will re-build a non-wrapped version

return result

0 comments on commit a52b172

Please sign in to comment.