Enhanced powershell installer script set property

I am using the advanced installer 10.7.1. I add a custom action "run windows powershell script". What this script means is to check if the installer is running on azure vm or not. if so, only then does it allow the user to install. The script works fine on vm, I checked it. but now I need to display an error message based on the result of the script. which means that I have to set some property in the script, based on which I will show an error message. can someone tell me how to set the advanced installer property via powershell script.

+4
source share
2 answers

This is a limitation of Windows Installer , not Advanced Installer. PowerShell does not have access to the installation Session object, so you cannot set / get properties from the powershell script in MSI, no matter which tool was used to build the MSI.

The only custom actions you can use to set the property (of course, as immediate , of course) are VBS scripts (embedded or file attachments) or DLLs written in C ++ or C # . C # is much simpler since you have access to many .NET APIs (but you also have the requirement that the .NET Framework be on end-user computers).

@ravikanth

script, . Weird!

Windows, , MSI. , , MSI, ", " . Windows , PowerShell Advanced Installer .

, PS , , , , , , . (, / Windows, ..). DLL , ( ), IDE ( ).

+1

, Advanced Installer, script, . ,

#Custom Script action
#Get the VM details
If (AzureVM) {
   $true
} else {
   $false
}

script, , .

0

Source: https://habr.com/ru/post/1542274/


All Articles