Archive: reading file names


reading file names
Hello

I'm trying to write a script that will check if a third party program is already installed on a machine (e.g j2sdk-1_4_2_04 ) and then compare the version it finds ( if any ) to the version supplied with the installation .

i manged the retrival of the exsiting software but fails in trying to come up on a way to read the name of the jsdk provided with my installation script (the j2sdk provided in my script is added with an * for automating the procedure).

now i need to find how to read the j2sdk file name and compare it to the registry value ( if there is one ) to find out if i need to install the supplied version or just skip and go on with the rest of the install ?


Thanks

m-wise


This is interesting for me too. NSIS help "4.2 Variables" not describes temporary folder for unpacked installation files. Or they use common temp folder $TEMP?. Or may be unpack was done "on fly", in memory? This case it will be difficult to search for file names.


Well you could place the java sdk you include into a directory, so it is the only file in the directory. Then in .OnInit after you Initialize the Plugins folder you could extract that packed directory into it. After that it's just a matter of obtaining the one file name from the $plugins\javasdk directory. There should only be one file in it, therefore, no looping is involved. This also would preserve your wildcard addition of the file names. Store the retrieved name into a variable that you can use later in the install for your comparison. this variable also would help you launch the javasdk file.

Cheers!


See GetDLLVersionLocal.