fix path for system tray

This commit is contained in:
Eva Ho 2023-07-06 14:11:26 -04:00
parent be853117d9
commit 42af2e2f69
7 changed files with 15 additions and 9 deletions

View File

Before

Width:  |  Height:  |  Size: 442 B

After

Width:  |  Height:  |  Size: 442 B

View File

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 889 B

View File

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

View File

Before

Width:  |  Height:  |  Size: 810 B

After

Width:  |  Height:  |  Size: 810 B

View File

@ -18,8 +18,13 @@ const config: ForgeConfig = {
packagerConfig: {
appVersion: process.env.VERSION || packageJson.version,
asar: true,
icon: './images/icon',
extraResource: ['./images/ollama_icon_dark_16x16.png', './images/ollama_icon_bright_16x16.png', '../ollama', '../ggml-metal.metal'],
icon: './assets/icon.icns',
extraResource: [
'../ollama',
'../ggml-metal.metal',
path.join(__dirname, './assets/ollama_icon_dark_16x16@2x.png'),
path.join(__dirname, './assets/ollama_icon_bright_16x16@2x.png')
],
...(process.env.SIGN
? {
osxSign: {

View File

@ -7,12 +7,13 @@ require('@electron/remote/main').initialize()
let tray: Tray | null = null
const createSystemtray = () => {
// const baseURL = path.join(__dirname, 'src')
const resources = process.resourcesPath
const brightModeIconPath = path.join(resources, 'ollama_icon_dark_16x16.png')
const darkModeIconPath = path.join(resources, 'ollama_icon_bright_16x16.png')
// const brightModeIconPath = path.join(__dirname, '..', '..', 'src', 'ollama_icon_dark_16x16.png')
// const darkModeIconPath = path.join(__dirname, '..', '..', 'src', 'ollama_icon_bright_16x16.png')
let brightModeIconPath = path.join(__dirname, '..', '..', 'assets', 'ollama_icon_dark_16x16.png')
let darkModeIconPath = path.join(__dirname, '..', '..', 'assets', 'ollama_icon_bright_16x16.png')
if (app.isPackaged) {
brightModeIconPath = path.join(process.resourcesPath, 'ollama_icon_dark_16x16@2x.png');
darkModeIconPath = path.join(process.resourcesPath, 'ollama_icon_bright_16x16@2x.png');
}
tray = new Tray(brightModeIconPath)
@ -31,7 +32,7 @@ const createSystemtray = () => {
tray.setContextMenu(contextMenu);
tray.setToolTip('Ollama')
})
}
// Handle creating/removing shortcuts on Windows when installing/uninstalling.