/build/static/layout/Breadcrumb_cap_w.png

SOURCEDIR Property

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

Answers (11)

Posted by: anonymous_9363 16 years ago
Red Belt
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...
Posted by: Jamie B 16 years ago
Orange Senior Belt
0
Lookup the ResolveSource action in the SDK
Posted by: anonymous_9363 16 years ago
Red Belt
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?
Posted by: bhuvan 16 years ago
Senior Yellow Belt
0
I have given that in Normal/Immediate Execution
Posted by: Jamie B 16 years ago
Orange Senior Belt
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.
Posted by: anonymous_9363 16 years ago
Red Belt
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?
Posted by: Jamie B 16 years ago
Orange Senior Belt
0
If the source location is unavailable then yes!

Maybe the OP could further explain the requirement for the vbscript?
Posted by: nheim 16 years ago
10th Degree Black Belt
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
Posted by: Jamie B 16 years ago
Orange Senior Belt
0
SourceDir will be resolved on uninstall if the ResolveSource action is used, otherwise it wont.
Posted by: AngelD 16 years ago
Red Belt
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.
Posted by: jmcfadyen 16 years ago
5th Degree Black Belt
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.
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