Hi all,
Thanks for your support provided so far.
I 'm writing a vbscript in CallVBScriptFrom EmbeddedCode customaction to retrieve the value of SourceDir Property as

Srcprop=Session.Property("SourceDir")

But while trying to display it using msgbox, it returns an empty value. But if i try to retrieve the INSTALLDIR value it retrieves it.
I have mentioned this VBscript custom action before CostFinalize action.
Could any one help in this?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Where in the sequence are you running the script? Remember that CAs in the Execute Deferred sequence can only access a limited number of properties, one of which is INSTALLDIR. If you need the script to run in ED, you need to make use of teh special CustomActionData property. There's a lot of info here on using that property. As ever, use the 'Search' facility.

Why do you need to know where the MSI is stored, anyway? Just curious...
Answered 03/12/2008 by: VBScab
Red Belt

Please log in to comment
0
Lookup the ResolveSource action in the SDK
Answered 03/12/2008 by: Jamie B
Orange Senior Belt

Please log in to comment
0
Hey, JB. I'm racking my brain trying to figure out how http://msdn2.microsoft.com/en-us/library/aa371232.aspx helps Bhuvan retrieve the actual MSI location...

Mayhap you could elucidate for us?
Answered 03/12/2008 by: VBScab
Red Belt

Please log in to comment
0
I have given that in Normal/Immediate Execution
Answered 03/12/2008 by: bhuvan
Senior Yellow Belt

Please log in to comment
0
Adding a ResolveSource action prior to executing the vbs will ensure the SourceDir property is populated.

Alternatively use the OriginalDatabase property and parse off the MSI file name.
Answered 03/12/2008 by: Jamie B
Orange Senior Belt

Please log in to comment
0
My suspicion is that the OP's trying to divine if the original MSI exists: if it doesn't ResolveSource will pop up the 'Locate source' dialog, won't it?
Answered 03/12/2008 by: VBScab
Red Belt

Please log in to comment
0
If the source location is unavailable then yes!

Maybe the OP could further explain the requirement for the vbscript?
Answered 03/12/2008 by: Jamie B
Orange Senior Belt

Please log in to comment
0
Hi Bhuvan,
just make sure, you call your custom action after the "CostFinalize" action. This is the action, which populates all the directory properties.
And be aware, that "SourceDir" will not be resolved, on uninstalls.
Take a look at the log file and it will tell you all the answers, you need. :-)
If you, for some reason, need to reread the Sourcedir, you have to work with "ResolveResource", like Jamie pointed out. But this works only after the "CostInitialize" action.
Regards, Nick
Answered 03/12/2008 by: nheim
Tenth Degree Black Belt

Please log in to comment
0
SourceDir will be resolved on uninstall if the ResolveSource action is used, otherwise it wont.
Answered 03/12/2008 by: Jamie B
Orange Senior Belt

Please log in to comment
0
ORIGINAL: Jamie B

SourceDir will be resolved on uninstall if the ResolveSource action is used, otherwise it wont.

Yes, but it's not executed by default meaning; you'll have to add yourself and sometimes added with a condition of "NOT Installed".

Follow Ian's "CustomActionData property" for deferred execution and Nick's advice should solve your issue during install.
Answered 03/12/2008 by: AngelD
Red Belt

Please log in to comment
0
re: the use of the "OriginalDatabase" property this can be problematic on repair in some environments, so conditional use is also advised with this one.
Answered 03/13/2008 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity