Archive: Interaction with another installer


Interaction with another installer
hello,
I am creating a setup through which i need to install mysql.it has it's own exe for installation.i am executing that .exe for installation which asks for installation dir etc.now the prob is i want to know where it is installed.so that i could take further action.
Also the Rename and Delete do not really work for me.i have followed the proper syntas given.
thanks in advance
-Vrunda


In what way do rename and delete not work for you? Does IfErrors indicate that the error flag has been set? Do the files not get renamed or deleted? Are you using the correct path? We need more information to help you, please *attach* your script here if it is large, otherwise just paste it into a reply.

I had a look in the registry at my mySQL installation, I found the following useful registry settings that you could try reading after the mySQL installation completes :-

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MySQL Servers and Clients 3.23.52\UninstallString
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySql\ImagePath
The uninstall string contains "C:\WINNT\IsUninst.exe -fC:\ximon\installed\mysql\Uninst.isu" on my system, so I expect on all systems you'd need to strip off the end of the string to get the installation path for mySQL.

The ImagePath is a better place to look *but* that key might be restricted access, I'm not sure. The installing user might need Administrator rights to read that key.

hello
Thanks for your reply.The flow in which i would like my setup work is like:
1)Execute the installation .exe of mysql
2)check where the installation is done,ie the path to the folder.Here as the user could have changed the destination folder,i need to retreive it.
3) for this i've tried searching a particular file,which is usually in the mysql-installation folder and from there get the installation path.by doing something like
SearchPath $1 "filename" (w/o the actual path like c:/ etc)
4)Next is i want to ensure that,as i get the file path,i need to rename a file in that mysql folder for which also i need the full path i guess
5)Now create a shortcut to the tomcat server on desktop which i am installing alongwith the mysql.

sorry for the loong explaination,but it would clear my requirements i suppose

thanks in advance
-Vrunda


This is how you should work, like Sunjammer said:
1) Use ExecWait to start the installer and continue executing the rest of your installer (don't forget to check somehow if the MySQL installer has finished or has been canceled by the user).
2) Check using ReadRegStr (one of) the above (mentioned by sunjammer) registry keys for the install path.
3) Save the retrieved path into a variable,
4) which you use in combination with Rename to rename a file.
5) Use CreateShortCut to create a shortcut.


hello
thanks for the reply
A very basic question here:
How to read the registry key value for the mysql registry.and is there any way to know when the mysql installation is finished?
thanks in advance
-Vrunda


ExecWait will not return until the thing it ran (e.g. the mySQL installer) has finished. This will work in most cases but some programs fork a second process which means NSIS cannot know when it finishes. In that case you'd probably have to check periodically for the presence or otherwise of the mySQL installer window... icky.

The documentation for ReadRegStr will help you. Basically you say something like:-

ReadRegStr $0 HKLM "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySql" "ImagePath"

hello,
thanks for the reply,i am now able to get the installation dir.but one more prob again.
I need to install mysql as a service,for which i need to go to the bin dir of mysql,then give command as "-mysqld...." how do i do this.
if i call cmd.exe directly,it starts from the installation dir.instead i want to go to the mysql\bin and then proceed.
thanks in advance
-Vrunda


To make it start in another directory download the latest version of NSIS and use SetOutPath to set the current directory.

BTW, why are you using cmd.exe?


hello,
I worked around the problem and it's working now :)
thanks for the reply
-Vrunda