Commit 8afdfac3 authored by Torsten Simon's avatar Torsten Simon Committed by Quentin “Storm1er” Decaunes
Browse files

fix: #180 Change autostart method to VBS script.

parent c97b33de
Pipeline #394604978 passed with stages
in 23 minutes and 26 seconds
Set WshShell = CreateObject("WScript.Shell" )
scriptdir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
WshShell.Run """" + scriptdir + "\..\..\..\..\Ryzen Controller""", 0
Set WshShell = Nothing
\ No newline at end of file
......@@ -97,15 +97,24 @@ const RyzenControllerSettingsDefinitions: RyzenControllerSettingDefinitionList =
});
// Handle new auto launch system.
const path = `${window
// C:\git\ryzen-controller\dist\win-unpacked\resources\app.asar\..\app.asar.unpacked\
// workaround with vbs, since admin permissions exe is not suitable for autostart
let ryzenControllerPath = window
.require("electron")
.remote.app.getAppPath()}.unpacked\\build\\bin\\auto-start-ryzen-controller.bat`;
.remote.app.getAppPath()
.split("\\");
delete ryzenControllerPath[ryzenControllerPath.length - 1];
ryzenControllerPath = ryzenControllerPath.join("\\");
const autostartVBS = ryzenControllerPath + "app.asar.unpacked\\build\\bin\\Ryzen Controller Autostart.vbs";
try {
window.require("electron").remote.app.setLoginItemSettings({
openAtLogin: toBeEnabled,
path: path,
path: autostartVBS,
});
} catch (error) {
console.error(error);
rej(error);
}
res(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment