equalman
Posts: 1
Joined: Wed Aug 01, 2018 4:57 am

how to install portable mysql by vbs script

i want to install mysql Ver 5.1.42-community in the ‘custom actions’ ,it is a portable version, so i prepare a bat sciprt,it modify my.ini and install mysqld as a windows service etc.
To hide the cmd.exe ,i just call bat script in another vbs script, and is placed in the mysql base directory together with that bat script
the content is

Code: Select all

Public Const vbQuote = """"
Set ws = CreateObject("Wscript.Shell")
strPath = Wscript.ScriptFullName
pos = InStrRev(strPath,"\")
strPath=Left(strPath, pos)
batPath =  "cmd /c " & vbQuote & strPath & "quick_install_start.bat" & vbQuote 
ws.run batPath,,true
but error occur, it says script can not work,
in the directory "c:\wxq64\AppData\Roaming\Hpws\FR4000 1.0.3.0\install\E33F8F5\MySql" ,i find my vbs/bat script and other mysql portable files. but it can be executed by double click。 can somebody help me?
the attachmenet is my script file.
Attachments
Mysql.rar
(799 Bytes) Downloaded 185 times
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: how to install portable mysql by vbs script

Hello and welcome to our forums,

I am not so sure why this happens. The best way for you will be to try to debug your VBS code when triggered within the installation process.

Also, you can try to use our "Launch file" custom action type to launch your BAT file and enable its "Hide program's window" flag.

Hope this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”