Archive: Finding the right install directory


Finding the right install directory
Hi,

In my NSIS script, to install a CGI script, I have:

InstallDir "$PROGRAMFILES\Apache Group\Apache\cgi-bin"

However, some users have Apache2 and the directory name is, therefore, different.

Is there any way to first check if the Apache2 directory exists and then install to it, but if no Apache2 directory exists, install to the regular directed (as shown above)?

Thank you

Ken


I don't have apache so I can't check, but most programs have their installation path recorded in the registry. You could read the registry value for apache2 compare it to an empty string and if it is use the default path otherwise copy the read value to $INSTDIR. All of this should be done in the .onInit function.

Vytautas