Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/js/electron-builder.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
},
extraFiles: [
{
from: join(process.env.APP_PATH, 'nativephp', 'extras'),
from: join(process.env.APP_PATH, 'extras'),
to: 'extras',
filter: [
'**/*'
Expand Down
4 changes: 2 additions & 2 deletions resources/js/electron-plugin/src/server/php.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ function getDefaultEnvironmentVariables(secret?: string, apiPort?: number): Envi
NATIVEPHP_VIDEOS_PATH: getPath('videos'),
NATIVEPHP_RECENT_PATH: getPath('recent'),
NATIVEPHP_EXTRAS_PATH: app.isPackaged
? join(app.getAppPath(), 'nativephp', 'extras')
: join(app.getAppPath(), '..', '..', 'extras'),
? join(process.resourcesPath, '..', 'extras')
Copy link
Contributor

@gwleuverink gwleuverink Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original join(app.getAppPath(), 'nativephp', 'extras')
pointed to playground.app/Contents/Resources/app.asar/nativephp/extras

Electron builder automatically the extra files in playground.app/Contents/extras.
Using process.resourcesPath instead points it to the right place

: join(process.env.APP_PATH, 'extras'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I installed the electron package from a symlinked directory.
The original join(app.getAppPath(), '..', '..', 'extras') pointed to a wrong relative path

Using APP_PATH makes this consistent no matter how you structure your dev setup

};

// Only if the server has already started
Expand Down
Loading