From f8354882a76f8d6e76e3954d8d42fd9ab685ad0a Mon Sep 17 00:00:00 2001 From: nkhangg Date: Wed, 28 May 2025 23:35:43 +0700 Subject: [PATCH] update name publisher --- electron-builder.yml | 78 ++++++++++++++++++++++++++------------------ package-lock.json | 4 +-- package.json | 4 +-- src/main/index.ts | 3 +- 4 files changed, 53 insertions(+), 36 deletions(-) diff --git a/electron-builder.yml b/electron-builder.yml index f051116..2eddcb6 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,43 +1,59 @@ appId: com.electron.app productName: New Item + directories: - buildResources: build + buildResources: build + files: - - '!**/.vscode/*' - - '!src/*' - - '!electron.vite.config.{js,ts,mjs,cjs}' - - '!{.eslintcache,eslint.config.mjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}' - - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}' - - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' + - '!**/.vscode/*' + - '!src/*' + - '!electron.vite.config.{js,ts,mjs,cjs}' + - '!{.eslintcache,eslint.config.mjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}' + - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}' + - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' + asarUnpack: - - resources/** + - resources/** + win: - executableName: New-item -nsis: - artifactName: ${name}-${version}-setup.${ext} - shortcutName: ${productName} - uninstallDisplayName: ${productName} - createDesktopShortcut: always + target: portable + executableName: New-item, + publisherName: apactech + +portable: + artifactName: ${name}-${version}.exe + +nsis: # vẫn giữ để dùng nếu muốn cài đặt, nhưng sẽ không tạo nếu chỉ chọn portable + artifactName: ${name}-${version}-setup.${ext} + shortcutName: ${productName} + uninstallDisplayName: ${productName} + createDesktopShortcut: always + mac: - entitlementsInherit: build/entitlements.mac.plist - extendInfo: - - NSCameraUsageDescription: Application requests access to the device's camera. - - NSMicrophoneUsageDescription: Application requests access to the device's microphone. - - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder. - - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder. - notarize: false + entitlementsInherit: build/entitlements.mac.plist + extendInfo: + - NSCameraUsageDescription: Application requests access to the device's camera. + - NSMicrophoneUsageDescription: Application requests access to the device's microphone. + - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder. + - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder. + notarize: false + dmg: - artifactName: ${name}-${version}.${ext} + artifactName: ${name}-${version}.${ext} + linux: - target: - - AppImage - - snap - - deb - maintainer: electronjs.org - category: Utility + target: + - AppImage + - snap + - deb + maintainer: electronjs.org + category: Utility + appImage: - artifactName: ${name}-${version}.${ext} + artifactName: ${name}-${version}.${ext} + npmRebuild: false + publish: - provider: generic - url: https://example.com/auto-updates + provider: generic + url: https://apactech.io/auto-updates diff --git a/package-lock.json b/package-lock.json index a6c76e7..74012ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new-item-app", - "version": "1.0.0", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new-item-app", - "version": "1.0.0", + "version": "1.0.3", "hasInstallScript": true, "dependencies": { "@electron-toolkit/preload": "^3.0.1", diff --git a/package.json b/package.json index 6cd4eae..fde2d26 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "new-item-app", "version": "1.0.3", - "description": "An Electron application with React and TypeScript", + "description": "new item application is active", "main": "./out/main/index.js", - "author": "example.com", + "author": "apactech.io", "homepage": "https://electron-vite.org", "scripts": { "format": "prettier --write .", diff --git a/src/main/index.ts b/src/main/index.ts index b9ffa1a..cd2fb1f 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -8,7 +8,6 @@ import icon from '../../resources/icon.png?asset' let mainWindow: null | BrowserWindow = null let isQuiting = false -const startupFlagFile = path.join(app.getPath('userData'), 'startup-set.flag') function createWindow(): void { // Get Screen width, height @@ -112,6 +111,8 @@ function createTray() { // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. app.whenReady().then(() => { + const startupFlagFile = path.join(app.getPath('userData'), 'startup-set.flag') + if (!fs.existsSync(startupFlagFile)) { app.setLoginItemSettings({ openAtLogin: true,