昨天重新安裝VisualSVNServer時遇到一些麻煩,今天補記下來。
這台服務器(Windows Server 2003)的硬盤曾經出現過問題,出問題的硬盤恰巧也是VisualSVNServer曾經安裝的硬盤。今天想重新安裝VisualSVNServer,首先要卸載,但是執行UninstallWMISchemaExecute時報告錯誤:不是有效的MOF文件(0x8004401e)。要是重新安裝也會自動卸載,到這個位置也過不去,下載了最新的版本還是同樣的問題。
只好借助網絡,中文搜索沒有得到有效的幫助,再搜索英文的,找到這樣一個博客:http://rolf-engelhard.de/?p=203,說的是同樣的問題,大喜。把它的主要步驟摘錄如下:
The solution
- Disable the WMI service
sc config winmgmt start= disabled (make sure there is a blank between 'start' and 'disabled')
- Stop the WMI service
net stop winmgmt
- Go to %windir%/System32/wbem and rename the repository-folder
cd C:\WINDOWS\System32\wbem rename Repository Repository-old
- Find the *.mof-file in %windir%/System32/wbem which belongs to VisualSVN
In my case the file was named “6E9A2709F6EB23A5E2F059ACD767AD78.mof”. Inside there were multiple occurences of the string “VisualSVN”—which I found by using Notepad++’s search-in-files-funktionality [2]. Note that the Windows search won’t lead to any useable results since Windows doesn’t do a text-search on *.mof-files by default. - Remove the file found in step 4
- Search the registry on occurences of “VisualSVN” and remove every found item
I guess especially the key “Autorecover MOFs” inHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WBEM\CIMOM
was an entry which recreated the faulty *.mof all over again.
- Enabled the WMI service
sr config winmgmt start= auto
- Start the VisualSVN-Installation
按照這個步驟操作,果然可以卸載軟件,確實是個好辦法。不過這里有兩點補充:
- 看到第6步想投點懶,只刪除CIMOM那個鍵中與VisualSVNServer相關的值,不過證明這個不行,所以只好老老實實地從注冊表中刪除所有與VisualSVNServer相關的值;
- 可能是上一步刪除多了,再安裝新版本的時候,到了啟動VisualSVNServer服務那步出錯,無法啟動服務。在控制面板中查了一下,發現是VisualSVNServer的信息有錯誤,在CMD中使用sc delete visualsvnserver命令將整個服務先刪除了,再安裝軟件就OK了。