PDA

View Full Version : Retrieve File Info at runtime



NewsArchive
11-13-2009, 01:59 AM
Hi Friedrich

We've got the Compiler Directive Get File Info but it would also be handy if
we could retrieve data from files we have to look up on the machine the
installation is being run on.

For example, to find out what version of Windows Installer I have to go to
the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Installer
InstallerLocation to find the folder for the MSI.DLL file. Once I have
located that file, I then need to read the Product Version to see whether in
my case 4.5 is installed or not.

Now a workaround I can do for now is create a little clarion function which
can return the file info by passing its path and filename at runtime. But I
think it might be handy to have this option available in SB at runtime as I
wouldnt be surprised if others need to check file versions at runtime.

JAT!<vbg>

--
--
Cheers
Richard

NewsArchive
11-13-2009, 02:00 AM
Hi Richard,

> We've got the Compiler Directive Get File Info but it would also be handy
> if we could retrieve data from files we have to look up on the machine
> the installation is being run on.

What about using the "Get File Info..." function at runtime <g> See
attached screenshot ;-)

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
11-13-2009, 02:00 AM
BTW, the following "Get File Info" options are supported:

- File Version [Resource]
- Product Version [Resource]
- File Type [Resource]
- File Flag [Resource]
- File OS [Resource]
- File Description [Resource]
- Product Name [Resource]
- Internal Name [Resource]
- Original Name [Resource]
- Company Name [Resource]
- File Language [Resource]
- File Size
- File Date
- File Time
- File Date/Time [ISO 8601 Format]
- File Attribute
- File CRC-32
- File Protection Status
- Shortcut Target
- Verify Trust [Code-signature]

Friedrich

NewsArchive
11-13-2009, 02:01 AM
Hi Richard,

> Once I have located that file, I then need to read the Product Version
> to see whether in my case 4.5 is installed or not.

Two quick suggestions:

1. If you compare versions, use the If "Version" condition (see attached
screenshot).

2. There are functions to retrieve the major, minor, build, revision number
out of a "version number" (see screenshot).

Friedrich

NewsArchive
11-13-2009, 02:02 AM
Hi Friedrich

Even easier! For some reason I keep expecting SB to be harder than it is.
<vbg>

Oh well I dont need to implement the attached code.<g>

--
--
Cheers
Richard

NewsArchive
11-13-2009, 02:03 AM
Hi Richard,

> Even easier! For some reason I keep expecting SB to be harder than it is.
> <vbg>

<ROFL>

>
> Oh well I dont need to implement the attached code.<g>
>

That's correct <g>. You don't need to implement that code. It's all
built-in the installer runtime :)

Friedrich