Env Var for locating Program Data on Windows?

Hello,
I am attempting to execute deadlinecommand.exe from within a service environment on Windows. Many of the default windows env vars are not set, but I have been able to get other applications such as Shotgun Toolkit up and running within this environment by manually setting environment variables such as %APPDATA%.

When trying to submit a Deadline job, I get this error:

Configuration Error: Could not get the default network root from “Thinkbox\Deadline7\deadline.ini” because it does not exist

I searched the forums and found this post: forums.thinkboxsoftware.com/vie … oot#p60642

which lead me to believe that it was looking for either %ALLUSERSPROFILE% or %ProgramData% in order to locate this file: “C:\ProgramData\Thinkbox\Deadline7\deadline.ini” (which does exist on the system)

I have set both of those ENV Vars, but unfortunately I am still unable to submit the jobs. I am able to submit jobs from this machine while using an interactive cmd.exe shell.

Is there a variable I can set to allow Deadline to find this file? :question:

Thanks for any ideas!

Seth :ugeek:

Hey Seth,

Have you tried setting LOCALAPPDATA (normally C:\Users<username>\AppData\local)? Note that it’s slightly different than APPDATA (which is the ‘Roaming’ folder normally). There’s another deadline.ini file that we check in there, and might be the one actually causing the issue :slight_smile:

Cheers,
Jon

Yep, LOCALAPPDATA was one of the first ones I tried :slight_smile:

The vars I am setting are: :arrow_right:
SystemRoot
APPDATA
LOCALAPPDATA
USERDNSDOMAIN
USERDOMAIN
USERNAME
USERPROFILE
ALLUSERSPROFILE
ProgramData

Any way to peak at the source code to see how deadlinecommand is trying to resolve that path :question:

Thanks again :exclamation: :exclamation:

Hey Seth,

We base these off of .NET calls to the Environment.GetFolderPath function (passing in SpecialFolder.LocalApplicationData, SpecialFolder.CommonApplicationData, etc), which I hoped would then pull from the environment variables – it seems that is not the case though, it might be getting it deeper than that.

Since that seems to return an empty string in the service context, though, you could try to work around this by creating a “Thinkbox\Deadline7” folder in Deadline’s bin folder (which gets set to the current working directory at runtime). This could probably just symlink to C:\ProgramData\Thinkbox\Deadline7, or you could replicate the structure of it there manually.

Cheers,
Jon

This worked, problem solved!

Thanks for the quick response!

Seth
:mrgreen:

No problem, good to hear it worked!

Cheers,
Jon