From bdae8c280b67c63e6c69332ae66b37e99374392d Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Tue, 11 Jan 2022 12:18:08 +0800 Subject: [PATCH] =?UTF-8?q?ref:=20=E6=94=AF=E6=8C=81win=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/core/app-search/win.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e0477af..3429d12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick", - "version": "2.0.1-beta.14", + "version": "2.0.1-beta.15", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/core/app-search/win.ts b/src/core/app-search/win.ts index 1dd8735..db44d48 100644 --- a/src/core/app-search/win.ts +++ b/src/core/app-search/win.ts @@ -6,8 +6,14 @@ import { shell } from "electron"; // eslint-disable-next-line @typescript-eslint/no-var-requires const fileIcon = require("extract-file-icon"); + const filePath = path.resolve("C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs"); + +const appData = path.join(os.homedir(), "./AppData/Roaming"); + +const startMenu = path.join(appData, "Microsoft\\Windows\\Start Menu\\Programs"); + const fileLists: any = []; const isZhRegex = /[\u4e00-\u9fa5]/; @@ -58,7 +64,10 @@ function fileDisplay(filePath) { } catch(e) { // } - if (!appDetail.target || appDetail.target.toLowerCase().indexOf("unin") >= 0) return; + if (!appDetail.target || appDetail.target.toLowerCase().indexOf("unin") >= 0 || appDetail.args) return; + + // C:/program/cmd.exe => cmd + keyWords.push(path.basename(appDetail.target, ".exe")); if (isZhRegex.test(appName)) { const py = translate(appName); @@ -101,5 +110,6 @@ function fileDisplay(filePath) { export default () => { fileDisplay(filePath); + fileDisplay(startMenu); return fileLists; };