0

I am working to automate the install of some software.

It relies on some things like the Java JDK and well lots of things that have manual steps installing and copying things around.

I would like to be able to test if the various packages are installed and if not install or update them.

How likely is it that I can get MSBuild to do this sort of work? If unlikely then where can I look?

Thanks

Loofer
  • 6,841
  • 9
  • 61
  • 102

1 Answers1

1

The answer is Yes. MSBuild can execute any command -- as long as that command does not expect user to be in front of the computer. I know you can do silent JDK install, so you can just execute that command in your MSBuild target.

However a more interesting question is: should you do this? I think that performing machine-wide configuration steps as part of the build is bad practice. For certain things, like deployment of your newly built product for CI cycle it is ok, but for the purpose of the build it will be very inflexible.

What I would recommend in case of JDK: since JDK is big and mostly backwards-compatible, in your build script check if correct version of JDK exists on the machine. If it does not, fail the build and print out instruction in the log how to configure machine. For smaller dependencies, see this SO question.

Community
  • 1
  • 1
seva titov
  • 11,720
  • 2
  • 35
  • 54