win10支持双击打开、window图标

pull/236/head
zhangchenhao 2025-06-05 18:03:04 +08:00
parent 54118e0095
commit f02112602b
4 changed files with 40 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import (
"runtime"
"strconv"
"syscall"
"time"
)
var s = &scheduler.Scheduler{}
@ -29,8 +30,25 @@ var envVars = map[string]string{
func main() {
if len(os.Args) < 2 {
fmt.Println(`请不要直接运行本程序`)
//fmt.Println(`请不要直接运行本程序`)
// start()
if runtime.GOOS == "windows" {
go func() {
time.Sleep(1 * time.Second)
http := "http"
if public.GetSettingIgnoreError("https") == "1" {
http = "https"
}
url := fmt.Sprintf("%s://127.0.0.1:%s%s", http, public.Port, public.Secure)
err := exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
if err != nil {
fmt.Println("无法打开浏览器,请手动访问:", url)
} else {
fmt.Println("正在打开浏览器,请稍候...")
}
}()
mainRun()
}
return
}
env, err := godotenv.Read(envPath)
@ -42,6 +60,26 @@ func main() {
switch cmd {
case "start":
mainRun()
case "help":
fmt.Println(`
ALLinSSL :
start - ALLinSSL
1 - ALLinSSLlinux
2 - ALLinSSL
3 - ALLinSSL
4 -
5 -
6 -
7 -
8 - web
9 - web
10 - web
11 -
12 -
13 -
14 - HTTPS
15 -
`)
case "1":
fmt.Println("Starting ALLinSSL...")
if checkRun() {

BIN
winres/logo.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 KiB

1
winres/main.rc Normal file
View File

@ -0,0 +1 @@
IDI_ICON1 ICON "logo.ico"

BIN
winres/main.syso Normal file

Binary file not shown.