Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 18th October 2006, 06:45   #1
sunlight112
Senior Member
 
Join Date: Oct 2006
Posts: 129
Unhappy How to detect mysql

Somebody can show me how to detect my sql in OS!!!
Before I set up my application,I must check my sql is installed or not. I has already looked forward to find on Wiki. No help for me!
Thank alot for your help,
sunlight112 is offline   Reply With Quote
Old 18th October 2006, 08:51   #2
CancerFace
Senior Member
 
Join Date: Apr 2006
Posts: 289
Send a message via ICQ to CancerFace
I am looking at the MySQL msi install file and it looks like it is storing information in HKLM\Software\MySQL AB\MySQL Server x.x.

Look for registry values Location (default is $PROGRAMFILES\MySQL\MySQL Server x.x\) and Version (formated as x.x.xx).

For example version 5.0.26 generates the following entries:
PHP Code:
HKLM "Software\\MySQL AB\\MySQL Server 5.0" "Location"
HKLM "Software\\MySQL AB\\MySQL Server 5.0" "Version" 
CF
CancerFace is offline   Reply With Quote
Old 19th October 2006, 04:28   #3
sunlight112
Senior Member
 
Join Date: Oct 2006
Posts: 129
Now I can detect MySQL but I do not know why MessageBox display when I set up my SQL
My code is here:

Section "Check_MySQL"
Call DetectMySQL
SectionEnd

Function DetectMySQL
ClearErrors
ReadRegStr $1 HKLM "Software\MySQL AB\MySQL Server 5.0" "Location"
ReadRegStr $2 HKLM "Software\MySQL AB\MySQL Server 5.0" "Version"

IfErrors 0 NoAbort
MessageBox MB_OK "Couldn't find a MySQL installed.Program will set up MySQL 5.0 now!"
SetOutPath $PLUGINSDIR
File "E:\Server\Script\Enviroment\MySQL\MySQL_5_0.exe"
nsExec::ExecToStack '"$INSTDIR\MySQL_5_0.exe" /s'
Delete "$INSTDIR\MySQL_5_0.exe"
MessageBox MB_OK "My SQL is installed"
NoAbort:
MessageBox MB_OK "Find a MySQL installed. Set up will return the process now."
FunctionEnd

Everything is OK only one line
"MessageBox MB_OK "My SQL is installed" " is not
Before I install MySQL, this announcement appear. I want it to appear the end of the process installing MySQL
Someone can help me!!!!
Thank in advance,
sunlight112 is offline   Reply With Quote
Old 19th October 2006, 08:15   #4
sunlight112
Senior Member
 
Join Date: Oct 2006
Posts: 129
Apologies for replying to self, but I still have one more question. How can we run file sql on batch mode?
I also read about ExecDos and ExecCmd. But i am worry about the user and pass which I must use to access MySQL.
Thank you for your help,
sunlight112 is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump