running build step with elevated access

I've setup a configuration that builds a Unity project for XboxOne. Problem is, under certain conditions, Unity itself needs to run a command with elevated access: build step > launches Unity.exe > calls makepkg.exe

Usually when making a build manually from inside Unity, I'd get an UAC prompt at that point. When running from TC, I don't get anything, and the command silently fails, returning nothing.

The build agent is currently set to run as a LocalSystem service. I've tried setting up the service to use a user account (with admin privileges): doesn't work any better.
I've tried disabling UAC entirely (as suggested here), doesn't work.

... any ideas?

Comment actions Permalink


Please try to run agent via console, not as service. Does it help?

Comment actions Permalink

I didn't know about console mode, so thanks for that... but I just tried it, same result.

What I did:

  • stop & disable the build agent service
  • reboot for good measure
  • open a command prompt as administrator
  • run agent.bat start
  • run a build against that agent (I only have one anyway)

If I run the same command (copy-pasted from the build step log) in an admin command prompt (same user, same session, same everything), the package works flawlessly!

Comment actions Permalink

Could you please attach screenshot of the build step settings, the build log, all agent logs covering the build, the command you used in the console to run the build and the full console output of the build?

Comment actions Permalink

Thanks for your help!

Here are the build steps:

The forum tells me I can only upload images, so here are the logs:

Seasons_after_Fall_XboxOne_48.log is the build agent's full log

unity build (via TeamCity).log is Unity's log for build step 5 (not included in the agent log because Unity doesn't play nice with the console, doesn't pipe to stdout or something, so it's got a separate log file)

unity build (via command-line).log is the same build step 5, run via this command-line:
"C:\Program Files\Unity 5.2\Editor\Unity.exe" -projectPath "C:\TeamCity Server\buildAgent\work\1c3447956c64a79a\Seasons" -executeMethod -outputDir "C:\Unity Projects\SaF\Build\TeamCity" -buildNumber 13690 -changeset 862eac36e1e9 -target XboxOne -package -batchmode -quit -logFile "C:\TeamCity Server\buildAgent\work\1c3447956c64a79a\unity build.log"

Let me know if you need anything else.

Comment actions Permalink

Any luck with the logs?


Please sign in to leave a comment.