Page 1 of 1

Find File

Posted: Wed Jun 20, 2012 7:03 am
by Ton_B
When My setup runs, it has to detect if there is an older version of the software installed on the machine.
This software was "installed" manually, because my new setup is the first time we'll deploy it with a setup.
Therefore, it is not possible to detect a previous installation using a GUID or registry entry.

The only way to detect if there is an installation present is to find some files on the local machine (a server).
These files can be on one of the available local disks on this machine, not just the $SYSTEMDRIVE$

I was looking on the formum, how to find all of the available fixed disk drives, but found only a topic with the same queation, but no answer.
http://www.installaware.com/forums/view ... f=2&t=3604

The question is, how can i find files located somewhere on on of the local disks ?

I am aware that this action can consume a whole lot of time, but i will first search folders wich will be likely be used (our default location)

Thanx

Re: Find File

Posted: Wed Jun 20, 2012 9:10 am
by FrancescoT
Dear Ton,

Good question!

It is not so difficult to do ... but of course requires some coding.

To search for a file you cand use the IA command "Find All Files" (see InstallAware documentation for more detailed infos)

To detect the system logical drives you must execute a call to a specific WIN API function, using "Call Dll Function" IA Command.
Actually with IA is not available a ready to use command for it.
There are several ways to do it, the simplest method is to use the function:

- GetLogicalDriveStrings that returns a string buffer with strings that specify valid drives in the system.

The above WIN API function is exported by Kernel32.dll. More infos are available with MSDN documentation.

Hope this helps you.

Regards