Hello,
ive got a question about using execshell.
-ExecShell open '"$INSTDIR\php\php.exe"' '"$INSTDIR\php\myfile.php"'
-ExecShell open "$INSTDIR\apache\apache" "-i"
-ExecShell open "$INSTDIR\apache\apache" "-k start -n Apache"
these are working fine.
ExecShell open '"$INSTDIR\mysql\bin\mysql"' '"databasename < $INSTDIR\mysql\bin\myfile.sql"'
but this one doesnt work correctly. (tried with(out)'"). Its seeing the whole commandline as the databasename instead of the first part of the line.
im using a .bat file now but i would like to use execshell.
Any suggestions?
Regards,
execshell problem
10 posts
I would suggest trying this
but now that i think about it that probably isn't much different then what you used. could you just use the Exec command like
ExecShell open `"$INSTDIR\mysql\bin\mysql"` `'databasename < $INSTDIR\mysql\bin\myfile.sql'`
Exec `"$INSTDIR\mysql\bin\mysql" "databasename < $INSTDIR\mysql\bin\myfile.sql"`
well...i think ive tried all combinations. 😕
Do you know why the code is working for php en apache and not for mysql?
regards,
Do you know why the code is working for php en apache and not for mysql?
regards,
Use this:
Exec '"$INSTDIR\mysql\bin\mysql" "databasename" < $INSTDIR\mysql\bin\myfile.sql'
-Justin
Exec '"$INSTDIR\mysql\bin\mysql" "databasename" < $INSTDIR\mysql\bin\myfile.sql'
-Justin
Hi Justin,
i tried your code. But its still seeing the whole commandline as the databasename instead of the first part of the line.
the .bat file im running looks like this:
Maybe ive to go to the bin dir and then execute this?
Exec `"mysql" "databasename < $INSTDIR\mysql\bin\myfile.sql"`
//Darktrain
i tried your code. But its still seeing the whole commandline as the databasename instead of the first part of the line.
the .bat file im running looks like this:
- cd mysql
- cd bin
- mysql databasename < "path\myfile.sql"
Maybe ive to go to the bin dir and then execute this?
Exec `"mysql" "databasename < $INSTDIR\mysql\bin\myfile.sql"`
//Darktrain
Originally posted by DarktrainYou've still got the syntax wrong. You don't want quotes around the parameters. Mysql will think the whole string is the database name.
Hi Justin,
Maybe ive to go to the bin dir and then execute this?
Exec `"mysql" "databasename < $INSTDIR\mysql\bin\myfile.sql"`
You sure you haven't tried:
Exec '"$INSTDIR\mysql\bin\mysql" "databasename" <"$INSTIDR\mysql\bin\myfile.sql"'
yes, and it also isnt working.
The last part of the commandline doesnt work with mysql(?).Exec '"$INSTDIR\mysql\bin\mysql" "databasename"<"$INSTIDR\mysql\bin\myfile.sql"'
Hi!
This code:
KiCHiK
This code:
seems to work. If it works for > it should work for < too.Exec '"$SYSDIR\command.com" /c echo asdasd > asd.txt'
KiCHiK
Hi DarkTrain,
This piece of code should solve your problem. If it doesn't work, try modifying your myfile.sql file so that it loads databasename from it. Then, you would use:ExpandEnvStrings $0 %COMSPEC%
Exec `"$0" /C "$INSTDIR\mysql\bin\mysql" "databasename" < "$INSTDIR\mysql\bin\myfile.sql"`
You might prefer to use ExecWait.ExpandEnvStrings $0 %COMSPEC%
Exec `"$0" /C "$INSTDIR\mysql\bin\mysql" < "$INSTDIR\mysql\bin\myfile.sql"`
- DarkTrain stated that his command line worked with a batch file.
- The command line contains '< filename', meaning 'use filename as the input device'.
Yes, that piece of code solved my problem.
Thanks petersa,
//Darktrain
Thanks petersa,
//Darktrain