I am compiling my 1st NSIS script, and enjoying the learning curve.
The app has already:
Installs Apache Tomcat 7 using a bundled installer.
ExecWait '"$PLUGINSDIR\apache-tomcat-7.0.19_x64.exe"'
From this separate installer, the user can choose a different location to the default for installing Tomcat.
It is also possible that another Tomcat could already exist on the same machine, and they install a 2nd instance using different port numbers.
I have looked at a few other samples, but they install Tomcat by unzipping the zip version to a specific folder.
I think it is a better approach to run the TC7 exe installer. Will also make life easier when we need to swap it out for a newer version.
So, my Q is: What is the best approach to retaining the path of where they just installed Tomcat, so that I can grab it from the Tomcat installer and use it back in my NSIS script to deploy the WAR files?
I was hoping to find a system variable, but could not see any.
The Tomcat installer writes to HKLM "SOFTWARE\Apache Software Foundation\Tomcat\@VERSION_MAJOR_MINOR@\$TomcatServiceName" "InstallPath"
but since you don't know the value of $TomcatServiceName I think you might have to call EnumRegKey before and after the Tomcat installer has executed and compare the two lists of subkeys...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With