private void btnInstall_Click(object sender, EventArgs e) { if (WindowsServiceUtil.IsExist(serviceName)) { WindowsServiceUtil.UninstallService(serviceFilePath); } WindowsServiceUtil.InstallService(serviceFilePath); }