Skip to content
⌘ NSIS Forum Archive

Conditonal Install Directory

3 posts

usmcginn#

Conditonal Install Directory

Hi all! Long time reader, first time poster.

Is there a way to conditionally set the value of $INSTDIR? Let's say that I'm installing into a tomcat directory that I've renamed "C:\tomcat4", however, the person using my installer might have tomcat installed in the default directory "$PROGRAMFILES\Apache Tomcat 4.0". I know that IfFileExists only works inside of sections and functions, so is there any other way to achieve what I'm trying to do?

Thanks!
Joost Verburg#
If the location is saved somewhere, you can set $INSTDIR using StrCpy in .onInit.

If you have used a registry key, use InstallDirRegKey.