File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -57,15 +57,16 @@ if (phpBinaryPath) {
5757 zipfile . openReadStream ( entry , function ( err , readStream ) {
5858 if ( err ) throw err ;
5959
60- const writeStream = fs . createWriteStream ( join ( binaryDestDir , 'php' ) ) ;
60+ const binaryPath = join ( binaryDestDir , phpBinaryFilename ) ;
61+ const writeStream = fs . createWriteStream ( binaryPath ) ;
6162
6263 readStream . pipe ( writeStream ) ;
6364
6465 writeStream . on ( "close" , function ( ) {
65- console . log ( 'Copied PHP binary to ' , binaryDestDir ) ;
66+ console . log ( 'Copied PHP binary to ' , binaryPath ) ;
6667
6768 // Add execute permissions
68- fs . chmod ( join ( binaryDestDir , 'php' ) , 0o755 , ( err ) => {
69+ fs . chmod ( binaryPath , 0o755 , ( err ) => {
6970 if ( err ) {
7071 console . log ( `Error setting permissions: ${ err } ` ) ;
7172 }
Original file line number Diff line number Diff line change 11import { app } from 'electron'
22import NativePHP from '@nativephp/electron-plugin'
3+ import path from 'path'
34import defaultIcon from '../../resources/icon.png?asset&asarUnpack'
4- // We can use `php` on all platforms because on Windows we copy the php.exe to `php` in electron-builder.js
5- import phpBinary from '../../resources/php/php?asset&asarUnpack'
65import certificate from '../../resources/cacert.pem?asset&asarUnpack'
76
7+ const isWin = process . platform === 'win32' ;
8+
9+ const phpBinary = path . join ( __dirname , '../../resources' , isWin ? 'php/php.exe' : 'php/php' ) ;
10+
811/**
912 * Turn on the lights for the NativePHP app.
1013 */
You can’t perform that action at this time.
0 commit comments