Exemple #1
0
func (p *program) Init(env svc.Environment) error {
	if env.IsWindowsService() {
		dir := filepath.Dir(os.Args[0])
		return os.Chdir(dir)
	}
	return nil
}
Exemple #2
0
func (p *program) Init(env svc.Environment) error {
	if env.IsWindowsService() { //判断操作系统
		dir := filepath.Dir(os.Args[0])
		return os.Chdir(dir) //改变当前工作目录到指定的目录中
	}
	return nil
}
Exemple #3
0
func (ed *entranced) Init(env svc.Environment) error {
	if env.IsWindowsService() {
		dir := filepath.Dir(os.Args[0])
		return os.Chdir(dir)
	}
	log.Println("init")
	return nil
}