Hello everyone,
I'm using Advanced Installer to create a .msi project to install SQL Server Express 2022 silently. In the "Files and Folders" page I add the .exe for SQL Server Express 2022 and a PowerShell script inside the "Application Folder" that has the "APPDIR" identifier. Then I created a "Launch File" custom action specifying [APPDIR]SqlServerExpressSilentSetup.ps1 as value for the "File to launch" field and "-ExecutionPolicy Bypass -File "[APPDIR]SqlServerExpressSilentSetup.ps1" -InstanceName "VRS" for the "Command line" field.
The content of the powershell script is this one:
param (
[string]$InstanceName = "VRS"
)
if (-not $InstanceName) {
Write-Output "InstanceName parameter is required."
exit 1
}
# Define the path to the SQL Server setup executable
$setupPath = Join-Path -Path $PSScriptRoot -ChildPath "SQLEXPR_x64_ENU.exe"
# Define the SQL Server installation command
$installArgs = "/x:.\ExtractionFolder /Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /FEATURES=SQLEngine /INSTANCENAME=$InstanceName /SQLSYSADMINACCOUNTS=`"$env:USERDOMAIN\$env:USERNAME`""
# Execute the SQL Server installation command
Write-Output "Starting SQL Server installation..."
Start-Process -FilePath $setupPath -ArgumentList $installArgs -Wait
Write-Output "Script execution completed."
Once I run the .msi file at some point I got a popup with this error:
"Windows cannot find 'C:\MSC Technology\VRSv1\SqlServerExpressSilentSetup.ps1'. Make sure you typed the name correctly and then try again.
Someone can help me to fix this issue that I'm facing, please?
Thanks in advance.
FOLLOW US