mer. 18 août 2010, 17h51
OlivierH
atoutfox.public.association
Re: Détecter Word ou OpenOffice
Jean,
UN prg que j'ai pris de chez fox je crois :
l'appel se fait comme cela :
IF oAPPLI.PRESENCE_APP("DOC","WINWORD")
EndiF
*===============================================================
* Procedure test la présence d'un programme
*===============================================================
LPARAMETERS EXTN,APP_NAME
#DEFINE ERROR_SUCCESS 0
#DEFINE C_EXTNOFOUND_LOC "No information available for selectedapplication."
#DEFINE C_NOREGFILE_LOC "The REGISTRY.PRG file needed for this samplecould not be found in \Samples\Classes."
LOCAL cExtn,cAppKey,cAppName,nErrNum,cNewKey
LOCAL oReg,regfile,cVersion
cAppKey = ""
cAppName = ""
IF EMPTY(APP_NAME)
APP_NAME = ""
EndIF
regfile = "registry.prg"
SET PROCEDURE TO (m.regfile) ADDITIVE
oReg = NewObject("FileReg")
* Get Application
nErrNum = oReg.GetAppPath(m.Extn,@cAppKey,@cAppName)
RELEASE PROC (m.regfile)
IF m.nErrNum # ERROR_SUCCESS
*MESSAGEBOX("Le logiciel "+m.cAppName+" n'est pas installé sur votreposte.")
RETURN .F.
ELSE
IF ! APP_NAME $ UPPER(m.cAppName) .And. !EMPTY(APP_NAME)
*MESSAGEBOX("Le logiciel "+APP_NAME+" n'est pas installé sur votreposte.")
RETURN .F.
ELSE
RETURN .T.
EndIF
ENDIF
Olivier
Le 18/08/2010 17:43, Jean à Grenoble a écrit :
> Avant de revenir à mes problèmes philosophique, j'en ai un plus terre à
> terre :
> Il y a t-il un moyen plus rapide de détecter si Word et/ou OpenOffice
> est/sont installés sur un poste autrement qu'en essayant de les
> 'instancier' a l'intérieur d'un TRY CATCH ENDTRY ce qui est très long
> (une bonne dizaine de secondes si OpenOffice n'est pas présent par
> exemple) ?
>
> Merci d'avance pour vos suggestions ...
> Jean à Grenoble
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000003857