Skip to content

Commit

Permalink
fix launch on old wsl versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mjoppich committed Aug 2, 2018
1 parent da8edae commit aa644fd
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
2 changes: 2 additions & 0 deletions doc/build_wsl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ How this is done is explained at the end of this page.

For all recent versions of Windows 10 you can start with step 1.

.. warning:: Some antivirus software (e.g. Kaspersky) disable internet access for unknown/new programs. Make sure bioGUI can access the internet!

Step 1: Activate WSL feature
-----------------------------

Expand Down
9 changes: 5 additions & 4 deletions install_templates/install_samtools.igui
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Dependencies: libncurses5-dev"
if [ ! "$2" = "" ]; then
echo "Installing dependencies"
echo $2 | sudo -S apt-get update
echo $2 | sudo -S apt-get -y install libncurses5-dev
echo $2 | sudo -S apt-get -y install libncurses5-dev zlib1g-dev
else
echo "No sudo password, not installing dependencies"
fi
Expand All @@ -26,9 +26,10 @@ APPBINARYDIR=${PROGDIR}/${PROG}/bin
mkdir -p "$PROGDIR"

#download and unzip
if [ ! -f "$PROGDIR/$PROG.tar.bz2" ]; then
wget https://github.com/samtools/samtools/releases/download/1.3.1/samtools-1.3.1.tar.bz2 -O "$PROGDIR/$PROG.tar.bz2"
fi
#if [ ! -f "$PROGDIR/$PROG.tar.bz2" ]; then
#fi

wget https://github.com/samtools/samtools/releases/download/1.3.1/samtools-1.3.1.tar.bz2 -O "$PROGDIR/$PROG.tar.bz2"


if [ ! -d "$PROGDIR/$PROG" ]; then
Expand Down
2 changes: 1 addition & 1 deletion install_templates/install_wsl_first.igui
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "Dependencies: build-essential dos2unix"
if [ ! "$2" = "" ]; then
echo "Installing dependencies"
echo $2 | sudo -S apt-get update
echo $2 | sudo -S apt-get -y install build-essential dos2unix unzip git cmake
echo $2 | sudo -S apt-get -y install build-essential dos2unix unzip git cmake zlib1g-dev

echo "Enjoy bioGUI!"
else
Expand Down
8 changes: 7 additions & 1 deletion src/app/ProcessLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ bool ProcessLauncher::start()
sProgram = this->getWSLPath();//"C:\\Windows\\sysnative\\bash";
QStringList oProgArgs = ProcessLauncher::stringToArguments(m_sParam.toStdString(), '\"');

oArgs << "--" << m_sProgram;
QString sRunSignal = this->getWSLSuffix();

if (sRunSignal.size() > 0)
{
oArgs << sRunSignal;
}
oArgs << m_sProgram;

for (int i = 0; i < oProgArgs.size(); ++i)
{
Expand Down
15 changes: 15 additions & 0 deletions src/app/ProcessLauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,21 @@ class ProcessLauncher : public QObject

}

QString getWSLSuffix()
{
QString sConfigFilePath = QDir::currentPath() + "/config.ini";

QSettings* pSettings = new QSettings(sConfigFilePath, QSettings::IniFormat);

QStringList allKeys = pSettings->allKeys();
QString sWSLSuffix = pSettings->value("bash/runsignal", "").toString();

delete pSettings;

return sWSLSuffix;

}

bool start();


Expand Down

0 comments on commit aa644fd

Please sign in to comment.