package main import ( "log" "os" "path/filepath" "github.com/ying32/govcl/vcl" "bj_power_wms/internal/autostart" "bj_power_wms/internal/config" "bj_power_wms/internal/ui" ) const AppName = "spherical_mill_gui" func main() { if exe, err := os.Executable(); err == nil { if dir := filepath.Dir(exe); dir != "" { _ = os.Chdir(dir) } } cfg, err := config.Load("config.json") if err != nil { log.Fatalf("加载配置失败: %v", err) } // 自动创建桌面快捷方式 _ = autostart.CreateDesktopShortcut("千分尺") ui.InitForm(cfg, AppName) vcl.Application.Initialize() vcl.Application.SetMainFormOnTaskBar(true) vcl.Application.CreateForm(&ui.MainFormPtr) vcl.Application.Run() }