Old:Bugs 3.5-Apollo: Start vbs: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
(New page: <span id="top"></span> <div style="padding:0;margin:0; border-bottom:3px inset #000000"> {| | MPG UniCenter || Bugs 3.5-Apollo: [[Bugs 3.5-Apollo: Introduct...)
 
m (BobS moved page Bugs 3.5-Apollo: Start vbs to Old:Bugs 3.5-Apollo: Start vbs without leaving a redirect)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span id="top"></span>
{{Uc nav 3.5 bugs}}
<div style="padding:0;margin:0; border-bottom:3px inset #000000">
{|
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||
Bugs 3.5-Apollo:
[[Bugs 3.5-Apollo: Introduction | Introduction]] | 
[[Bugs 3.5-Apollo: Server_Start_bat | Server_Start.bat]] | 
[[Bugs 3.5-Apollo: Start_vbs | Disk Start.vbs]] | 
[[Bugs 3.5-Apollo: Close_bat | Close.bat]] |
[[Bugs 3.5-Apollo: config_inc_php | config.inc.php]] |
[[Bugs 3.5-Apollo: apanel blown away | apanel - blown away]] |
[[Bugs 3.5-Apollo: Combined bug fix | Combined bug fix]]
|}
</div>
{| cellpadding="2"
|
__TOC__
||
'''Uniform Server 3.5-Apollo known bugs or issues'''
|}
'''Disk Start.vbs'''
'''Disk Start.vbs'''
 
== Bug fix: Stop database from starting when using Disk Start.vbs ==
== Bug fix to stop database from starting when using Disk Start.vbs ==
File: '''Disk Start.vbs'''<br>
File: '''Disk Start.vbs'''<br>
Location: '''*\Uniform Server'''
Location: '''*\Uniform Server'''


'''Problem:''' MySQL server runs even after clicking the option not to run.<br>
'''Problem:''' MySQL server runs even after clicking the option not to run.<br>
'''Solution:''' Proposed solution Edit the file as follows:
'''Solution:''' Edit the file as follows:


{| cellpadding="2" cellspacing="1" style="background:#000000;"
{| cellpadding="2" cellspacing="1" style="background:#000000;"
Line 54: Line 34:
|}
|}


This solution although it is correct the script will not work!<br>
This solution, although it is correct, the script will not work!<br>
There is a bug in Server_Start.bat; parameter %2 is not checked.<br>
There is a bug in Server_Start.bat; parameter %2 is not checked.<br>
If %2 is reinstated in Server_Start.bat the above script needs to pass the correct parameters as follows:
If %2 is reinstated in Server_Start.bat, the above script needs to pass the correct parameters as follows:
{| cellpadding="2" cellspacing="1" style="background:#000000;"
{| cellpadding="2" cellspacing="1" style="background:#000000;"
|- style="background:#e8e8e8;"
|- style="background:#e8e8e8;"
Line 73: Line 53:


== Alternative Solution ==
== Alternative Solution ==
I have hacked the beta script around resolving issues mentioned above. In addition added two enhancements auto detection of first free drive letter and option to run a command prompt.
I have hacked the beta script around resolving issues mentioned above. In addition I added two enhancements: auto detection of first free drive letter and option to run a command prompt.
''
''
'''Note:''''' For this script to run correctly '''Server_Start.bat''' must be updated as described on [[Bugs 3.5-Apollo: Server_Start_bat | this page]].
'''Note:''''' For this script to run correctly, '''Server_Start.bat''' must be updated as described on [[Bugs 3.5-Apollo: Server_Start_bat | this page]].


Problem: MySQL server runs even after clicking the option not to run.<br>
Problem: MySQL server runs even after clicking the option not to run.<br>
Line 138: Line 118:
Download this file [http://wiki.uniformserver.com/exeload/bugs35apollo/disk_start.vbs.txt disk_start.vbs.txt] save it as '''disk_start.vbs''' copy to folder Uniform Server.
Download this file [http://wiki.uniformserver.com/exeload/bugs35apollo/disk_start.vbs.txt disk_start.vbs.txt] save it as '''disk_start.vbs''' copy to folder Uniform Server.


Note: This will not overwrite any files use as is or rename it to '''Disk Start.vbs'''
Note: This will not overwrite any files. Use as is or rename it to '''Disk Start.vbs'''


== Forum reference ==
== Forum reference ==
Line 148: Line 128:
See '''alternative solution''' above.
See '''alternative solution''' above.


'''''[[#top | Top]]'''''


----
----
Line 156: Line 135:
|}
|}


[[Category: UniCenter]]
 
[[Category: Support]]
[[Category: Archive]]
[[Category: Patches]]
[[Category: Troubleshooting]]

Latest revision as of 12:55, 21 June 2013

Uniform Server 3.5-Apollo known bugs or issues.

Disk Start.vbs

Bug fix: Stop database from starting when using Disk Start.vbs

File: Disk Start.vbs
Location: *\Uniform Server

Problem: MySQL server runs even after clicking the option not to run.
Solution: Edit the file as follows:

Change the following:
t=MsgBox("Start the MySQL Database Server?", vbYesNo + vbQuestion, "Database Support")

If intDoIt = vbNo Then
m=""
Else
m=" mysql"
End If
W:\usr\local\apache2\bin>


To this:
t=MsgBox("Start the MySQL Database Server?", vbYesNo + vbQuestion, "Database Support")

If t = vbNo Then
m=""
Else
m=" mysql"
End If
W:\usr\local\apache2\bin>

This solution, although it is correct, the script will not work!
There is a bug in Server_Start.bat; parameter %2 is not checked.
If %2 is reinstated in Server_Start.bat, the above script needs to pass the correct parameters as follows:

To this:
t=MsgBox("Start the MySQL Database Server?", vbYesNo + vbQuestion, "Database Support")

If t = vbNo Then
m=" nomysql"
Else
m=" mysql"
End If
W:\usr\local\apache2\bin>

On the forum I proposed an enhancement to the VBS where the drive letter is automatically detected unfortunately I also did not return the correct parameters. The following alternative solution takes this into account.

Alternative Solution

I have hacked the beta script around resolving issues mentioned above. In addition I added two enhancements: auto detection of first free drive letter and option to run a command prompt. Note: For this script to run correctly, Server_Start.bat must be updated as described on this page.

Problem: MySQL server runs even after clicking the option not to run.
Solution: Proposed solution Edit the file as follows:

Proposed script:
' Name: disk_start.vbs
' Location: Uniform Server
' Created By: The Uniform Server Development Team
' Edited Last By: Olajide Olaolorun (empirex)
' Comment: Re-Arranged everything to look nicely.
' To Developers: Added the MySQL start option.
' MPG: Added auto drive detect and command prompt select

Dim WSHShell, dir, fso, letter, str1, str2, str3, str4
Set fso = CreateObject("Scripting.FileSystemObject")
Set WSHShell = WScript.CreateObject("WScript.Shell")

'Locate next available drive letter -- Added MPG
letter=Asc("c")
while fso.DriveExists(Chr(letter)+":")
letter=letter+1
wend

' Build string to display
str1 = "Use free drive found click OK or" & vbCR
str2 = "Specify a Disk Drive letter then click OK" & vbCR
str3 = "Note: To abort click Cancel"
str4 = str1 & str2 & str3
s=InputBox( str4 ,"Server Disk",UCASE(Chr(letter)))

If s = "" Then
WScript.Quit
End If
s=mid(s,1,1)

t=MsgBox("Start the MySQL Database Server?", vbYesNo + vbQuestion, "Database Support")
If t = vbNo Then
m=" nomysql"
Else
m=" mysql"
End If

c=MsgBox("Start a Command Prompt for MySQL commands?", vbYesNo + vbQuestion, "MySQL Command-line Support")
If c = vbNo Then
cl=""
Else
cl=" console"
End If

WSHShell.run "Server_Start.bat "&s&m&cl,0,0
WScript.sleep(1000)


Download

Download this file disk_start.vbs.txt save it as disk_start.vbs copy to folder Uniform Server.

Note: This will not overwrite any files. Use as is or rename it to Disk Start.vbs

Forum reference

Additional information or background can be found on these forum pages.

Thanks to Marshy | forum post for pointing out this problem.

Proposed solution

See alternative solution above.



Ric