Skip to content

Commit

Permalink
Instead of Always Killing Wine Services, Boot Wine Prefix First and l…
Browse files Browse the repository at this point in the history
…ater starts to kill (this fixes sometimes mountmgr not working on latest version)
  • Loading branch information
KreitinnSoftware committed Dec 29, 2024
1 parent 2bf25bb commit 7273f95
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,13 @@ class MainActivity : AppCompatActivity() {
runCommand("pkill -9 wineserver")
runCommand("pkill -9 .exe")
runCommand(getEnv() + "$usrDir/bin/pulseaudio --start --exit-idle=-1")
WineWrapper.wine("wineboot", winePrefix)

var wineRunning = true

lifecycleScope.launch {
while (!enableServices && wineRunning) {
runCommand("pkill -9 services.exe")
runCommand("pkill -9 services.exe", false)
delay(1200)
}
}
Expand Down
12 changes: 9 additions & 3 deletions app/src/main/java/com/micewine/emu/core/ShellLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ object ShellLoader {
}

fun runCommand(cmd: String) {
ShellLoader().runCommand(cmd)
ShellLoader().runCommand(cmd, true)
}

fun runCommand(cmd: String, log: Boolean) {
ShellLoader().runCommand(cmd, log)
}

private class ShellLoader {
Expand Down Expand Up @@ -100,8 +104,10 @@ object ShellLoader {
}.start()
}

fun runCommand(cmd: String) {
Log.v("ShellLoader", "Trying to exec: '$cmd'")
fun runCommand(cmd: String, log: Boolean) {
if (log) {
Log.v("ShellLoader", "Trying to exec: '$cmd'")
}

os?.writeBytes("$cmd\nexit\n")
os?.flush()
Expand Down

0 comments on commit 7273f95

Please sign in to comment.