cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Axwell84
Level 3

Adding files with variable in path

I would like to add a file in my project using a variable in the path but it's not posible to enter a variable in the path.

Let me explain:
-I add a file with the complete path (c:\test.txt)
-I set source path in IA Preference (RES=c:\)
-IA substitutes the path of my added file ($RES$\test.txt)
-I change the source path in IA preference (RES=d:\)
-The path of my added file returns to the initial complete path (c:\test.txt)
-> But I would like it stays ($RES$\test.txt)

Have you any idea?
Labels (1)
0 Kudos

(5) Replies
RamyaVenkatesh
Level 7

Hi,

What exactly are you trying to achieve?

If you want to re-define your source path after moving the resources, then save the project and restart the IA IDE. While opening the project, you will get an error for missing resource under source path and an option to re-define the source path is given.

As long as the resources are available at the specified location on the build machine, the path will get resolved by itself.

Did that help?
0 Kudos
Axwell84
Level 3

I have different clearcase views and I would like to switch easily by only redefining the resource path.
The directories are the same in my views, only the name of the view is different.

For example:
I have a first view on v:
I have a second view on w:
I set the resource path to v: with the RESOURCE value
I add a file test.txt -> it's path is updated with $RESOURCE$\test.txt (for v:\test.txt)
I would like to change my file version by redefining resource path on w: to have w:\test.txt but IA stay on v:\test.txt
0 Kudos
RamyaVenkatesh
Level 7

I don't think this is currently possible. You will have to add those files again and redefine their path. Or you can add the files multiple times from different locations under different action groups and comment the groups not required.
0 Kudos
nosrednayduj
Level 7

I do this all the time -- All my files are referenced in the project file as $BUILD$\blah\blah. I set IA_PATH_BUILD=c:\mysandbox before launching IA. Then on the build machine I set IA_PATH_BUILD=e:\official_build_path in the ant script that calls IA for making the official installers. If I need to switch between sandboxes on the development machine I relaunch IA with new variables, and it sucks in files with different contents from the new directory. (I have a launch-ia.bat script that takes care of this and a couple of other variables.) Maybe I don't understand what clearcase is doing and why this won't work for you.
0 Kudos
greenaj
Level 3

Your source path variables are in %USERPROFILE%\InstallAnywhere\140\Enterprise\preferences\C:\Users\agreen\InstallAnywhere\140\Enterprise\preferences\com.zerog.ia.PathManager.properties

What I have found is that once a source path variable is defined there, e.g. $MY_SOURCE_DIR$, setting IA_PATH_MY_SOURCE_DIR as an environment variable in the command line build DOES NOT CHANGE IT. I have found dealing with file and path variables in InstallAnywhere painful and frustrating. You could script the the changing of the variables in the com.zerog.ia.PathManager.properties file in each command line build. That is ugly.

One approach I have take is to define a source path var e.g. $MY_WINDOWS_SRC$ pointing to something like C:\Development\MyProject\build. Now in this directory you do this
mklink /D libs "C:\Development\MyProject\4.5.6\libs"

The IA project file, foobar.ia_xml references files in C:\Development\MyProject\build\libs. The symlink in Windows Vista or better saves you the heartache. Hopefully you are not stuck building with Windows 2003/XP. If you're using Linux, great! Windows 2008/7 can ease some of the pain when dealing with switch source paths during build. Since you are using ClearCase, I extend my sympathies.
0 Kudos