Running on Linux without confirmation (Travis-CI)

I’m trying to build a “hello world” MonoGame project on Linux, which is straight-forward enough. Getting it to work on Travis-CI, not so much.

My problem is that running ./ asks the user for a confirmation (Y, n) to install. On Travis-CI, there’s no human present to pass in the input.

I don’t see any command-line arguments like --install-without-asking and I couldn’t figure out any way to send a Y to the process.

Is there any way to make this install without prompting the user?

I found this link on Stack Overflow, but it doesn’t seem to work (it’s for MonoGame 3.4, and it references – plus it doesn’t seem to pass anything to

You can see a sample build failure here if you are so inclined.

I solved this with the following work-around:

  • Unpack
  • Replace with a version that doesn’t have the prompt
  • Profit

Here’s what the Travis config file looks like:

language: csharp
solution: MonoGameSample.sln
  # MonoGame 3.6
  - sudo apt-get install gtk-sharp3
  - wget  
  # Extract contents and overwrite to not prompt for input
  # See:
  - chmod +x
  - sudo ./ --noexec --keep --target ./monogame
  - sudo chmod 777 ./monogame/
  - cp Build/ ./monogame
  - cd monogame
  - sudo chmod +x
  - sudo ./
  - cd ..
  - nuget restore
  # NUnit
  - nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner
  - msbuild
  - mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./MonoGameSample.UnitTests/bin/Debug/MonoGameSample.UnitTests.dll

This also includes steps to install NUnit’s runner and run a unit-test DLL.

Build/ is a this version, with the selected lines removed.

I opened an issue (feature request?) about this here.