| View previous topic :: View next topic |
| Author |
Message |
Rocko General User

Joined: 04 Nov 2008 Posts: 17
|
Posted: Wed Nov 12, 2008 2:22 am Post subject: Check whether Writer is installed |
|
|
Is there a programmatically way to check whether Writer is installed without loading OO (ie: creating a new Writer doc).
I'm running Windows XP and OO 3.0. |
|
| Back to top |
|
 |
hanya Super User

Joined: 04 May 2005 Posts: 543 Location: Japan
|
Posted: Wed Nov 12, 2008 2:38 am Post subject: |
|
|
Check com.sun.star.text.TextDocument service is registered in the ModuleManager.
| Code: | oModuleManager = CreateUnoService( _
"com.sun.star.frame.ModuleManager" )
If oModuleManager.hasByName( "com.sun.star.text.TextDocument" ) Then
msgbox "Writer component is installed."
End If
|
|
|
| Back to top |
|
 |
Rocko General User

Joined: 04 Nov 2008 Posts: 17
|
Posted: Wed Nov 12, 2008 3:55 am Post subject: |
|
|
| hanya wrote: | Check com.sun.star.text.TextDocument service is registered in the ModuleManager.
| Code: | oModuleManager = CreateUnoService( _
"com.sun.star.frame.ModuleManager" )
If oModuleManager.hasByName( "com.sun.star.text.TextDocument" ) Then
msgbox "Writer component is installed."
End If
|
|
Thanks, but that loads OO. I'm looking for a way to check it without loading the OO binaries because it takes too long. I used this VB version of your code:
| Code: |
Private Function WriterIsInstalled() As Boolean
On Error GoTo ErrorHandler
WriterIsInstalled = False
Dim oServiceManager As Object
Dim oModuleManager As Object
Set oServiceManager = CreateObject("com.sun.star.ServiceManager")
If oServiceManager Is Nothing Then Exit Function
Set oModuleManager = oServiceManager.createInstance("com.sun.star.frame.ModuleManager")
If oModuleManager Is Nothing Then Exit Function
If oModuleManager.hasByName("com.sun.star.text.TextDocument") Then
WriterIsInstalled = True
End If
Exit Function
ErrorHandler:
End Function
|
|
|
| Back to top |
|
 |
woung General User

Joined: 13 Nov 2008 Posts: 7 Location: Germany, Nürnberg
|
Posted: Thu Nov 13, 2008 6:46 am Post subject: In Window-environment: check the registry |
|
|
In context = MS Windows:
check if the following entry exists in the Window's registry:
HKEY_CLASSES_ROOT\CLSID\{82154420-0FBF-11d4-8313-005004526AB4}\LocalServer32
-> default-value should contain the fullname of soffice.exe
.. that's working for OO 2.41, not sure about OO 3.0 _________________ All the best,
W.U. |
|
| Back to top |
|
 |
|