Run aria2c.exe without console window

On windows, aria2c.exe always starts with a console window and --daemon=true command line option doesn’t work. The fact is aria2 doesn’t implement daemon mode on win32 environment. There is a simple way to fix this:

  • open aria2\mingw-config file, and add export CXXFLAGS="-g -O2 -mwindows" before configure
test -z "$HOST" && HOST=i686-w64-mingw32
test -z "$PREFIX" && PREFIX=/usr/local/$HOST

export CXXFLAGS="-g -O2 -mwindows"

./configure \
    --host=$HOST \
    --prefix=$PREFIX \
    --without-included-gettext \
    --disable-nls \
    --with-libcares \
    --without-gnutls \
    --without-openssl \
    --with-sqlite3 \
    --without-libxml2 \
    --with-libexpat \
    --with-libz \
    --with-libgmp \
    --with-libssh2 \
    --without-libgcrypt \
    --without-libnettle \
    --with-cppunit-prefix=$PREFIX \
    ARIA2_STATIC=yes \
    CPPFLAGS="-I$PREFIX/include" \
    LDFLAGS="-L$PREFIX/lib" \
    PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
  • Save this file, then recompile. Now aria2c.exe will run as a background process on windows!