Purple commands.
Posted: Tue Feb 17, 2009 3:07 pm
I understand that all purple commands (assuming the default colours are used) are deferred until the Apply statement is run. Further, the purple commands are stacked up in the order they are encountered in the script.
So, if I have a script that bounces around from one piece of code to another using if and goto label statements for example, the script engine will pick up all the purple commands wherever it finds them but nothing will execute until the time the Apply Install statement is reached. At which time the purple commands will be run FIFO or perhaps ordered into an internal sequence that the engine decides is correct.
Further if bits of common code are encountered it's possible that any number of purple commands might also be eligible for inclusion in the apply install, uninstall and patch commands. That could possibly lead to unexpected results where an install-only intended purple command could be executed during an apply uninstall.
Which explains why it's important to distinguish between what gets executed during an install and uninstall using variables to control what the script does and where.
All black commands (default colours) are executed immediately wherever they are encountered.
I presume the purple commands are internal to IA only? That is, anyone writing a plug-in can only write non-purple commands?
Of course, I'm writing all of this as fact but to be truthful, I'm not sure if I've actually really understood how the purple commands work. If I'm flawed in my assumptions, then please correct me.![Smile :)](./images/smilies/icon_smile.gif)
So, if I have a script that bounces around from one piece of code to another using if and goto label statements for example, the script engine will pick up all the purple commands wherever it finds them but nothing will execute until the time the Apply Install statement is reached. At which time the purple commands will be run FIFO or perhaps ordered into an internal sequence that the engine decides is correct.
Further if bits of common code are encountered it's possible that any number of purple commands might also be eligible for inclusion in the apply install, uninstall and patch commands. That could possibly lead to unexpected results where an install-only intended purple command could be executed during an apply uninstall.
Which explains why it's important to distinguish between what gets executed during an install and uninstall using variables to control what the script does and where.
All black commands (default colours) are executed immediately wherever they are encountered.
I presume the purple commands are internal to IA only? That is, anyone writing a plug-in can only write non-purple commands?
Of course, I'm writing all of this as fact but to be truthful, I'm not sure if I've actually really understood how the purple commands work. If I'm flawed in my assumptions, then please correct me.
![Smile :)](./images/smilies/icon_smile.gif)