Compiler variables able to use environment variables?

Got a problem you cannot solve? Try here.
Post Reply
jamesish
Posts: 15
Joined: Fri Jun 18, 2010 1:57 pm

Compiler variables able to use environment variables?

Post 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!
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Re: Compiler variables able to use environment variables?

Post 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.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
jamesish
Posts: 15
Joined: Fri Jun 18, 2010 1:57 pm

Re: Compiler variables able to use environment variables?

Post 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!
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Re: Compiler variables able to use environment variables?

Post by MichaelNesmith »

I believe both should work fine :)
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply