我需要从 NSIS 安装程序备份 MySQL 数据库。我在尝试的脚本中遗漏了一些琐碎的东西:
nsExec::Exec '"$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password --routines $dbName --execute="source D:\$dbName.sql"' $0
nsExec::Exec '"$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password --routines $dbName --execute="D:\$dbName.sql"' $0
nsExec::Exec '"$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password --execute="--user=$username --password=$password --routines $dbName D:\$dbName.sql"' $0
nsExec::Exec '"$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password --routines $dbName "D:\$dbName.sql"' $0
nsExec::Exec '"$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password /c echo --routines $dbName > "D:\$dbName.sql"' $0
ExecWait '"$1" /C "$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password --routines $dbName > "D:\$dbName.sql"' $0
ExecWait '/C "$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password --routines $dbName > "D:\$dbName.sql"' $0
StrCpy $BACKUPFILE "D:\ctvi.sql"
StrCpy $1 $BACKUPFILE
ExpandEnvStrings $2 %COMSPEC%
ExecWait '"$2" /C "$mySqlDirectory\bin\mysqldump.exe" --user=$username --password=$password $dbName > $1' $0
ExecWait '/C "$mySqlDirectory\bin\mysqldump.exe" -u$username --password=$password -R $dbName >"D:\$dbName.sql"' $0
他们都没有工作。传递论点不是我的强项:(