Kropacek, Miroslav wrote: > > I’ve got a little problem: I have to use Windows DDK’s tools as > build.exe for building some older project. The problem is that > build.exe needs to run a script called “setenv.bat” where can be found > a lot of env. settings etc. Normally it works as follows: > > - winddk installer created shortcut in start menu to > ”C:\WINNT\system32\CMD.EXE /k C:\NTDDK\bin\setenv.bat C:\NTDDK free” > > - this runs “improved console” where I change the directory to my project > > ... > > My question is: it’s possible to automate this thing using Nant? I > can’t run setenv.bat and then build.exe separately since I need that > env variables (they are lost if I use two exec tasks). > The obvious thing to do is to just create a .bat script that does both (runs setenv and build), and then invoke the .bat script from NAnt. You could run the setenv.bat script before running NAnt (depending upon how you're invoking NAnt), but that would create more work if you wanted to run NAnt from CruiseControl.Net (for example).
My preference would be to identify the environment variables that are needed, and then pass them explicitly to the <exec> of build.exe using the <environment> element. This will give you better control of the tools that are being used and make it clear which tools are being invoked. Gary ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ NAnt-users mailing list NAnt-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-users