|
|
#1 |
|
Junior Member
Join Date: May 2011
Posts: 9
|
Edit Batch file before executing
Hello All,
I am having problem in sending values to batch file while running nsis script... I want to run database script files which i have written in batch file and i want this batch file to be executed with nsis script by seting values of dbuser,dbpswd,dbname in nsis script..Can any one know?? My batch file looks like(abc.bat):= set /P dbuser=Enter DB user name : set /P dbpswd=Enter DB password : set /p dbname=Enter DB Name/SID : echo Connecting to the Database.. mysql -u%dbuser% -p%dbpswd% %dbname% < 1.1\MySql\1.sql 2> %temp%\OVMySQLDBInstall1.log mysql -u%dbuser% -p%dbpswd% %dbname% < 1.2\MySql\1.sql 2> %temp%\OVMySQLDBInstall3.log Thanks |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Rather than including the batch file with File and then modifying it afterwards, just generate the batch file using FileOpen/FileWrite/FileClose. You can use variables wherever you require them.
Edit: If you're not installing the batch file, why use one at all? Just call mysql.exe directly using ExecDos (which provides piping to a log file). Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2011
Posts: 9
|
Hello Afrow,
my batch file have around 20 script commands and for connection purpose i want to give db name ,dbuser and dbpwd through registry or i have also wriiten a page in installer which asked for the connection parameters(dbuser,dbname,dbpwd) and i want not to repeat these parameters in batch file...it would be better help if u suggest how to pass values in db parameters of batch file from nsis script variable.. Thanks |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
I've just explained how to do it.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Your other option is to replace tokens in your batch file with WordReplace.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|