2 #emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
3 #ex: set sts=4 ts=4 sw=4 et:
9 cfg_dir=/etc/neurodebian/guest/setupwizard_done
10 success_flag=$cfg_dir/setupwizard_done
11 nd_icon=/usr/share/pixmaps/neurodebian.svg
12 icon_opt="--window-icon=$nd_icon"
15 if [ ! -e $success_flag ]; then
19 if [ $first_run -eq 1 ]; then
20 zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
21 --text="Welcome to the NeuroDebian virtual machine!
23 This is the first time you have started this virtual machine. We will now perform a few simple steps to finalize its configuration. This includes upgrading the system to the latest available versions and installing additional software packages upon your request."
26 if ! zenity --question $icon_opt --title="NeuroDebian Setup Wizard" \
27 --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'.
29 Do you want to proceed with updating the system?
36 # update-manager (from update-manager-gnome) and
37 # update-software-center (from software-center)
38 # are present only in wheezy
39 if which update-manager > /dev/null; then update-manager -c; fi
41 if which update-software-center > /dev/null; then
42 sudo update-software-center --debug 2>&1 | \
43 zenity $icon_opt --title="Updating Software Center Repository" \
44 --progress --pulsate --auto-close --auto-kill;
46 sudo apt-get update 2>&1 | \
47 zenity $icon_opt --title="Running apt-get update" \
48 --progress --pulsate --auto-close --auto-kill;
51 popconf=/etc/popularity-contest.conf
52 if [ ! -e "$popconf" ] || grep -q -e '^PARTICIPATE.*no' "$popconf" ;
54 zenity --info $icon_opt --title="NeuroDebian Setup Wizard" \
55 --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:
57 1) Popular packages receive more attention from developers, bugs are fixed faster and updates are provided quicker.
58 2) User statistics can help research software developers to acquire funding for continued development."
60 if [ -e "$popconf" ] ; then
61 # just reconfigure so user could get a chance to participate
62 sudo DEBIAN_FRONTEND=gnome dpkg-reconfigure popularity-contest
64 # install, but do not fail if something goes wrong
65 nd-autoinstall popularity-contest /etc/popularity-contest.conf || true
69 # install custom filter for synaptics
70 if [ $first_run -eq 1 ]; then
71 sudo mkdir -p /root/.synaptic
72 sudo bash -c 'cat << EOT >> /root/.synaptic/filters
73 filter "NeuroDebian" {
85 Origin; "neuro.debian.net"; false;
86 Maintainer; "team@neuro.debian.net"; false;
97 # essential things are done -- let's mark sucess
98 sudo bash -c "mkdir -p $cfg_dir && touch $success_flag"
101 if ! grep -q '/etc/fsl/fsl.sh' $HOME/.profile && \
102 zenity --question $icon_opt --title="FSL/AFNI Environments" \
103 --text="Packages, such as AFNI and FSL, provide large collections of command line tools which are available from their private directories, and require custom environment variables to be set for proper functioning. Usually you need to source /etc/fsl/fsl.sh or /etc/afni/afni.sh in your environments.
105 Do you want to get those files, if available, sourced automatically for your environment?
107 for t in fsl afni cmtk freesurfer; do
109 grep -q -e "$cf" $HOME/.profile || \
110 echo "[ -e \"$cf\" ] && . $cf" >> $HOME/.profile
114 # create symlink to shared folder into homedir
115 # note: -e check would exit 1 if link is broken
116 # ln -f is used for further robustness
117 [ ! -L $HOME/host ] && ln -sf /media/sf_host $HOME/host
119 # Figure out which version of IPython is available
120 ipython_version=$(apt-cache policy ipython 2>/dev/null | sed -ne '/Version table:/ { n;s,^[ \*]*\(.*\) .*,\1,gp}')
121 dpkg --compare-versions $ipython_version lt 0.13.1 && ipython=ipython01x || ipython=ipython,ipython-notebook,ipython-qtconsole
124 # FALSE "PyMVPA" "python-mvpa2,python-mvpa2-doc,python-mvpa2-tutorial-data" \
125 # needs -doc and -tutorial-data package
126 packages=$(zenity --height 450 --list $icon_opt --checklist --column="Install" --column="Description" \
127 --column="Package Name" --print-column=3 --hide-column=3 --hide-header \
128 --separator=' ' --text="Please select any additional component that shall be installed.
130 Please note that this selection will not affect packages already installed
131 on the system. No installed packages will be reinstalled or removed, only
132 additional components will be installed." \
133 FALSE "Emacs" "emacs" \
134 FALSE "Graphics (e.g. GIMP, Inscape)" "gimp,inkscape,svgtune,xzgv,vym" \
135 FALSE "Octave" "qtoctave" \
136 FALSE "OpenOffice.org" "openoffice.org" \
137 FALSE "PyMVPA Tutorial" "$ipython,python-mvpa2,python-mvpa2-doc,python-mvpa2-tutorialdata,spyder" \
138 FALSE "Python: Electrophysiology & Modeling" "python-brian,python-pynn,python-pyentropy,stimfit" \
139 FALSE "Python: Neuroimaging" "$ipython,spyder,nipy-suite,python-mvpa2" \
140 FALSE "Python: Scientific stack" "$ipython,spyder,python-matplotlib,python-pandas,python-sympy,python-statsmodels,python-skimage" \
141 FALSE "R" "r-recommended" \
142 FALSE "TeX Live" "texlive" \
143 FALSE "Adobe Flash browser plugin" "flashplugin-nonfree" \
146 if [ -n "$packages" ]; then
147 for pkgs in $packages; do
148 nd-autoinstall -f -p "${pkgs//,/ }" true
153 zenity --info $icon_opt --text="Wizard has finished."
156 x-www-browser http://neuro.debian.net/vm_welcome.html &