Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

there is something evil bug when we start a exe which is created by pkg #2009

Closed
introspection3 opened this issue Oct 22, 2023 · 0 comments
Closed

Comments

@introspection3
Copy link

introspection3 commented Oct 22, 2023

What version of pkg are you using?

5.8.1

What version of Node.js are you using?

18.5

What operating system are you using?

windows ,maybe linux too

What CPU architecture are you using?

amd64

What Node versions, OSs and CPU architectures are you building for?

node18-win-arm64

Describe the Bug

when we use some code to start a exe which is created by pkg directly ,it will work well. but
when we do somthing else (unzip) and then start exe,it will not work .please don't wonder my code.

   os.Chdir(currentDir)
p, err := os.StartProcess(binaryName, []string{}, &os.ProcAttr{Dir: currentDir, Files: []*os.File{nil, nil, nil}})
if err != nil {
	log.Info("restartWindowsApp app start failed " + err.Error())
} else {
	log.Info(p.Pid) //have pi,but no process in tasklist
}

Expected Behavior

can work well.

To Reproduce

unzip app.zip and then start app binary.

   os.Chdir(currentDir)
p, err := os.StartProcess(binaryName, []string{}, &os.ProcAttr{Dir: currentDir, Files: []*os.File{nil, nil, nil}})
if err != nil {
	log.Info("restartWindowsApp app start failed " + err.Error())
} else {
	log.Info(p.Pid) //have pid,but no process in windows tasklist
}
@leerob leerob closed this as completed Jan 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants