|
Best of Support |
|
|
Checking Version of GhostFill/Amicus Assembly |
|
Issue
What would be a good way of trying to detect if Amicus Assembly is installed rather than just GhostFill, and is there a way to detect what version of GhostFill we are using?
Solution
Is it Amicus
Assembly or GhostFill?
Simply check whether the AA server is on the server list:
%[IsAmicus = Servers.ServerFromProgID("GFAmicus.Amicus") <> Nothing()]
What version of GhostFill is this?
This is a bit more complicated. We first have to get the full path to GFExplorer.exe:
%[Path = CreateObject("WScript.Shell").RegRead("HKCR\CLSID\{8A80C6A8-856B-436D-9AFB-637010ECC609}\LocalServer32\")]
%[IfTrue(Elements(Path, '"') > 1, Path = Element(2, Path, '"'))]
Note that the path may be in double quotes. Just in case, we remove any quotes in the second FillPoint.
Next, we get the file version of the EXE:
%[Version = CreateObject("Scripting.FileSystemObject").GetFileVersion(Path)]
The version is in the format: Major.Minor.Release.Build. You can easily access each individual element by using the Element() function, for example:
Major: %[Element(1, Version, '.')]
Minor: %[Element(2, Version, '.')]
Release: %[Element(3, Version, '.')]
Build: %[Element(4, Version, '.')]
Peter Ottermann