Page 1 of 1
Information about EXE version
Posted: Fri Jan 20, 2023 1:45 am
by Piotr D
Hi,
how can I read from one Xbase application information about version of another Xbase application on the sam folder (another EXE file, compiled with ARC file with VERSION information)?
Piotr
Re: Information about EXE version
Posted: Fri Jan 20, 2023 4:01 pm
by Auge_Ohr
hi,
you need to use Manifest and these Entry in *.ARC File
Code: Select all
VERSION
"CompanyName" = "Yiu-Software"
"LegalCopyright" = "Copyright (c) Yiu-Software"
"ProductName" = "DXE_DualTabView"
"ProductVersion" = "1.90.0355.51"
"FileDescription" = "DXE Rebar,Toolbar,Tabpage,ListView,Statusbar / ot4xb"
"FileVersion" = "0.7.9.03"
"OriginalFilename" = "XCM.EXE"
//
//LANGUAGE = "de"
//
#define MANIFEST_RESID 1
#define MANIFEST 24
USERDEF MANIFEST
MANIFEST_RESID = FILE ".\..\RES\WIN10.MANIFEST"
---
when have a LNK of App you can look under Property which is Last Entry of Popup-Menu ( CTRL + ENTER )
this CODE will open same Property Dialog
Code: Select all
WshShell := CreateObject( "WScript.Shell" )
oShell := CreateObject( "Shell.Application" )
IF NIL <> oShell
oFolder := oShell:NameSpace( cPath )
IF NIL <> oFolder
oItem := oFolder:ParseName( cFile )
cName := oItem:name
WSHShell:AppActivate( cName )
oVerbs := oItem:Verbs()
jMax := oVerbs:Count // last Entry of Menu
oVerb := oVerbs:Item( jMax - 1 )
oVerb:DoIt()
oFolder:destroy()
ENDIF
oShell:destroy()
WshShell:destroy()
ENDIF
// remove activeX
oVerbs := NIL
oFolder := NIL
oShell := NIL
WshShell := NIL
Re: Information about EXE version
Posted: Sun Jan 22, 2023 11:33 pm
by Piotr D
Jimmy,
thanks for your tips. What I need is not only display this information but read into variable, like LoadResource(1,XPP_MOD_EXE,RES_VERSION). I will try
Piotr
Re: Information about EXE version
Posted: Mon Jan 23, 2023 8:53 am
by Auge_Ohr
hi,
try this for Xbase++ (only)
Code: Select all
IF !DllInfo(DllName,DLL_INFO_LOADED)
hDll := DllLoad(DllName,NIL,.T.)
lFlag := .T.
ENDIF
hDll := DllInfo(DllName,DLL_INFO_HANDLE)
fVersion := LoadResource(1,hDll,RES_VERSIONFIXED)
aVersion := LoadResource(1,hDll,RES_VERSION)
cDLLpath := DllInfo( hDll, DLL_INFO_PATHNAME )
? "load from "+cDLLpath
? ""
// Main Information
//
IF LEN(fVersion) > 0
? "Product Version: "+LTRIM(STR(fVersion[RES_PRODVER_MS]))+LTRIM(STR(fVersion[RES_PRODVER_LS]))
? " File Version: "+LTRIM(STR(fVersion[RES_FILEVER_MS]))+LTRIM(STR(fVersion[RES_FILEVER_LS]))
? " File Time: "+LTRIM(STR(fVersion[RES_FILETIME_MS]))+LTRIM(STR(fVersion[RES_FILETIME_LS]))
ELSE
? "Product Version: "+"no Information"
? " File Version: "+"no Information"
? " File Time: "+"no Information"
ENDIF
// Detail Information
//
IF LEN(aVersion) > 0
FOR J := 1 TO LEN(aVersion)
? aVersion[J][RES_VERSION_KEY]+": "+aVersion[J][RES_VERSION_VALUE]
NEXT
ELSE
ENDIF
? ""
// when using DLLload() so DLLUnload now
//
IF lFlag
lFlag := .F.
DllUnload(hDll)
ENDIF
Re: Information about EXE version
Posted: Tue Jan 24, 2023 8:44 am
by Tom
Piotr asked for EXEs. This works for DLLs only.
Re: Information about EXE version
Posted: Tue Jan 24, 2023 11:57 am
by Auge_Ohr
ask ChatGPT
can you tell me how to use GetDetailsOf and Shell.Application to get Property of file ?
1. Create an instance of the Shell.Application object:
Set objShell = CreateObject("Shell.Application")
2. Use the GetDetailsOf method to get the property of a file:
strProperty = objShell.NameSpace("C:\MyFolder").GetDetailsOf("MyFile.txt", 0)
The 0 in the above example is the index of the property you want to get. You can find a list of available properties and their corresponding index numbers here:
https://docs.microsoft.com/en-us/window ... tdetailsof
3. To get the value of the property, use the GetDetailsOf method again:
strValue = objShell.NameSpace("C:\MyFolder").GetDetailsOf("MyFile.txt", strProperty)