Issue in Bare Metal Server ActionScript

The Deploy OS Deployment Server baseline has a fixlet "ODBC Setup" with the following action script:

action uses wow64 redirection false

if {not exists key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLExpress" of x64 registry}
	if {version of operating system < "10" as version}
		prefetch SQLEXPR_x64_ENU.exe sha1:e0a5a388255244f1f5eb2fbf46bdc7292f7e3d8e size:289058768 https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLEXPR_x64_ENU.exe sha256:f857ff82145e196bf85af32eeb0193fe38302e57b30beb54e513630c60d83e0d
		parameter "dbVersion" = "140"
		parameter "ODBCDriver" = "ODBC Driver 13 for SQL Server"
	else
		prefetch SQLEXPR_x64_ENU.exe sha1:652b2388e961269e04c679f60bc8d7853bb907f3 size:279293816 https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SQLEXPR_x64_ENU.exe sha256:2e61c8bbde6021f9026c54ad9db4bbb1227e68761d4c00a6a50a2c70fe7afe05
		parameter "dbVersion" = "160"
		parameter "ODBCDriver" = "ODBC Driver 17 for SQL Server"
	endif

	waithidden __Download\SQLEXPR_x64_ENU.exe /Q /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /IACCEPTSQLSERVERLICENSETERMS
	continue if {exists key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLExpress" of x64 registry}
endif

waithidden cmd.exe /C ""{value "ODBCToolsPath" of key ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\" & (parameter "dbVersion") & "\Tools\ClientSetup") of x64 registry}sqlcmd.exe" -S localhost\SQLEXPRESS -Q "CREATE DATABASE AutoDeploy""

runhidden cmd.exe /C odbcconf configsysdsn "{parameter "ODBCDriver"}" "DSN=AutoDeploy|SERVER=(local)\SQLEXPRESS|Database=AutoDeploy|Trusted_Connection=yes"

The issue is the dbVersion parameter is wrapped in the following statement:

if {not exists key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLExpress" of x64 registry}

and therefore the relevance substitution later in the actionscript fails.

This isn't normally an issue but was for me when attempting to deploy to a computer that had previous installations of SQL Server. The uninstall baseline doesn't seem to clean this up either, at least for me. I'd recommend the parameter be defined outside that if statement.

Hello,

If you want to use a pre-installed database server (such as SQL Server), you can follow the instructions provided at this link:

Specifically, refer to the section:
"On 64-bit architectures, you can install a Bare Metal Server on a relay that already has an installed database..."

Among the required steps, you will need to create a System DSN named AutoDeploy using the 64-bit ODBC drivers for your database.

Doing this will make the "ODBC Setup" action non-relevant during the "Deploy OS deployment server" Multiple Action Group, successfully avoiding the error you are seeing.

Alternatively, if you want to completely clean a machine from a previous Bare Metal Server installation (including its default database), you can run OSD site Task 134 (“Bare Metal Server Clean Up Post Uninstall or Install Failure”).

Running this task will also remove the SQL Express instance that was installed alongside the Bare Metal Server.

Thanks.

Thank you for the response. I was able to resolve the issue using the steps you provided. Now I'm just dealing with the Installed OS Deployment Servers taking a long time to update. Last time, it took several hours.

Which kind of update?

Thanks.

Sergio - BigFix OSD L3 support

In the Bare Metal Server Manager Dashboard, the list of Installed OS Deployment Servers takes several hours to update which endpoints have the Bare Metal Server software installed or uninstalled whenever a change is made.