我們在C#中的Visual Studio 2008中編寫了一些安裝項目,該安裝項目使用ServiceInstaller類安裝和卸載服務。
當我安裝服務,這沒有得到太多的時間,但是當我用下面的代碼卸載過程中爲每個服務得到幾秒鐘(我們有許多服務):.NET ServiceInstaller獲得太多時間用於卸載服務
ServiceInstaller si = new ServiceInstaler();
string path = string.Format("/assemblypath={0}", strServiceExecutablePath);
string[] cmdline = { path };
InstallContext context = new InstallContext(string.Empty, cmdline);
si.Context = context;
si.ServiceName = strServiceName;
si.Uninstall(null);
有些人知道爲什麼?
這裏我想問一些相關的問題。
的工作之間有什麼區別:
InstallUtill /u exePath
當卸載服務 和:
sc delete serviceName
爲什麼當我從CURRENTCONTROLSET刪除註冊表中的某些記錄\服務我仍然看到在服務的服務。 msc但與:
<Failed to read description. Error code:2
在描述中?
從哪裏我需要手動刪除服務刪除它complitely?
謝謝你的提前。
謝謝您的重播。我閱讀了鏈接的論壇帖子,我發現這不是我的情況。有問題就像我看到,GPO不下載文件,但我的問題是,在我從註冊表中刪除密鑰後,services.msc仍然記住其他地方的記錄(可能在某個隱藏文件中必須由sfc檢查),所以我的問題是:Windows在哪裏存儲有關服務的信息? – rodnower 2010-04-17 17:53:11