I have a PS custom action that behaves differently, depending on the GUI or non-interactive flow of the installer.
Here is a sample code from the CA:
$script = $args[0]
. "$cript" # source the PS script file that is present as a temporary file via the 'Files and Folders' options
someFunctionFromScript arg1 arg2
With the UILevel 5 everything works. With non-interactive flow, the line sourcing the script fails generating this error:
This makes no sense at all. Why would the same PS code behave differently based on the kind of the flow (UI or non-interactive)?ERROR: The term 'C:\Users\sasha\test.temp\{F1645A98-D873-43D3-B0F9-44E7BC8BEDE1}\script.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.'.
Additionally, some properties are not available, depending on where in the sequence the CA is.
Things like 'Installed', 'REMOVE', 'ProductCode_Dir' are not available in the Execute Sequences|Begin.
They are available in the 'Execute | Preparing'.
It would be great if the first issue was fixed - I need the CA to run before the system is being modified.
Thanks!