/build/static/layout/Breadcrumb_cap_w.png

MSI Sequencing...... techie question!

I want to pragmatically insert 2 custom actions in the installation sequence. Simple enough.

Action 1. Custom Action to retrieve Properties or System data, and store it for use in the Deferred Execute sequence.
Action 2. Utilise the data captured in Action 1 in the Deferred Execute sequence.

Part One is simple....
Action 1. will be achieved using either the AppSearch Action or by placing a user-defined CustomAction after the AppSearch Action (by identifying the AppSearch Sequence number as part of the script).

Here's the thing..... Action 2.
How do you identify the sequence number of the 'InstallFinalize' action in the 'Execute Deferred' sequence (using the sequence numbers or otherwise). In other words how do you identify where the 'Execute Immediate' sequence stops and 'Execute Deferred' sequence starts??

Once I can identify the sequence number of the 'InstallFinalize' action in the 'Execute Deferred' sequence, I can either increment or decrement this number to place my CustomAction before or after 'InstallFinalize' action in the 'Execute Deferred' sequence.

When you use Wise to view the msi, you can see both sequences and the only thing I can see to identify the difference is the sequence numbers.

I apologise in advance if this sounds over complicated. I've had a quick look at John McFadyen blog which explains that 'InstallFinalize' in the 'Execute Immediate' sequence actually triggers the 'Execute Deferred' sequence but there is only one 'InstallFinalize' entry in the InstallExecuteSequence table....! How else can you identify the diffent sequences??

This may be a difficult question to answer I think [>:].

I'm sure if I've not explained anything clearly enough, you'll come back with questions.!

Cheers

Simon.

0 Comments   [ + ] Show comments

Answers (12)

Posted by: jmcfadyen 15 years ago
5th Degree Black Belt
1
Simon you are quite correct.

have a read of this ..

http://johnmcfadyen.spaces.live.com/blog/cns!9DD01136FC094724!167.entry

in relation to what you are doing if you using Wise Macro's to do this you can do something along the lines of this

set tblInstallExecuteSequence = WTables("InstallExecuteSequence")

set rowInstallExecute = tblInstallExecuteSequence.WRows("InstallFinalize")

intSequence = rowInstallExecute("Sequence")

then you can try attempting to generate your CA's using intSequence - 1

or at least doing a check previously, I wrote this code somewhere a while back and are well across what you are trying to achieve. If you need any further assistance let me know.

I have done it in both wise macro and using the automation objects.
Posted by: anonymous_9363 15 years ago
Red Belt
0
ORIGINAL: simoncummings
This may be a difficult question to answer I think [>:].
Not at all.

- To pass data from the ExecuteImmediate (EI) sequence to the ExecuteDeferred (ED) sequence, you must use the special 'CustomActionData' property. MSDN explains this rather well but, in essence, you use an EI CA to set a property whose name matches that of the ED CA. Then, in the ED CA, you obtain that data by reference to a property called 'CustomActionData'. If you need to pass more than one "set" of data, use a separator for the property value and then have your CA parse that value using the separator.
- You cannot insert actions after Installfinalize in the ED sequence.

Some light reading:

http://juice.altiris.com/article/3594/guidelines-custom-action-location
and
http://msdn.microsoft.com/en-us/library/aa368066%28VS.85%29.aspx
Posted by: simoncummings 15 years ago
Senior Yellow Belt
0
This may be a difficult question to answer I think [>:].
Still stands!

VBScab.... thanks for trying, but you've misunderstood the question. Using data in the ED sequence is not the problem - that's simple enough.

The problem is when trying to insert a ED CA, before the ED InstallFinalize.

In simple terms, what sequence number do I use? If I cannot pragmatically identify the sequence number of the ED InstallFinalize, I cannot give my ED CA a decremented sequence value.

Simon.
Posted by: AngelD 15 years ago
Red Belt
0
Simon,

What exactly are you trying to achieve?
Depending on what to want to do and if you want to include this in more then one package I would suggest you use a merge module instead as that would handle the sequence "insert" for you for your custom action.
Posted by: anonymous_9363 15 years ago
Red Belt
0
ORIGINAL: simoncummings
In simple terms, what sequence number do I use? If I cannot pragmatically identify the sequence number of the ED InstallFinalize, I cannot give my ED CA a decremented sequence value.
Why do you want to programmatically assign the sequence number? Besides anything else, I don't believe you can, since - off the top of my head - that would involve writing a new row value into the database which, since the engine has it open, would be impossible. Your only recourse then would be to copy the MSI to a temporary location, write the new value then call the install using the modified MSI. Hideously complex...

If, as I suspect, you want to ensure that Action A has taken place before Action B is executed, why not set a condition on Action B?
Posted by: simoncummings 15 years ago
Senior Yellow Belt
0
I think I've just answered my own question. [:D]
  • The InstallExecuteSequence table controls the order of things, as it suggests. It is the properties of the CustomAction itself (the TYPE column in the CustomAction Table) which control whether it runs as EI or ED.
  • The default running order of Windows installer is EI then ED.
  • So as long as I identify the InstallFinalize Action in the InstallExecuteSequence Table (e.g.: 6500) and place my CustomAction(s) before that (e.g: 6499 - assuming nothing exists already - which I can move) the default Windows Installer sequencing will run through the same order in the InstallExecuteSequence Table firstly as EI then as ED. If the properties of my CustomAction identify it as ED then that's when it will run.

I think I was making this more complicated than it needed to be or just not understanding the order of things. Wise confuses you by showing two sequence dialogs, one for EI and one for ED, when in reality there is only one sequence, it just gets looped through twice, the second time acutally commiting the changes.

Thanks everyone.
Posted by: simoncummings 15 years ago
Senior Yellow Belt
0
John,

Many thanks for your input. Your blog is full of really good technical information. However, and without meaning to offend, when I took a look at your diagram... I found the image quality was not too great and the written text not very clear - although the information is obviously fine. Perhaps a higher-res image would be more useful [:)]

Also, from the wealth of information provided, It still took me a while to figure out the fact that it's loops through the same install sequence twice - probably just my lack of intelligence. Perhaps you could figure a way of explaining this in a form of summary by using some of what we've said in this thread.

Also, I'd never thought of using Wise Macros - didn't even realise they existed.... I'll take a look

Thanks again,

Simon.
Posted by: AngelD 15 years ago
Red Belt
0
Just of interest,
what kind of custom action are you trying to insert?
Posted by: simoncummings 15 years ago
Senior Yellow Belt
0
I have a template vbscript which I add to the ED sequence with some standardised property names which I use in conjunction another customaction in the EI sequence.... It just simplifies the use of properties in the ED sequence at the click of a Yes/No button.

Regards

Simon.
Posted by: AngelD 15 years ago
Red Belt
0
Simon,

Couldn't you be more specific?
Posted by: jmcfadyen 15 years ago
5th Degree Black Belt
0
Simon,

yeah i hear that comment alot, too lazy to fix it as i lost the original pic.

just for interests sake it actually loops through those actions 3 times not 2.

there some macro info the blgo as well if you need detail on how to write them.
Posted by: AngelD 15 years ago
Red Belt
0
John,

http://forums.altiris.com/attachments/sequences.jpg

hmm maybe I shouldn't have done that [;)]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ