// Install will install a service
504701
func Install(plist Plist, wait time.Duration, log Log) error {
	service := NewService(plist.label)
	service.SetLogger(log)
	return service.Install(plist, wait)
}
647343
func (fc *FailureCollector) Install(t *starlark.Thread) {
	t.SetLocal(failSlotKey, fc)
}
1281148
func InstallService(context Context, binPath string, force bool, timeout time.Duration, log Log) error {
	resolvedBinPath, err := chooseBinPath(binPath)
	if err != nil {
		return err
	}
	log.Debug("Using binPath: %s", resolvedBinPath)

	label := DefaultServiceLabel(context.GetRunMode())
	service := launchd.NewService(label)
	plist, err := keybasePlist(context, resolvedBinPath, label, log)
	if err != nil {
		return err
	}
	UninstallKeybaseServices(context, log)
	log.Debug("Installing service (%s, timeout=%s)", label, timeout)
	if _, err := installKeybaseService(context, service, plist, timeout, log); err != nil {
		log.Errorf("Error installing Keybase service: %s", err)
		pid, err := fallbackStartProcessAndWaitForInfo(context, service, plist, context.GetServiceInfoPath(), timeout, log)
		if err != nil {
			return err
		}
		log.Debug("fallback keybase service started, pid=%d", pid)
		return nil
	}
	log.Debug("keybase service installed via launchd successfully")
	return nil
}
520436
func (agent *Agent) install(ctx context.Context) error {
	exe, err := os.Executable()
	if err != nil {
		return err
	}

	substitutions := map[string]string{
		"Agent":          exe,
		"Server":         agent.server,
		"ServiceAccount": agent.serviceAccount,
		"User":           agent.swarmingUser,
	}
	content, err := substituteAsset(ctx, agent.agentAutoStartTemplate, substitutions)
	if err != nil {
		return err
	}
	path, err := substitute(ctx, agent.agentAutoStartPath, substitutions)
	if err != nil {
		return err
	}

	_, err = os.Stat(path)
	if err == nil || os.IsExist(err) {
		bytes, err := ioutil.ReadFile(path)
		if err != nil {
			return err
		}
		if string(bytes) == content {
			logging.Infof(ctx, "Already installed: %s.", path)
			return nil
		}
		logging.Infof(ctx, "Reinstalling: %s.", path)
		if err = agent.strategy.stop(ctx); err != nil {
			return err
		}
	} else {
		logging.Infof(ctx, "Installing: %s.", path)
	}
	if err = ioutil.WriteFile(path, []byte(content), 0644); err != nil {
		return err
	}
	return agent.strategy.start(ctx, path)
}
663230
func Install(scheme *runtime.Scheme) {
	utilruntime.Must(projectapiv1.Install(scheme))
	utilruntime.Must(scheme.SetVersionPriority(projectv1.GroupVersion))
}
413201
func Install(scheme *runtime.Scheme) {
	utilruntime.Must(audit.AddToScheme(scheme))
	utilruntime.Must(v1.AddToScheme(scheme))
	utilruntime.Must(v1beta1.AddToScheme(scheme))
	utilruntime.Must(v1alpha1.AddToScheme(scheme))
	utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion, v1beta1.SchemeGroupVersion, v1alpha1.SchemeGroupVersion))
}
1075663
func Install(scheme *runtime.Scheme) {
	utilruntime.Must(quotaapiv1.Install(scheme))
	utilruntime.Must(scheme.SetVersionPriority(quotav1.GroupVersion))
}
404801
func (i *HTTPInstaller) Install() error {

	pluginData, err := i.getter.Get(i.Source)
	if err != nil {
		return err
	}

	err = i.extractor.Extract(pluginData, i.CacheDir)
	if err != nil {
		return err
	}

	if !isPlugin(i.CacheDir) {
		return ErrMissingMetadata
	}

	src, err := filepath.Abs(i.CacheDir)
	if err != nil {
		return err
	}

	return i.link(src)
}
844628
func Install(src, msgFile string, eventsSupported uint32) error {
	appkey, err := registry.OpenKey(syscall.HKEY_LOCAL_MACHINE, addKeyName)
	if err != nil {
		return err
	}
	defer appkey.Close()
	sk, alreadyExist, err := appkey.CreateSubKey(src)
	if err != nil {
		return err
	}
	defer sk.Close()
	if alreadyExist {
		return errors.New(addKeyName + `\` + src + " registry key already exists")
	}
	err = sk.SetUInt32("CustomSource", 1)
	if err != nil {
		return err
	}
	err = sk.SetString("EventMessageFile", msgFile)
	if err != nil {
		return err
	}
	err = sk.SetUInt32("TypesSupported", eventsSupported)
	if err != nil {
		return err
	}
	return nil
}
169116
func Install(scheme *runtime.Scheme) {
	utilruntime.Must(node.AddToScheme(scheme))
	utilruntime.Must(v1alpha1.AddToScheme(scheme))
	utilruntime.Must(v1beta1.AddToScheme(scheme))
	utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion))
}
853530
func Install(scheme *runtime.Scheme) {
	utilruntime.Must(securityapiv1.Install(scheme))
	utilruntime.Must(scheme.SetVersionPriority(securityv1.GroupVersion))
}
1354052
func (h *Client) install(ctx context.Context, req *rls.InstallReleaseRequest) (*rls.InstallReleaseResponse, error) {
	c, err := h.connect(ctx)
	if err != nil {
		return nil, err
	}
	defer c.Close()

	rlc := rls.NewReleaseServiceClient(c)
	return rlc.InstallRelease(ctx, req)
}
177923
func (m *Messenger) Install(handler messenger.MessageHandler, msg proto.Message) error {
	m.handlers[reflect.TypeOf(msg).Elem().Name()] = handler
	return m.Called().Error(0)
}
1146435
func (m DefaultMetrics) Install(c *mux.PathRecorderMux) {
	register()
	c.Handle("/metrics", prometheus.Handler())
}
76502
func Install(scheme *runtime.Scheme) {
	utilruntime.Must(buildapiv1.Install(scheme))
	utilruntime.Must(scheme.SetVersionPriority(buildv1.GroupVersion))
}
657011
func (linux *systemDRecord) Install(args ...string) (string, error) {
	installAction := "Install " + linux.description + ":"

	if ok, err := checkPrivileges(); !ok {
		return installAction + failed, err
	}

	srvPath := linux.servicePath()

	if linux.isInstalled() {
		return installAction + failed, ErrAlreadyInstalled
	}

	file, err := os.Create(srvPath)
	if err != nil {
		return installAction + failed, err
	}
	defer file.Close()

	execPatch, err := executablePath(linux.name)
	if err != nil {
		return installAction + failed, err
	}

	templ, err := template.New("systemDConfig").Parse(systemDConfig)
	if err != nil {
		return installAction + failed, err
	}

	if err := templ.Execute(
		file,
		&struct {
			Name, Description, Dependencies, Path, Args string
		}{
			linux.name,
			linux.description,
			strings.Join(linux.dependencies, " "),
			execPatch,
			strings.Join(args, " "),
		},
	); err != nil {
		return installAction + failed, err
	}

	if err := exec.Command("systemctl", "daemon-reload").Run(); err != nil {
		return installAction + failed, err
	}

	if err := exec.Command("systemctl", "enable", linux.name+".service").Run(); err != nil {
		return installAction + failed, err
	}

	return installAction + success, nil
}
1151213
func Install(scheme *runtime.Scheme) {
	utilruntime.Must(templateapiv1.Install(scheme))
	utilruntime.Must(scheme.SetVersionPriority(templatev1.GroupVersion))
}