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) {
57
57
zipfile . openReadStream ( entry , function ( err , readStream ) {
58
58
if ( err ) throw err ;
59
59
60
- const writeStream = fs . createWriteStream ( join ( binaryDestDir , 'php' ) ) ;
60
+ const binaryPath = join ( binaryDestDir , phpBinaryFilename ) ;
61
+ const writeStream = fs . createWriteStream ( binaryPath ) ;
61
62
62
63
readStream . pipe ( writeStream ) ;
63
64
64
65
writeStream . on ( "close" , function ( ) {
65
- console . log ( 'Copied PHP binary to ' , binaryDestDir ) ;
66
+ console . log ( 'Copied PHP binary to ' , binaryPath ) ;
66
67
67
68
// Add execute permissions
68
- fs . chmod ( join ( binaryDestDir , 'php' ) , 0o755 , ( err ) => {
69
+ fs . chmod ( binaryPath , 0o755 , ( err ) => {
69
70
if ( err ) {
70
71
console . log ( `Error setting permissions: ${ err } ` ) ;
71
72
}
Original file line number Diff line number Diff line change 1
1
import { app } from 'electron'
2
2
import NativePHP from '@nativephp/electron-plugin'
3
+ import path from 'path'
3
4
import 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'
6
5
import certificate from '../../resources/cacert.pem?asset&asarUnpack'
7
6
7
+ const isWin = process . platform === 'win32' ;
8
+
9
+ const phpBinary = path . join ( __dirname , '../../resources' , isWin ? 'php/php.exe' : 'php/php' ) ;
10
+
8
11
/**
9
12
* Turn on the lights for the NativePHP app.
10
13
*/
You can’t perform that action at this time.
0 commit comments