Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run client in background. 在后台运行客户端。 #33

Open
8 tasks done
hirusha-adi opened this issue Dec 16, 2022 · 6 comments
Open
8 tasks done

Run client in background. 在后台运行客户端。 #33

hirusha-adi opened this issue Dec 16, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@hirusha-adi
Copy link

Please make sure of the following things.

  • I have read the documentation.
  • 我已阅读 文档
  • I'm sure there are no duplicate issues.
  • 我确定没有提交和他人重复的issue。
  • I'm sure this feature is not implemented.
  • 我确定该功能尚未实现。
  • I'm sure it's a reasonable and popular requirement.
  • 我确定这个需求合理且符合大多数人需要。

Describe the feature / 需求描述

The console window does not run it background, theres a console opened while the application is open. When that window is closed, the connection is lost

控制台窗口不在后台运行,应用程序打开时会打开一个控制台。 当该窗口关闭时,连接丢失

image

Suggested solution / 实现思路

Ability to run in it background, silently, to be undetectable

能够在其后台运行,静默,不被察觉

Additional information / 附加说明

No response

@hirusha-adi hirusha-adi added the enhancement New feature or request label Dec 16, 2022
@user2039
Copy link

add -ldflags="-Hwindowsgui" while compiling to remove the windows GUI. This will make the program run in the background.

@hirusha-adi
Copy link
Author

Where to include it?

# Now we should build client.
# When you're using unix-like OS, you can use this.
$ mkdir ./built
$ go mod tidy
$ go mod download
$ ./scripts/build.client.sh

this is how i built the client.

@user2039
Copy link

inside of build.client.sh there is statements for compiling for windows just add -Hwindowsgui in the ldflags arguments

@hirusha-adi
Copy link
Author

set GOOS=windows

set GOARCH=arm
go build -ldflags "-s -w -X 'Spark/client/config.COMMIT=%COMMIT%'" -o ./built/windows_arm Spark/client -Hwindowsgui
set GOARCH=386 
go build -ldflags "-s -w -X 'Spark/client/config.COMMIT=%COMMIT%'" -o ./built/windows_i386 Spark/client -Hwindowsgui
set GOARCH=arm64 
go build -ldflags "-s -w -X 'Spark/client/config.COMMIT=%COMMIT%'" -o ./built/windows_arm64 Spark/client -Hwindowsgui
set GOARCH=amd64 
go build -ldflags "-s -w -X 'Spark/client/config.COMMIT=%COMMIT%'" -o ./built/windows_amd64 Spark/client -Hwindowsgui

does this look right?

@user2039
Copy link

user2039 commented Feb 18, 2023

go build -ldflags "-H windowsgui -s -w -X 'Spark/client/config.COMMIT=%COMMIT%'" -o ./built/windows_arm Spark/client

Try add it like this, if that does not work take a look here https://stackoverflow.com/questions/23250505/how-do-i-create-an-executable-from-golang-that-doesnt-open-a-console-window-whe

@iLoadingPwnz
Copy link

Any updates I tried all but in the end it just causes more errors ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants