code: func Run(sOpts *Options, nOpts *natsd.Options) (*StanServer, error) {
  	if dockerized {
  		return RunServerWithOpts(sOpts, nOpts)
  	}
  	run := svc.Run
  	isInteractive, err := svc.IsAnInteractiveSession()
  	if err != nil {
  		return nil, err
  	}
  	if isInteractive {
  		run = debug.Run
  	} else {
  		sysLogInitLock.Lock()
  		// We create a syslog here because we want to capture possible startup
  		// failure message.
  		if sysLog == nil {
  			if sOpts.SyslogName != "" {
  				sysLogName = sOpts.SyslogName
  			}
  			err := eventlog.InstallAsEventCreate(sysLogName, eventlog.Info|eventlog.Error|eventlog.Warning)
  			if err != nil {
  				if !strings.Contains(err.Error(), "registry key already exists") {
  					panic(err)
  				}
  			}
  			sysLog, err = eventlog.Open(sysLogName)
  			if err != nil {
  				panic(fmt.Sprintf("could not open event log: %v", err))
  			}
  		}
  		sysLogInitLock.Unlock()
  	}
  	wrapper := &winServiceWrapper{
  		srvCh: make(chan *StanServer, 1),
  		errCh: make(chan error, 1),
  		sOpts: sOpts,
  		nOpts: nOpts,
  	}
  	go func() {
  		// If no error, we exit here, otherwise, we are getting the
  		// error down below.
  		if err := run(serviceName, wrapper); err == nil {
  			os.Exit(0)
  		}
  	}()
  
  	var srv *StanServer
  	// Wait for server instance to be created
  	select {
  	case err = <-wrapper.errCh:
  	case srv = <-wrapper.srvCh:
  	}
  	return srv, err
  }
docs: // Run starts the NATS Streaming server. This wrapper function allows Windows to add a
  // hook for running NATS Streaming as a service.