Compare commits
3 Commits
72aa26c880
...
6f9442a02e
| Author | SHA1 | Date |
|---|---|---|
|
|
6f9442a02e | |
|
|
933bed2c81 | |
|
|
f8354882a7 |
|
|
@ -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: nsis
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
@ -20,7 +20,8 @@
|
|||
"axios": "^1.9.0",
|
||||
"electron-updater": "^6.3.9",
|
||||
"moment": "^2.30.1",
|
||||
"pusher-js": "^8.4.0"
|
||||
"pusher-js": "^8.4.0",
|
||||
"windows-shortcuts": "^0.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-toolkit/eslint-config-prettier": "^3.0.0",
|
||||
|
|
@ -10979,6 +10980,12 @@
|
|||
"string-width": "^1.0.2 || 2 || 3 || 4"
|
||||
}
|
||||
},
|
||||
"node_modules/windows-shortcuts": {
|
||||
"version": "0.1.6",
|
||||
"resolved": "https://registry.npmjs.org/windows-shortcuts/-/windows-shortcuts-0.1.6.tgz",
|
||||
"integrity": "sha512-kjkb3Hmmmg7jwnOb+29AOmoEEA1L/JeLsMOYovpLxYpuc+fN0R+pr8sMwep3JFhUZloxyw1XTzq8n3HugXkqBA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/word-wrap": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "new-item-app",
|
||||
"version": "1.0.3",
|
||||
"description": "An Electron application with React and TypeScript",
|
||||
"version": "1.0.5",
|
||||
"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 .",
|
||||
|
|
@ -32,7 +32,8 @@
|
|||
"axios": "^1.9.0",
|
||||
"electron-updater": "^6.3.9",
|
||||
"moment": "^2.30.1",
|
||||
"pusher-js": "^8.4.0"
|
||||
"pusher-js": "^8.4.0",
|
||||
"windows-shortcuts": "^0.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-toolkit/eslint-config-prettier": "^3.0.0",
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import { app, BrowserWindow, globalShortcut, ipcMain, Menu, screen, shell, Tray
|
|||
import fs from 'fs'
|
||||
import path, { join } from 'path'
|
||||
import icon from '../../resources/icon.png?asset'
|
||||
import ws from 'windows-shortcuts'
|
||||
|
||||
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,16 +112,22 @@ function createTray() {
|
|||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
if (!fs.existsSync(startupFlagFile)) {
|
||||
app.setLoginItemSettings({
|
||||
openAtLogin: true,
|
||||
path: process.execPath,
|
||||
args: []
|
||||
// const startupFlagFile = path.join(app.getPath('userData'), 'startup-set.flag')
|
||||
const startupFolder = path.join(
|
||||
app.getPath('appData'),
|
||||
'Microsoft\\Windows\\Start Menu\\Programs\\Startup'
|
||||
)
|
||||
const shortcutPath = path.join(startupFolder, 'New Item.lnk')
|
||||
|
||||
if (!fs.existsSync(shortcutPath)) {
|
||||
ws.create(shortcutPath, {
|
||||
target: process.execPath,
|
||||
workingDir: path.dirname(process.execPath),
|
||||
runStyle: 1,
|
||||
desc: 'Start New Item with Windows',
|
||||
icon: process.execPath
|
||||
})
|
||||
|
||||
fs.writeFileSync(startupFlagFile, 'ok')
|
||||
}
|
||||
|
||||
// Set app user model id for windows
|
||||
electronApp.setAppUserModelId('com.electron')
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const CardItem: React.FC<CardItemProps> = ({ item, hotItem }) => {
|
|||
justifyContent: 'center'
|
||||
}}
|
||||
>
|
||||
{true ? (
|
||||
{hotItem ? (
|
||||
<Box
|
||||
style={{
|
||||
position: 'absolute',
|
||||
|
|
|
|||
Loading…
Reference in New Issue