Yes, you can't access session details from a deferred custom action. You can, however, read the CustomActionData value. You set this up in an immediate action where the property name is the Id of the deferred action. There's a great example of this in the Wix docs. Look up the "Quiet Execution Custom Action" in the second example of the Deferred Execution topic.
The specific scenario I had was as follows: - During install, I ask the user for their sql server so I can deploy scripts to it with my custom action (as above) - I save that property in a registry value under HKLM\SOFTWARE\MyApp\SqlServer - The property has a RegistrySearch element on it so that the value can be loaded from the registry if it exists - The expectation was that during uninstall, I could find the original sql server and run an uninstall script on it with a similar custom action. - The problem was that I was getting a blank string for the name of the sql server. - The resolution was to add Secure="yes" to the property. Now it works as intended. This seems to fall in the category of "works as designed". However, the design is a bit cloudy. No, I never did find out what a "managed installation" means. If anyone knows where this is documented, please share a url. In regards to elevation, normally you would specify Impersonate="no" on the deferred action to have the action run with elevated privileges. However, in this case, I needed to specify Impersonate="yes" so that I connect to the sql server using the windows authentication of the person running my installer. Perhaps this had something to do with why I needed to mark the property secure. I do have other custom actions that run with elevated privileges, but none that needed a property value during uninstall. Matt Johnson MCPD, MCTS, MCSD, MCDBA Director of Application Development Time America, Inc. ma...@timeamerica.com | www.timeamerica.com -----Original Message----- From: Nick Ramirez [mailto:nickra...@hotmail.com] Sent: Saturday, May 01, 2010 5:56 AM To: wix-users@lists.sourceforge.net Subject: Re: [WiX-users] Property/@Secure - when to use? Matt, You are definitely the person to talk to then. Marking a property as "Secure" seems to have nothing to do with deferred custom actions, as you say. Doing so will still get you the "Cannot access session details from a non-immediate custom action". We'd always used CustomActionData to pass properties to a deferred CA. However, I am still very interested in knowing what "Secure" does and I think you've found it. I don't understand the steps you took, though, and would like to reproduce the problem myself. How did you elevate privileges? And did you find out what's meant by a "managed" installation? Can you tell me the key factors that cause the error? You say the problem happens in the immediate phase? But only on uninstall? Thanks for the help. Matt Johnson-2 wrote: > > Lol. See my prior posts from today. I needed this specifically to get a > property from a registry key to pass to a custom action during uninstall. > > > Matt Johnson MCPD, MCTS, MCSD, MCDBA > Director of Application Development > Time America, Inc. > ma...@timeamerica.com | www.timeamerica.com > > > -----Original Message----- > From: Nick Ramirez [mailto:nickra...@hotmail.com] > Sent: Thursday, April 29, 2010 2:48 PM > To: wix-users@lists.sourceforge.net > Subject: [WiX-users] Property/@Secure - when to use? > > > Hello, > > The Property element's Secure attribute is supposed to be necessary to > pass > a property from the UI to the Execute sequence. However, I've never been > able to create a situation where it was necessary. For me, just making the > property uppercase has always done the trick. > > I've tried the following scenarios: > > * installing as an Administrator > * installing as a non-Administrator > * setting the property with a custom action > * setting the property with a Property element > * setting the property from the command line > * using the property in the Execute sequence in an immediate custom > action > * setting the ALLUSERS property to "1" and installing as a > non-administrator > > I've tried it in XP, Windows 7 and Windows Server 2008. > > It always works for me without using the Secure attribute. However, I see > many sources that say the Secure attribute is needed. Can anyone show me a > scenario, with the steps to take, when this is really necessary? When not > having that attribute would cause an error? > > I appreciate any help. > > -- > View this message in context: > http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Property-Secure-when-to-use-tp4982590p4982590.html > Sent from the wix-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > ------------------------------------------------------------------------------ > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > -- View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Property-Secure-when-to-use-tp4982590p4989921.html Sent from the wix-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users