Not getting Windows error message with SQL Server
I'm installing SQL Express as part of my project. Normally the installation goes fine. However SQL Express won't install on Win 7 OS that doesn't have SP2 installed.
When I run my SB 8.1 project the install fails and doesn't flash the error message telling you to install the SP. Is there a way to force this message?
script:
%MY_INSTFOLDER%\SQLEXPR_x86_ENU.exe /ACTION=Install /FEATURES=SQL /INSTANCENAME=DataBinder /SQLSVCACCOUNT="NT AUTHORITY\LOCAL SERVICE" /IACCEPTSQLSERVERLICENSETERMS=True /NPENABLED=1 /TCPENABLED=1 /ADDCURRENTUSERASSQLADMIN /QS
Thanks.
1 Attachment(s)
Re: Not getting Windows error message with SQL Server
Hello,
You have to check if "SQLEXPR_x86_ENU.exe" returns an error code. For example, if you are using "Run Program..." the %_SB_ERRORCODE% return value can hold the last exit code returned by the executable associated with the work item on its last run (see attached screenshot).
Hope this helps a bit.
Friedrich
Re: Not getting Windows error message with SQL Server
I'm using Run Command Line. Will that work the same with the return value?
Re: Not getting Windows error message with SQL Server
Hello,
No. Only the "Run Program..." script function gives you this extra information (if available).
The "Run Command Line..." script function is just a simple wrapper around the CreateProcess Windows API.
Friedrich
Re: Not getting Windows error message with SQL Server
So there is really no way I can tell the user why their install failed? There is not a way to show windows generated message boxes?
Re: Not getting Windows error message with SQL Server
Of course, you can. Just catch the exit code from the executable. In most cases, Microsoft runtimes return an error code -- you can then display this in a message box.
But that's not your main problem. You should *always* check the system requirements for the specific runtimes (see MSDN) before you launch a runtime. For example, if the runtime requires Windows 7 SP2 then check for SP2 before you launch the redistributable. Display a message that Windows 7 SP2 is required and exit the install. Don't wait for the error ;)
Friedrich
Re: Not getting Windows error message with SQL Server
DUH......that's obviously the solution.....
Is Get System Info then check service pack # the best way to do it?
I'd have to check if major version number = 6, minor version = 1 and sp>0?
1 Attachment(s)
Re: Not getting Windows error message with SQL Server
:)
Yes, "Get System Info..." is the way to go. Similar to the attached screenshot... Then, if the OS is Windows 7 and SP is < 1, display a message and terminate the install.
Friedrich
Re: Not getting Windows error message with SQL Server
OK...I was going to do set three variables: Major OS Minor OS and Service Pack. But WINVER would eliminate having to do major and minor.
Thanks!
Re: Not getting Windows error message with SQL Server
If %WINVER Equals "$WIN_7$ And %OSSP% Less Than "1" Then
display message
Exit Installation
End
install SQL Server