diff --git a/.gitignore b/.gitignore index ea96cb9..54f4817 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ out .DS_Store *.log* electron.vite.config.1716830836044.mjs +.eslintrc.cjs diff --git a/package-lock.json b/package-lock.json index 0e784f5..402a025 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,8 @@ "@electron-toolkit/preload": "^3.0.0", "@electron-toolkit/utils": "^3.0.0", "get-installed-apps": "^1.1.0", + "get-startapps": "^1.0.4", + "node-fetch": "^2.6.1", "serialport": "^12.0.0" }, "devDependencies": { @@ -4282,6 +4284,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-startapps": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/get-startapps/-/get-startapps-1.0.4.tgz", + "integrity": "sha512-xog+hIeyWCVP/9yriROL346qyqHIR0telniu7ukUypH2dE3KFt4xPriRcCkcMnbfpjUCOVWRivrAJRABN1QlWg==", + "deprecated": "This package is no longer maintained", + "os": [ + "win32" + ], + "engines": { + "node": ">=0.12" + } + }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -5233,6 +5247,14 @@ "dev": true, "optional": true }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, "node_modules/node-gyp-build": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", diff --git a/package.json b/package.json index 3684828..efd4dd4 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "@electron-toolkit/preload": "^3.0.0", "@electron-toolkit/utils": "^3.0.0", "get-installed-apps": "^1.1.0", + "get-startapps": "^1.0.4", + "node-fetch": "^2.6.1", "serialport": "^12.0.0" }, "devDependencies": { diff --git a/src/main/index.js b/src/main/index.js index 85ede86..b2241b1 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -3,7 +3,9 @@ import { join } from 'path' import { electronApp, optimizer, is } from '@electron-toolkit/utils' import icon from '../../resources/icon.png?asset' import fs from 'node:fs/promises' -import {getInstalledApps} from 'get-installed-apps' +// import {getInstalledApps} from 'get-installed-apps' +import getapps from 'get-startapps' + import { SerialPort } from 'serialport' import * as logTimestamp from 'log-timestamp' @@ -23,7 +25,12 @@ async function getSerialPorts() { } async function getApps() { - return await getInstalledApps() + // return await getInstalledApps() + let appCollection = await getapps() + let filters = [(a) => a.appid.includes('.exe'), (a) => a.appid.includes('steam')] + console.log(` Total apps ${appCollection.length}`) + // return appCollection.filter((app) => app.appid.includes('.exe')) + return appCollection.filter((app) => filters.some((fn) => fn(app))) } function createWindow() { diff --git a/src/renderer/src/App.vue b/src/renderer/src/App.vue index 41a6f8c..7273cf0 100644 --- a/src/renderer/src/App.vue +++ b/src/renderer/src/App.vue @@ -8,7 +8,7 @@ const movies = ref([]) const apiKey = 'a0eb411ca9c81896004dce1d27a7245b' const configuration = ref('Loading....') const serialPorts = ref('Loading Serial ports.... ') -const insatlledApps = ref({}); +const insatlledApps = ref({}) const ipcHandle = () => window.electron.ipcRenderer.send('ping') // const getConfigFileContents = async () => { @@ -51,7 +51,6 @@ onMounted(() => {
-
{{ configuration }}