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?
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
[ - ] Hide Comments

so that the conversation will remain readable.
Answer this question
or Comment on this question for clarity
Answers
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...
Why do you need to know where the MSI is stored, anyway? Just curious...
Please log in to comment
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?
Mayhap you could elucidate for us?
Please log in to comment
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
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
Please log in to comment
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.
Please log in to comment
Comments