When vcvarsall.bat executes it sets environment variables, but they only
valid within the command shell in which it is executed and when that shell
terminates the environment variables are gone.
Your python will be creating a command shell each time it
executes vcvarsall.bat and then a process for msbuild which means msbuild
doesn't know about the environmental variables.

You will need to do some work to determine the values of those
environmental settings.
Then you can configure you Jenkins Master, slave or job with the
appropriate environmental settings and launch msbuild as different step.

Or you can then write the Python to set the environment each time it
creates the process for msbuild step based on what you have discovered.

Alternatively you will need to create batch/cmd files that invoke
vcvarsall.bat and before the relevant msbuild step.


On 28 May 2014 16:56, David Aldrich <david.aldr...@emea.nec.com> wrote:

>  Hi
>
>
>
> I have a Jenkins job that builds a Visual Studio project in multiple
> configurations using msbuild.  I currently have multiple build steps in the
> job – one Windows batch command step for each call of msbuild.
>
>
>
> I want to replace these steps with a single Python script, which will be
> easier to configure and that can be put under version control.
>
>
>
> My difficulty is that I don’t know much Python and I am struggling to run
> vcvarsall.bat and msbuild in a single subprocess.
>
>
>
> I know this is more of a Python question than a Jenkins question, but I
> thought that someone here may have faced the same problem and may be able
> to share some code.
>
>
>
> Any help would be appreciated.
>
>
>
> Best regards
>
>
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to