Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

devenv.exe execute through jenkin's job doesn't work

Tags:

jenkins

devenv

i am trying to execute devenv.exe through windows batch command plugin in Jenkins but it keeps on executing and fails to launch the application.

Console Output :

**In progressConsole Output
Started by user anonymous
Building on master in workspace C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace
[workspace] $ cmd /c call C:\Windows\TEMP\hudson3900292017086958332.bat
C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>set DEVPATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE 
C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>set PATH=D:\app\nazopay\product\11.2.0\dbhome_1\bin;D:\app\nazopay\product\11.2.0\client_1;C:\Program Files (x86)\Integrity\IntegrityClient10\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\cde\tools;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.6.0_23\bin\;C:\Program Files (x86)\Google\Chrome\Application;C:\MingW;C:\PROGRA~2\INTEGR~1\Toolkit\mksnt;%JAVA_HOME%;,;C:\Program Files\Java\jdk1.6.0_23;,;C:\Program Files\Java\jdk1.6.0_23\bin;%CLASS_PATH%;,;C:\Program Files\Java\jdk1.6.0_23\lib;,;C:\Program Files\Java\jdk1.6.0_23\lib;;C:\Program Files (x86)\M**icrosoft Visual Studio 10.0\Common7\IDE 

C:\Program Files (x86)\Jenkins\jobs\TEMP\workspace>devenv.exe
like image 891
user3168989 Avatar asked Feb 06 '14 07:02

user3168989


People also ask

How do I run Devenv exe?

Simply type devenv.exe from the command line. If you get a message like this, then you do not have devenv.exe in your path. >>> 'devenv.exe' is not recognized as an internal or external command, operable program or batch file. >>> To fix this simply run the batch file, vsvars32.

Where is Devenv exe run?

Press windows + r to open run window and then write "regedit" to open your PC registry. Then go to HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Windows -> Currentversion -> App Paths -> devenv.exe.

What does Devenv exe mean?

Devenv lets you set various options for the IDE, build projects, debug projects, and deploy projects from the command line. Use these switches to run the IDE from a script or a . bat file (such as a nightly build script), or to start the IDE in a particular configuration.


2 Answers

You must execute devenv.com.

The devenv.exe always attempts to open GUI, even when commands are given, and it can't. The devenv.com has output directed to standard output and works fine from Jenkins.

You also must pass arguments.

Without arguments both devenv.com and devenv.exe just start the IDE GUI, which is not what you want. The correct command-line is

devenv.com projectname.sln /Build Release /Project projectname

First is path to the solution you want to build. Then the /Build flag is followed by configuration. If you have multiple platforms, you have to pass configuration and platform combination, e.g. Release|Win32. The /Project flag names project to build (including all dependencies). If omitted, it builds all projects selected for build in given configuration.

like image 176
Jan Hudec Avatar answered Sep 19 '22 22:09

Jan Hudec


Why don't you use msbuild?

This would be a good starting point for your windows build script:

call "%VS100COMNTOOLS%\vsvars32.bat"
msbuild projectname.sln /target:Rebuild /l:FileLogger,Microsoft.Build.Engine;logfile=msbuild.log || goto error
goto end
:error
@echo ERROR: Build failed
exit/b 1
:end
exit/b 0

This way you can also capture the output log that you can parse with one of the jenkins plugins. Ofcourse, adjust the VS100COMNTOOLS to your version of MSVS

like image 45
uncletall Avatar answered Sep 16 '22 22:09

uncletall