Running miabuild from a script with compiler variables

Got a problem you cannot solve? Try here.
Post Reply
aevanne
Posts: 12
Joined: Thu May 07, 2009 12:39 am

Running miabuild from a script with compiler variables

Post by aevanne »

Hi,

I have been running miabuild from a (python) script successfully. However I have run into an issue: I need to pass the working path thru to IA from the script:

When I call
miabuild myproj.mpr WORKINGPATH=C:\\myPath\\myCode
it works fine.

However when I call
my_path = C:\\myPath\\myCode
miabuild myproj.mpr WORKINGPATH=my_path

it sets the path in the MSIcode to 'my_path'

I see what it's doing, but is there any way around this?

Thanks,
Aevanne.
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post by bokkie »

Aevanne,

I know little about Python but could it work the same way as it would in DOS, where you'd quote the variable like this: %my_path%? Python might have it's own syntax so that a variable can be distinguished from a literal.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
aevanne
Posts: 12
Joined: Thu May 07, 2009 12:39 am

Post by aevanne »

Thanks Peter,

I'm not an expert on either IA or python, but it looks like python vars are 'as is'.

However, you gave me an idea and, for the record, the following works (It may not be a pretty solution tho :) )

tmp1_root = 'C:\\\\tmp1'
os.environ['TMP_TMP1_ROOT'] = tmp1_root

tmp2_root = 'C:\\\\tmp2'
os.environ['TMP_TMP2_ROOT'] = tmp2_root

os.system("""miabuild.exe myproj.mpr /o=out_dir TMP1_ROOT=%TMP_TMP1_ROOT% TMP2_ROOT=%TMP_TMP2_ROOT% """)

os.environ['TMP_TMP1_ROOT'] =''
os.environ['TMP_TMP2_ROOT'] =''
Post Reply