Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lowcode-electron
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
electron
lowcode-electron
Commits
4084c9a8
Commit
4084c9a8
authored
Aug 04, 2023
by
张聪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 解决window打包问题
parent
b78d05dd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
10 deletions
+23
-10
java.exe
baseServer/jre/bin/java.exe
+0
-0
lowcode
front/lowcode
+1
-1
shell.js
src/command/shell.js
+13
-8
process.js
src/sevice/process.js
+9
-1
No files found.
baseServer/jre/bin/java.exe
0 → 100644
View file @
4084c9a8
File added
lowcode
@
8ba75f2d
Subproject commit
e0ff31d4fbb58350c494658c5139eea740c8c376
Subproject commit
8ba75f2df36e055abd97f45f8c56f693c8a4b578
src/command/shell.js
View file @
4084c9a8
...
@@ -4,7 +4,8 @@ const kill = require('kill-port')
...
@@ -4,7 +4,8 @@ const kill = require('kill-port')
const
detect
=
require
(
'detect-port'
);
const
detect
=
require
(
'detect-port'
);
const
{
MESSAGE_TYPE
}
=
require
(
'../enum'
)
const
{
MESSAGE_TYPE
}
=
require
(
'../enum'
)
const
{
getContext
}
=
require
(
'../store/index'
)
const
{
getContext
}
=
require
(
'../store/index'
)
const
{
cwd
}
=
require
(
'../utils'
)
const
{
cwd
,
isMac
}
=
require
(
'../utils'
)
const
log
=
getContext
().
log
const
log
=
getContext
().
log
const
port
=
7012
const
port
=
7012
function
killProcessServer
(
server
,
port
)
{
function
killProcessServer
(
server
,
port
)
{
...
@@ -21,17 +22,21 @@ function javaServer() {
...
@@ -21,17 +22,21 @@ function javaServer() {
const
shellPath
=
path
.
join
(
cwd
(),
'baseServer'
)
const
shellPath
=
path
.
join
(
cwd
(),
'baseServer'
)
log
.
info
(
'正在启动JAVA服务'
)
log
.
info
(
'正在启动JAVA服务'
)
shell
.
cd
(
shellPath
)
shell
.
cd
(
shellPath
)
let
exePath
=
path
.
join
(
'.'
,
'/jre/bin/java'
)
if
(
!
isMac
()){
exePath
=
exePath
+
'.exe'
}
log
.
info
(
shell
.
ls
())
log
.
info
(
shell
.
ls
())
const
child
=
shell
.
exec
(
'./jre/bin/java -jar syc-paas-standalone-biz.jar -spring.config.location=file:./baseServer/config/boostrap.yml &'
,
{
async
:
true
})
// const child = shell.exec('jre/bin/java -jar syc-paas-standalone-biz.jar -spring.config.location=file:./baseServer/config/boostrap.yml &', { async: true })
// const child = shell.exec('.\\jre\\bin\\java.exe -jar syc-paas-standalone-biz.jar -spring.config.location=file:./baseServer/config/boostrap.yml &', { async: true })
const
child
=
shell
.
exec
(
exePath
+
' -jar syc-paas-standalone-biz.jar -spring.config.location=file:./baseServer/config/boostrap.yml &'
,
{
async
:
true
})
let
isStart
=
false
let
isStart
=
false
child
.
stdout
.
on
(
'data'
,
function
(
stdout
)
{
child
.
stdout
.
on
(
'data'
,
function
(
stdout
)
{
log
.
info
(
stdout
)
log
.
info
(
stdout
,
'----'
)
if
(
stdout
.
includes
(
'Started Application in'
)
&&
!
isStart
)
{
if
(
stdout
.
includes
(
'Started Application in'
)
&&
!
isStart
)
{
process
.
parentPort
.
postMessage
({
process
.
send
(
'close'
)
message
:
'成功'
,
start
:
true
,
type
:
MESSAGE_TYPE
.
DEVELOPMENT
})
isStart
=
true
isStart
=
true
}
}
})
})
...
...
src/sevice/process.js
View file @
4084c9a8
...
@@ -5,6 +5,7 @@ const { utilityProcess } = require('electron')
...
@@ -5,6 +5,7 @@ const { utilityProcess } = require('electron')
const
{
MESSAGE_TYPE
}
=
require
(
'../enum'
)
const
{
MESSAGE_TYPE
}
=
require
(
'../enum'
)
const
{
getContext
}
=
require
(
'../store'
)
const
{
getContext
}
=
require
(
'../store'
)
const
utils
=
require
(
'../utils'
)
const
utils
=
require
(
'../utils'
)
const
{
fork
}
=
require
(
'child_process'
)
// 执行进程命令,需使用nodejs启动,否则会不可控
// 执行进程命令,需使用nodejs启动,否则会不可控
class
ProcessActivity
{
class
ProcessActivity
{
...
@@ -23,17 +24,24 @@ class ProcessActivity {
...
@@ -23,17 +24,24 @@ class ProcessActivity {
}
}
batchCommand
(
shellPath
,
args
=
[],
cb
)
{
batchCommand
(
shellPath
,
args
=
[],
cb
)
{
let
forkParam
=
[
shellPath
]
let
forkParam
=
[
shellPath
]
if
(
args
.
length
)
{
if
(
args
.
length
)
{
forkParam
=
[
shellPath
,
args
]
forkParam
=
[
shellPath
,
args
]
}
}
const
child
=
utilityProcess
.
fork
(...
forkParam
)
// const child = utilityProcess.fork(...forkParam)
const
child
=
fork
(...
forkParam
)
child
.
on
(
'message'
,
(
data
)
=>
{
child
.
on
(
'message'
,
(
data
)
=>
{
const
childParam
=
{
data
,
child
}
const
childParam
=
{
data
,
child
}
if
(
args
.
length
||
cb
)
{
if
(
args
.
length
||
cb
)
{
return
this
.
watchGlobalMsg
(
childParam
,
cb
)
return
this
.
watchGlobalMsg
(
childParam
,
cb
)
}
}
this
.
handleDefaultProcessEnd
(
childParam
)
this
.
handleDefaultProcessEnd
(
childParam
)
if
(
data
===
'close'
){
this
.
ctx
.
win
.
close
()
}
})
})
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment