Page 1 of 1

Compiler variables able to use environment variables?

Posted: Fri Jun 18, 2010 2:19 pm
by jamesish
hey folks,

I have an InstallAware 8 project that I have inherited. It has several compiler variables with hard coded paths in there:

foo_foo C:\some\path\a.exe
foo_bar C:\some\path\b.cpp
foo_baz C:\some\path\c.pdf


The section "C:\some\path" is available as a windows environment variable. I tried editing the variables to read:

%var%\a.exe
%var%\b.cpp
%var%\c.pdf


but that didn't seem to be picked up internally by installaware correctly. Is there some way to get the value of an environment variable into the installaware compiler variables?

thanks!

Re: Compiler variables able to use environment variables?

Posted: Fri Jun 18, 2010 4:50 pm
by MichaelNesmith
Great question!

InstallAware does not parse environment variables. We are adding support for relative paths though. I'll also add in a request for environment variable parsing.

I'd suggest you just use compiler variables - you can combine them too. For example, #PROJDIR#\#OTHER_VAR#\hard-coded.path.

Also the Refactor Paths tool can help you change multiple paths used in your project in a single pass.

Re: Compiler variables able to use environment variables?

Posted: Tue Jun 22, 2010 6:53 am
by jamesish
Thanks Michael! So it sounds like you're saying I can define in my compiler variables:

PROJDIR = C:\some\path

and just use #PROJDIR# within the compiler variables everywhere else it's needed, yeah?

Is the definition list order sensitive? Does the PROJDIR definition have to be defined above anywhere else it's used? Such that:

PROJDIR = C:\some\path
FOO = #PROJDIR#\a.exe

will work but:

FOO = #PROJDIR#\a.exe
PROJDIR = C:\some\path

will not work?

Thanks!

Re: Compiler variables able to use environment variables?

Posted: Tue Jun 22, 2010 3:12 pm
by MichaelNesmith
I believe both should work fine :)