mysql, long paths and quotes
Hi,
first of all I have to thank whoever made NSIS, I think it's awesome!;)
Second I have some questions, my main use for NSIS is deploying a client/server application with a mysql backend.
I can't really understand why sometimes I have to use single or double quotes or no quotes so I hope someone here can enlighten me.
Here's some code from my script :
Section "";
InitPluginsDir
SetOutPath $PLUGINSDIR
File struct.sql
SetOutPath $INSTDIR
;execute mysql commands
GetFullPathName /SHORT $INSTDIRSHORT $INSTDIR
${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6 ;get local time
StrCpy $TS "$0-$1-$2-$4-$5-$6"
StrCpy $FULLBACKUP "$INSTDIRSHORT\ecoges-fullbackup-$TS.sql"
StrCpy $DATABACKUP "$INSTDIRSHORT\ecoges-databackup-$TS.sql"
StrCpy $MYSQLDUMP "$INSTDIRSHORT\bin\mysqldump.exe"
StrCpy $MYSQLCLIENT "$INSTDIRSHORT\bin\mysql.exe"
StrCpy $STRUCSCRIPT "$PLUGINSDIR\struct.sql"
nsExec::Exec '"$MYSQLDUMP" -r "$FULLBACKUP" ecoges -uroot -p1234 --complete-insert'
nsExec::Exec '"$MYSQLDUMP" -r "$DATABACKUP" ecoges -uroot -p1234 --no-create-info --complete-insert'
DetailPrint "Réinitialisation de la base de données..."
nsExec::Exec 'cmd /C $MYSQLCLIENT -uroot -p1234 ecoges < $STRUCSCRIPT'
DetailPrint "Récupération des données..."
nsExec::Exec 'cmd /C $MYSQLCLIENT -uroot -p1234 ecoges < "$DATABACKUP"'
SectionEnd ; end the section
Why do I have to remove all quotes with $MYSQLCLIENT and $MYSQLDUMP can work with or without them ?
Why do I have to use double quotes when I restore $DATABACKUP but not when I create it with $MYSQLDUMP ?
My code works but I try to make it as clean as possible. I hope I'm not too hard to understand...
Thanks for your help!