Beispiel #1
0
        public async Task <ServiceStartResult> StartService()
        {
            if (!PrivilegeHelper.IsHelperInstalled())
            {
                Logging.Info("helper is not installed");

                bool installHelperResults = false;

                await Task.Run(() => {
                    installHelperResults = PrivilegeHelper.InstallHelper();
                });

                HelperMethodInstalled(this, new EventArgs());

                if (!installHelperResults)
                {
                    Logging.Info("helper installation failed!");

                    return(new ServiceStartResult(true, "There was an error during installation of the helper. Please try again and contact support if the problem persists."));
                }
            }

            return(new ServiceStartResult(false));
        }