mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 13:53:52 +02:00
start at windows startup
This commit is contained in:
22
VRCX.cs
22
VRCX.cs
@@ -134,5 +134,27 @@ namespace VRCX
|
||||
{
|
||||
return CpuMonitor.CpuUsage;
|
||||
}
|
||||
|
||||
public void SetStartup(bool enabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
var path = Application.ExecutablePath;
|
||||
key.SetValue("VRCX", $"\"{path}\" --startup");
|
||||
}
|
||||
else
|
||||
{
|
||||
key.DeleteValue("VRCX", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5304,12 +5304,16 @@ CefSharp.BindObjectAsync(
|
||||
VRCXStorage.SetBool('isDarkMode', this.isDarkMode);
|
||||
$appDarkStyle.disabled = this.isDarkMode === false;
|
||||
};
|
||||
$app.data.isStartAtWindowsStartup = VRCXStorage.GetBool('VRCX_StartAtWindowsStartup');
|
||||
$app.data.isStartAsMinimizedState = VRCXStorage.GetBool('VRCX_StartAsMinimizedState');
|
||||
$app.data.isCloseToTray = VRCXStorage.GetBool('VRCX_CloseToTray');
|
||||
var saveVRCXWindowOption = function () {
|
||||
VRCXStorage.SetBool('VRCX_StartAtWindowsStartup', this.isStartAtWindowsStartup);
|
||||
VRCXStorage.SetBool('VRCX_StartAsMinimizedState', this.isStartAsMinimizedState);
|
||||
VRCXStorage.SetBool('VRCX_CloseToTray', this.isCloseToTray);
|
||||
VRCX.SetStartup(this.isStartAtWindowsStartup);
|
||||
};
|
||||
$app.watch.isStartAtWindowsStartup = saveVRCXWindowOption;
|
||||
$app.watch.isStartAsMinimizedState = saveVRCXWindowOption;
|
||||
$app.watch.isCloseToTray = saveVRCXWindowOption;
|
||||
|
||||
|
||||
@@ -771,7 +771,7 @@
|
||||
<el-switch v-model="discordActive"></el-switch>
|
||||
</div>
|
||||
<div style="font-size:12px;margin-top:5px">
|
||||
<span style="display:inline-block;min-width:150px">Instance Details</span>
|
||||
<span style="display:inline-block;min-width:150px">Instance details</span>
|
||||
<el-switch v-model="discordInstance"></el-switch>
|
||||
</div>
|
||||
</div>
|
||||
@@ -794,11 +794,15 @@
|
||||
<div style="margin-top:30px">
|
||||
<span style="font-weight:bold">Window</span>
|
||||
<div style="font-size:12px;margin-top:5px">
|
||||
<span style="display:inline-block;min-width:150px">Start as Minimized State</span>
|
||||
<span style="display:inline-block;min-width:150px">Start at Windows startup</span>
|
||||
<el-switch v-model="isStartAtWindowsStartup"></el-switch>
|
||||
</div>
|
||||
<div style="font-size:12px;margin-top:5px">
|
||||
<span style="display:inline-block;min-width:150px">Start as minimized state</span>
|
||||
<el-switch v-model="isStartAsMinimizedState"></el-switch>
|
||||
</div>
|
||||
<div style="font-size:12px;margin-top:5px">
|
||||
<span style="display:inline-block;min-width:150px">Close to Tray</span>
|
||||
<span style="display:inline-block;min-width:150px">Close to tray</span>
|
||||
<el-switch v-model="isCloseToTray"></el-switch>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user