老兄,這個問題你有沒有解決呀,現在我也遇到同樣的問題。
我給服務寫了一個注冊的批處理(installutil.bat),單獨執行這個是可以注冊服務的
可放到安裝部署裡去執行,沒有出現任何錯誤,但就是在服務台裡找不到(不成功)
Private Function InstallService(ByVal pathname As String) As Boolean
Try
Dim filename As String = IO.Path.GetDirectoryName(PathName) & "\WindowsService.exe"
If IO.File.Exists(filename) = True Then
Dim path As String = IO.Path.GetDirectoryName(filename)
Shell("C:\Program Files\Bogart\WebPDM Interface\InstallUtil.exe C:\Program Files\Bogart\WebPDM Interface\WindowsService.exe")
MsgBox("ok")
End If
Return True
Catch ex As Exception
Return False
End Try
End Function