Run aria2c.exe without console window

Posted on   |     Views

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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!