Looking at the code in secureobj.cpp (for WiX 2.0 and 3.0), it looks as though the SchedSecureObjects action will only find the first component that creates the folder, and use the install state of whichever one it finds, which in normal SQL style basically means it's unpredictable which one it will use.
 
Fundamentally the idea of trying to create separate CreateFolder elements under multiple Components in the same Directory so that you can specify a separate condition for different Permissions isn't going to work.
 
It would be possible for the SchedSecureObjects custom action to find multiple components, but this would then introduce the problem you saw with using the LockPermissions table, that all the permissions would be applied whichever Component was actually selected to install.
 
Perhaps the schema of the SecureObjects table could be extended to include a Condition, and the <Permission> element parser to write the Condition to it? SchedSecureObjects would then have to use MsiEvaluateCondition to decide whether to schedule an ExecSecureObjects action for this row in the SecureObjects table, in addition to checking the Component's install state. I wouldn't expect to see this in WiX 2.0, though.
 
--
Mike Dimmick


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dana Gutride
Sent: 26 September 2006 18:59
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Conditional Folder Permission

Bob:

I've posted a bug on this issue, it is fairly easy to reproduce.  If you take the example that was originally submitted on this thread and change them to extended permission elements, it will demonstrate the problem.  When a component is conditioned and it contains createfolder and extended permission elements, the permissions specified are not set at all.

Thanks,
Dana

On 9/26/06, Bob Arnson <[EMAIL PROTECTED]> wrote:
Dana Gutride wrote:
> I've encountered a similar problem, it seems the permission element
> doesn't take into account the condition of the component it's within.
> This also seems to occur both with the generic MSI way of doing this
> and the extended WiX secureobj custom actions.
I'm not sure how the LockPermissions table works in MSI -- it's not
documented which actions access that table -- but the SecureObj CA
scheduler explicitly checks component install-action state (using
WcaIsInstalling). If you have a repro, please post a bug.

--
sig://boB
http://bobs.org


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to