Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Environment variable support

Explorer ,
Feb 17, 2011 Feb 17, 2011

Hey there.  I'm wondering if there's support (albeit undocumented) for environment variables (like %WINDIR%, for example).  From previous forum threads it appears support wasn't there previously but I'm really hoping things have changed.

Specifically, here's what I'm trying to accomplish:

var info:NativeProcessStartupInfo = new NativeProcessStartupInfo();

info.executable = File.applicationDirectory.resolvePath(whereisPath);

info.workingDirectory = File.applicationDirectory;

var args:Vector.<String> = new Vector.<String>();

args.push('-r');

args.push('%WINDIR%\\SysWOW64;%WINDIR%\\System32'); // searches in the Windows system paths

args.push('-s'); // succinct output. Prints path only

args.push(exeToFind);

info.arguments = args;

nativeProcess = new NativeProcess();

addListeners();

nativeProcess.start(info);

When I run the executable with the same arguments in CMD, %WINDIR% is correctly interpreted.  However, when run from AIR, it appears that %WINDIR% is never translated.

Thanks for any info...even if it turns out it's just not supported.

Aaron

TOPICS
Performance issues
827
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 23, 2011 Feb 23, 2011

I'd like to echo this one: even running cmd.exe requires WINDIR - I'd love to know how to access it via envvar or constant or something.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 23, 2011 Feb 23, 2011
LATEST

Unfortunately we don't have support for this yet.  There is a feature request for this on our ideas.adobe.com site that I'd like to encourage you guys to vote for.  The only workaround that I know of at this point is to create a separate helper application that can query the environment variables using a native api (e.g. GetEnvironmentVariable()), then pass those back to your AIR app and use them for your target native process.

Chris

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines