I cant get my inline script to read my MSI properties, when I put the script in a powershell file and add a custom action using Run Powershell script file it work but not when using inline script. What am I doing wrong?
My powershell script:
Code: Select all
#Requires -version 3
Param()
$registryPath = "HKLM:\SOFTWARE\ABC\Settings"
# If registry key doesn't already exists, we create one
if (!(Test-Path $registryPath)) {
New-Item -Path $registryPath -Force | Out-Null
}
# Profile
$propProfileValue = AI_GetMsiProperty PROFILE
if (![string]::IsNullOrEmpty($propProfileValue)) {
New-ItemProperty -Path $registryPath -Name "Profile" -Value $propProfileValue -PropertyType "String" -Force | Out-Null
}Code: Select all
msiexec /i ABCSetup.msi Profile=Test4Damien
FOLLOW US
Get the latest news in Application Packaging