From 857d5aaf690532b1631b01b3cc5831c48d246c8b Mon Sep 17 00:00:00 2001
From: David Robert Verelst <dave@dtu.dk>
Date: Thu, 7 Apr 2016 11:05:07 +0200
Subject: [PATCH] add wine-hawc2 auto config script

---
 config-wine-hawc2.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100755 config-wine-hawc2.sh

diff --git a/config-wine-hawc2.sh b/config-wine-hawc2.sh
new file mode 100755
index 0000000..1b70534
--- /dev/null
+++ b/config-wine-hawc2.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+if [$1 == ''] ; then
+    WINEDIR=~/.wine32
+fi
+
+HAWC2EXES=/home/MET/hawc2exe/*
+
+#mv .wine .wine_$(date +%Y%m%d_%H%M%S);
+WINEARCH=win32 WINEPREFIX=$WINEDIR winecfg
+mkdir -p /home/$USER/$WINEDIR/drive_c/bin/
+
+echo "-------- copying HAWC2 executables from/to:"
+echo "$HAWC2EXES"
+echo "$WINEDIR"
+
+cp $HAWC2EXES /home/$USER/$WINEDIR
+
+echo "-------- add $WINEDIR/drive_c/bin/ to wine system PATH"
+
+wine regedit /E tmp.reg "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment"
+sed -i 's/"PATH"="C:\\\\windows\\\\system32;C:\\\\windows"/"PATH"="C:\\\\windows\\\\system32;C:\\\\windows;C:\\\\bin"/g' tmp.reg
+wine regedit ./tmp.reg
+rm ./tmp.reg
+
+echo "-------- See if HAWC2 runs..."
+wine hawc2-123-beta.exe
+
-- 
GitLab