Problem with spaces in nsExec
Hi, I've read through all the posts/archives/examples/etc. but I can't seem to get my script working. I'm trying to do the following: the user presses a "Create Database" button and the installer runs mysql.exe, gives it a .sql file and builds the database.
My problem is that the default selection for the MySQL 4.3.10 installer are to a) not add the mysql.exe location to PATH and b) install MySQL to c:\program files\mysql\mysql server 4.1\
I can get this to work if the PATH is set, or if it's installed to somewhere without a space in the path (like c:\mysql) but if the above two conditions are both true then my script fails. Here is the relevant code:
nsExec::ExecToStack 'cmd /C "$mysql_path\mysql.exe" -uroot < "$PLUGINSDIR\create_lms_db.sql"'
where:
$mysql_path = C:\Program Files\MySQL\MySQL Server 4.1\bin
This returns:
'C:\Program' is not recognized as an internal command, operable program or batch file.
Other variations I've tried are:
ExecWait '"$mysql_path\mysql.exe" -uroot < "$PLUGINSDIR\create_lms_db.sql"'
nsExec::ExecToStack '"$mysql_path\mysql.exe" -uroot < "$PLUGINSDIR\create_lms_db.sql"'
For the above two, and basically all other variations, it seems like mysql.exe is getting called but it doesn't understand its input. The output of the mysql.exe command is what you get when you run "mysql.exe -?" (not any sort of file not found error -- like when running "mysql < asdf.asdf" -- or unknown option -- like when running "mysql -asdf").
Here's what I get:
C:\Program Files\mysql\MySQL Server 4.1\bin\mysql.exe Ver 14.7 Distrib 4.1.9, for Win95/Win98 (i32)
Copyright (C) 2002 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license
Usage: C:\Program Files\mysql\MySQL Server 4.1\bin\mysql.exe [OPTIONS] [database]
-?, --help Display this help and exit.
-I, --help Synonym for -?
--auto-rehash Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.
-A, --no-auto-rehash
No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables r
Can anybody see what I'm doing wrong?
Thanks,
Chad Russell