+fi
+
+if ! zenity --question $icon_opt --title="NeuroDebian Setup Wizard" \
+--text="The setup procedure requires network access to download packages from the Debian archive. If you do not have network access right now, you can re-start this wizard at any time from the NeuroDebian menu. If you proceed you may have to enter the superuser password with is by default 'neurodebian'.
+
+Do you want to proceed with updating the system?
+"; then
+ exit 0
+fi
+
+# initialize apt
+#
+# update-manager (from update-manager-gnome) and
+# update-software-center (from software-center)
+# are present only in wheezy
+if which update-manager > /dev/null; then update-manager -c; fi
+
+if which update-software-center > /dev/null; then
+ sudo update-software-center --debug 2>&1 | \
+ zenity $icon_opt --title="Updating Software Center Repository" \
+ --progress --pulsate --auto-close --auto-kill;
+else
+ sudo apt-get update 2>&1 | \
+ zenity $icon_opt --title="Running apt-get update" \
+ --progress --pulsate --auto-close --auto-kill;
+fi
+
+popconf=/etc/popularity-contest.conf
+if [ ! -e "$popconf" ] || grep -q -e '^PARTICIPATE.*no' "$popconf" ;
+then
+ zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
+ --text="You will now be given the choice to participate in the package survey. If enabled, a list of installed packages will be anonymously sent to Debian (http://popcon.debian.org). Your participation is important for two reasons:
+
+1) Popular packages receive more attention from developers, bugs are fixed faster and updates are provided quicker.
+2) User statistics can help research software developers to acquire funding for continued development."
+
+ if [ -e "$popconf" ] ; then
+ # just reconfigure so user could get a chance to participate
+ sudo DEBIAN_FRONTEND=gnome dpkg-reconfigure popularity-contest
+ else
+ # install, but do not fail if something goes wrong
+ nd-autoinstall popularity-contest /etc/popularity-contest.conf || true
+ fi
+fi