Not able to use Environment Variable during build

Got a problem you cannot solve? Try here.
chintanpatel7
Posts: 21
Joined: Thu Feb 16, 2012 11:02 pm

Not able to use Environment Variable during build

Postby chintanpatel7 » Tue Feb 26, 2013 12:49 am

Hello,

I want to use dynamic path for source files.
For example I want to copy file from path C:\Project source
So I have set Environment Variable SOURCE_PATH to "C:\Project source" and used it in Install file command as per following:

Code: Select all

Install Files %SOURCE_PATH%\test.txt to $TARGETDIR$


As per my thinking it should parse this command as

Code: Select all

Install Files C:\Project source\test.txt to $TARGETDIR$


But when I try to compile or build my project it is giving me following error:
No Files matching pattern "c:\test project\%SOURCE_PATH%\test.txt"


I think this is happening because it it taking relative path to my project folder [i.e. C:\test project].
But it is not parsing value of SOURCE_PATH environment variable.

I am wondering because I have done same in my previous project and it is successfully taking source files from the path described in Environment variable used in it.

Is there anything I am missing? Please help.

Thanks,
Chintan

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Not able to use Environment Variable during build

Postby FrancescoT » Tue Feb 26, 2013 5:05 am

Dear Chintan,

by the error you are receiving, I suppose the environment variable you used it is not correctly defined.

For example, I done the following;

1- Under "Control Panel ->System & Security->System->Advanced system settings->Advanced->Environment variables", I defined MYPATH = c:\mypath under System variables.
2- Restarted the system
3- Finally I used "%MYPATH%\myfile.rtf" with the Source Path parameter of the Install Files command.

... and works!

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

chintanpatel7
Posts: 21
Joined: Thu Feb 16, 2012 11:02 pm

Re: Not able to use Environment Variable during build

Postby chintanpatel7 » Tue Feb 26, 2013 5:31 am

Hi Francesco,

Yes it was my fault. I have set the environment variable, used it properly but DIDN'T RESTART... :oops:

I have restarted the system and now it is working fine... :D

Thanks a lot,
Chintan

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Not able to use Environment Variable during build

Postby FrancescoT » Tue Feb 26, 2013 9:17 am

:D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 89 guests