2.6 PostProcessBuildPlayer

So I can’t get my postprocess script to do anything anymore, can someone confirm this still works in 2.6.
And specifically does anyone know if this

my $installPath = $ARGV[0];

Returns the new install path, nothing I copy there ever seems to turn up.

Our build process still works in 2.6 (although Windows path stuff has changed, check the release notes for more info).

I saw that the data path has changed to {exe}_data but I’m not even getting that deep I’m just trying to copy straight into the install directory where the exe goes.
The problem is that the print statements and error trapping in the perl script don’t seem to end up anyway (like the console) so I can’t tell where anything is getting set to.

Ok so if I put the full path in manually the files copy, so something must have changed with

my $installPath = $ARGV[0];

hmmmm

Ahhh so after much hoop jumping (and in the process getting the whole PostprocessBuildScript thing to work as a python script yahhh) it seems this path is now the exe file itself not the directory it’s in, so I have to go up a level.

How i can to change Icon when build standalone window ?

go to Edit->Project Settings->Player and add 3 images to the Icons array at 128, 48 and 32 pixels square.

Probably I am super-dumb, but how do you use it on Windows?
I can’t make it work… :frowning:

Do you see a “0” next to the words Icons, change that to 3 and then drag ‘n’ drop your images into the 3 image slots that appear

monark, I don’t understand how to use PostProcessBuildPlayer on Windows :frowning: .

Changing icons is rather intuitive. Thanks! :slight_smile:

I haven’t used it on windows, on the mac you need to write a perl script, or other commandline programme (like python), but not required for changing icons it’s just for sticking other stuff in the build folder e.g help files.

Yes, I am aware that it is not for changing icons.

I’d like to copy some stuff (an xml config and a folder with music) to the build folder.

And I don’t know how.

Can anyone be so generous to show an example for doing this on Windows?

Thanks :roll: .

There’s no particular difference between the Mac and Windows with this - see the doc page for details and an example Perl script.

This is the python I script I ended up with if that helps you. Just make sure python is installed and the script is in your Assets/Editor folder

Not sure if anything will need changing for windows.

#!/usr/local/bin/python

#chmod a+x PostprocessBuildPlayer

import os, sys, shutil

exepath = sys.argv[1]
target = sys.argv[2]

installpath = os.path.split(exepath)[0].strip()
exename = os.path.splitext(os.path.split(exepath)[1])[0].strip()

logFile = open(os.path.join(installpath, 'log.txt'), 'w')

logFile.write(installpath + '\n')
logFile.write(target + '\n')

helptobecopied = "./Assets/Help/help.html";
lictobecopied = "./Assets/Help/license.txt";
icontobecopied = "./Assets/Images/Icon.ico";
readmetobecopied = "./Assets/Windows Installer/README.txt";
NSItobecopied = "./Assets/Windows Installer/viewer.nsi";

if (target == "standaloneWin32"):
	copyFiles = [lictobecopied, icontobecopied, readmetobecopied, NSItobecopied]
	
	for inFile in copyFiles:
		outFile = os.path.join(installpath, os.path.split(inFile)[1])
		try:
			shutil.copyfile(inFile, outFile)
		except:
			logFile.write("Failed to copy " + inFile + "\n")
			
	
	copyFiles = [helptobecopied]
	
	try:
		os.makedirs(os.path.join(installpath, exename + '_Data', 'help'))
	except:
		logFile.write("Failed to make help folder" + os.path.join(installpath, exename + '_Data', 'help') + "\n")
	
	for inFile in copyFiles:
		outFile = os.path.join(installpath, exename + '_Data', 'help', os.path.split(inFile)[1])
		try:
			shutil.copyfile(inFile, outFile)
		except:
			logFile.write("Failed to copy " + inFile + "\n")


elif (target == "standaloneOSXUniversal"):
	copyFiles = [helptobecopied]
	
	try:
		os.makedirs(os.path.join(installpath, 'help'))
	except:
		logFile.write("Failed to make help folder" + os.path.join(installpath, 'help') + "\n")
		
	for inFile in copyFiles:
		outFile = os.path.join(installpath, 'help', os.path.split(inFile)[1])
		try:
			shutil.copyfile(inFile, outFile)
		except:
			logFile.write("Failed to copy " + inFile + "\n")

monark, THANK YOU! :smile:

Btw, this topic is presented quite uninformative in the docs from my point of view.

If UT includes a python example for this into the manual - I think it’s going to help Windows users a lot…

It is sad that Unity won’t launch .exe file named PostprocessBuildPlayer in Editor folder… It would be a bit more convenient to postprocess projects without ahving to install python on Windows :slight_smile:

Bug report 336626