mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 06:46:04 +02:00
feat: kill install process after exiting game (#864)
* feat: kill install process after exiting game * Restore en.json * fix some key incorrect * gui: update for VRChat OSC Fix * fix: may incorrectly kill unrelated processes * fix: pattern incorrect
This commit is contained in:
@@ -54,6 +54,29 @@ namespace VRCX
|
|||||||
return processes.Length;
|
return processes.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Kills the install.exe process after exiting game.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Whether the process is killed (true or false).</returns>
|
||||||
|
public bool KillInstall()
|
||||||
|
{
|
||||||
|
bool isSuccess = false;
|
||||||
|
var processes = Process.GetProcessesByName("install");
|
||||||
|
foreach (var p in processes)
|
||||||
|
{
|
||||||
|
// "E:\SteamLibrary\steamapps\common\VRChat\install.exe"
|
||||||
|
var match = Regex.Match(p.MainModule.FileName, "(.+?\\\\VRChat.*)(!?\\\\install.exe)");
|
||||||
|
if (match.Success)
|
||||||
|
{
|
||||||
|
p.Kill();
|
||||||
|
isSuccess = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return isSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Starts the VRChat game process with the specified command-line arguments.
|
/// Starts the VRChat game process with the specified command-line arguments.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
+23
-1
@@ -11246,9 +11246,10 @@ speechSynthesis.getVoices();
|
|||||||
database.addGamelogEventToDatabase(entry);
|
database.addGamelogEventToDatabase(entry);
|
||||||
break;
|
break;
|
||||||
case 'vrc-quit':
|
case 'vrc-quit':
|
||||||
if (!this.vrcQuitFix || !this.isGameRunning) {
|
if (!this.isGameRunning) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (this.vrcQuitFix) {
|
||||||
var bias = Date.parse(gameLog.dt) + 3000;
|
var bias = Date.parse(gameLog.dt) + 3000;
|
||||||
if (bias < Date.now()) {
|
if (bias < Date.now()) {
|
||||||
console.log('QuitFix: Bias too low, not killing VRC');
|
console.log('QuitFix: Bias too low, not killing VRC');
|
||||||
@@ -11267,6 +11268,22 @@ speechSynthesis.getVoices();
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
if (this.vrcOSCFix) {
|
||||||
|
setTimeout(() => {
|
||||||
|
AppApi.KillInstall().then((processKilled) => {
|
||||||
|
if (processKilled) {
|
||||||
|
console.log(
|
||||||
|
'OSCFix: Killed Install.exe'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
'OSCFix: Nothing to kill, no Install.exe process running'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'openvr-init':
|
case 'openvr-init':
|
||||||
this.isGameNoVR = false;
|
this.isGameNoVR = false;
|
||||||
@@ -15394,6 +15411,10 @@ speechSynthesis.getVoices();
|
|||||||
'VRCX_vrcQuitFix',
|
'VRCX_vrcQuitFix',
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
$app.data.vrcOSCFix = await configRepository.getBool(
|
||||||
|
'VRCX_vrcOSCFix',
|
||||||
|
true
|
||||||
|
);
|
||||||
$app.data.vrBackgroundEnabled = await configRepository.getBool(
|
$app.data.vrBackgroundEnabled = await configRepository.getBool(
|
||||||
'VRCX_vrBackgroundEnabled',
|
'VRCX_vrBackgroundEnabled',
|
||||||
false
|
false
|
||||||
@@ -15573,6 +15594,7 @@ speechSynthesis.getVoices();
|
|||||||
this.relaunchVRChatAfterCrash
|
this.relaunchVRChatAfterCrash
|
||||||
);
|
);
|
||||||
await configRepository.setBool('VRCX_vrcQuitFix', this.vrcQuitFix);
|
await configRepository.setBool('VRCX_vrcQuitFix', this.vrcQuitFix);
|
||||||
|
await configRepository.setBool('VRCX_vrcOSCFix', this.vrcOSCFix);
|
||||||
await configRepository.setBool(
|
await configRepository.setBool(
|
||||||
'VRCX_vrBackgroundEnabled',
|
'VRCX_vrBackgroundEnabled',
|
||||||
this.vrBackgroundEnabled
|
this.vrBackgroundEnabled
|
||||||
|
|||||||
@@ -424,6 +424,10 @@
|
|||||||
"header": "VRChat Quit Fix",
|
"header": "VRChat Quit Fix",
|
||||||
"description": "Kill VRChat after exiting game"
|
"description": "Kill VRChat after exiting game"
|
||||||
},
|
},
|
||||||
|
"vrchat_osc_fix": {
|
||||||
|
"header": "VRChat OSC Fix",
|
||||||
|
"description": "Kill install process after exiting game"
|
||||||
|
},
|
||||||
"auto_cache_management": {
|
"auto_cache_management": {
|
||||||
"header": "Automatically Manage Cache When Closing VRChat",
|
"header": "Automatically Manage Cache When Closing VRChat",
|
||||||
"description": "Auto delete old versions from cache"
|
"description": "Auto delete old versions from cache"
|
||||||
|
|||||||
@@ -443,6 +443,11 @@ mixin settingsTab()
|
|||||||
div.options-container-item
|
div.options-container-item
|
||||||
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.vrchat_quit_fix.description') }}
|
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.vrchat_quit_fix.description') }}
|
||||||
el-switch(v-model="vrcQuitFix" @change="saveOpenVROption")
|
el-switch(v-model="vrcQuitFix" @change="saveOpenVROption")
|
||||||
|
//- Advanced | VRChat OSC Fix
|
||||||
|
span.sub-header {{ $t('view.settings.advanced.advanced.vrchat_osc_fix.header') }}
|
||||||
|
div.options-container-item
|
||||||
|
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.vrchat_osc_fix.description') }}
|
||||||
|
el-switch(v-model="vrcOSCFix" @change="saveOpenVROption")
|
||||||
//- Advanced | Auto Cache Management
|
//- Advanced | Auto Cache Management
|
||||||
span.sub-header {{ $t('view.settings.advanced.advanced.auto_cache_management.header') }}
|
span.sub-header {{ $t('view.settings.advanced.advanced.auto_cache_management.header') }}
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
|
|||||||
Reference in New Issue
Block a user