I tried the Run Command Line route and it's better however still not working correctly. This is an excerpt from the PowerShell script. When running the batch file manually, everything works fine. But when running the batch file from the SetupBuilder exe, it fails on the highlighted line of code below. For some reason it has an issue querying the registry.


If((Test-Path –Path 'HKLM:\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL') -eq "True")
{

try
{
"Checking Microsoft SQL status. Please wait..."
$SQLstat = "Pass"
$SQLbrDefStat = (Get-Service SQLBrowser).Status
$SQLbrDefStartup = (Get-WmiObject -Class Win32_Service -Filter "Name='SQLBrowser'").StartMode
Set-Service SQLBrowser -StartupType Manual
Set-Service SQLBrowser -Status Running
$LclSQLinstance = ([System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources() | Where {$_.ServerName -eq $env:COMPUTERNAME}).InstanceName -replace (" ","|")
}
Catch
{
$FDinstall = "Cancel"
[System.Windows.MessageBox]::Show("FacilityDocs installer encountered an error. Please contact Bronze Bow Software support for further assistance.","ERROR","Ok","Error")
}
}
Else
{
"Could not find SQL path"
$SQLstat = "Fail"
} Name:  commandline.png
Views: 817
Size:  13.0 KBName:  batchfile contents.png
Views: 778
Size:  28.1 KB