Browse Source

strip down

Daniel Sheffield 1 year ago
parent
commit
e1d7e6f7dc
4 changed files with 16 additions and 66 deletions
  1. 1 10
      Dockerfile
  2. 5 17
      docker-compose.yml
  3. 6 39
      start-the-neverhood.sh
  4. 4 0
      the_neverhood.sh

+ 1 - 10
Dockerfile

@@ -1,17 +1,8 @@
 FROM scottyhardy/docker-wine
 ADD the_neverhood_data.tar.xz /home/wineuser/
 ADD .wine-win95.tar.xz /home/wineuser/
-#RUN mkdir /home/wineuser
+COPY the_neverhood.sh /home/wineuser/
 RUN chown -R 0:0 /home/wineuser
-#RUN find /home/wineuser/.wine-win95
-#USER wineuser
-#USER 1010
 ENV WINEPREFIX /home/wineuser/.wine-win95
 ENV WINEARCH win32
-RUN winetricks win95 dsound
-#RUN rm /home/wineuser/.wine-win95/dosdevices/e\:/ && mv /home/wineuser/the_neverhood_data  /home/wineuser/.wine-win95/dosdevices/e\:/
 RUN ln -sf /home/wineuser/the_neverhood_data /home/wineuser/.wine-win95/dosdevices/e\:
-COPY system.reg /home/wineuser/.wine-win95/system.reg
-#RUN winetricks d3dx9_36
-#RUN winetricks sound=pulse
-#RUN winetricks list-all 

+ 5 - 17
docker-compose.yml

@@ -5,31 +5,19 @@ services:
   the-neverhood:
     environment:
       DISPLAY: ":0.0"
-        #PULSE_COOKIE: /tmp/pulseaudio.cookie
-        #PULSE_SERVER: unix:/tmp/pulseaudio.socket
+      WINE_PREFIX: /home/wineuser/.wine-win95
       XDG_RUNTIME_DIR: /run/user/1000
-    image: the-neverhood #scottyhardy/docker-wine:latest
-      #hostname: yottaLbox
+    image: the-neverhood
+    build: .
     working_dir: /home/wineuser/
-    #privileged: yes
     entrypoint:
       - /usr/bin/entrypoint
       - /home/wineuser/the_neverhood.sh
     volumes:
-      #- type: bind
-      #  source: ./wine_prefix
-      #  target: /home/wineuser/.wine-win95
-          #- type: bind
-          #source: ./the_neverhood_data
-          #target: /home/wineuser/the_neverhood
-        #mode: ro
-      - ./the_neverhood.sh:/home/wineuser/the_neverhood.sh
-        #- ./system.reg:/home/wineuser/.wine-win95/system.reg
-          #- ~/.Xauthority:/root/.Xauthority:ro
+      # need to create this manually
       - ${HOME}/.docker-wine.Xkey:/root/.Xkey:ro
       - /etc/localtime:/etc/localtime:ro
       - /tmp/.X11-unix:/tmp/.X11-unix
-        #- /tmp/pulse-cookie:/tmp/pulse-cookie
+      # need to create this manually
       - /tmp/pulse-socket:/tmp/pulse-socket
-        #- ./pulseaudio-client.conf:/etc/pulse/client.conf
 

+ 6 - 39
start-the-neverhood.sh

@@ -1,49 +1,16 @@
 #!/bin/bash
 set -euo pipefail
 set -x
-GAME=the_neverhood
 cleanup(){
     echo "Cleaning up..."
 
     set +euo pipefail
-    docker cp the_neverhood_the-neverhood_1:/home/wineuser/.wine-win95/system.reg $DIR/system.reg
-    #diff -u wine_prefix/system.reg{.old,} >> $DIR/saved_games.patch
-    #diff -u system.reg{.old,} >> $DIR/saved_games.patch
-    #sudo rm -rf wine_prefix
-    #sudo rm -rf the_neverhood_data
-    #sudo rm -f the_neverhood.sh 
+    docker cp the_neverhood_the-neverhood_1:/home/wineuser/.wine-win95/system.reg system.reg
+    diff -u system.reg.original system.reg > gamesaves.reg.patch
 }
-DIR=$(pwd)
-mkdir -p /tmp/${GAME}
-cd /tmp/${GAME}
 trap cleanup INT QUIT EXIT
-#cp $DIR/pulseaudio-client.conf .
-echo "Uncompressing game..."
-#tar xf $DIR/wine_prefix.tar.xz
-#cp $DIR/system.reg system.reg
-
-sudo cp ${DIR}/system.reg $DIR/system.reg.$(date +%Y%m%d-%H%M%S)
-#sudo cp system.reg system.reg.old
-
-# system.reg has the game saves
-# so we patch in our game saves
-# and take a snapshot of current
-# system.reg
-#cp wine_prefix/system.reg $DIR/system.reg.$(date +%Y%m%d-%H%M%S)
-#patch --verbose -p0 < $DIR/saved_games.patch 
-
-#cp system.reg $DIR/system.reg.$(date +%Y%m%d-%H%M%S)
-#patch --verbose -p1 < $DIR/saved_games.patch 
-#cp system.reg{,.old} 
-
-#tar xf $DIR/the_neverhood_data.tar.xz
-cp $DIR/docker-compose.yml .
-#cp $DIR/run.sh .
-sudo cp $DIR/the_neverhood.sh .
-#echo "Setting permissions..."
-#sudo chown -R 1010:1010 wine_prefix
-#sudo chown -R 1010:1010 the_neverhood.sh
-#sudo chown $(id -u):1010 /run/user/$(id -u)/pulse/native
-echo "Starting docker container..."
+xauth list "${DISPLAY}" | head -n1 | awk '{print $3}' > ~/.docker-wine.Xkey
+SNAPSHOT=$(date +%Y%m%d-%H%M%S)
+sudo cp system.reg system.reg.${SNAPSHOT}
+docker cp the_neverhood_the-neverhood_1:/home/wineuser/.wine-win95/system.reg system.reg || true
 docker-compose up
-#./run.sh

+ 4 - 0
the_neverhood.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+wine ~/.wine-win95/drive_c/Program\ Files/DreamWorks\ Interactive/Neverhood/nhc.exe
+echo waiting for wine to save the registry
+sleep 10