Two ideas come to mind, depending on if the (possibly) non-elevated windows user has query rights to the database.
If those rights exist, use an immediate custom action to query the database to determine if the user exists (in that role). If they don't, you schedule the deferred actions (both the rollback and the "regular" deferred) that actually add the user (and remove it again in the case of rollback). If you can't use an immediate action, then you will have to have your action that adds the user leave behind some other "cookie" (could be a registry write, some other field in the database that is changed, whatever) that your rollback action uses as a sentinel to remove the user. If you do that, you will probably want to also write a commit action that removes your cookie/sentinel. You will want your rollback action to also remove that cookie/sentinel as well, since commit actions are not executed if the transaction is rolled back. Depending on how you design this, you may be able to use the WiX SQL actions as your custom/rollback/commit actions (in the second case) and you certainly can use the WiX SQL actions as your deferred action in the first case (you may need to instead use the technique Bob called "semi-custom actions" instead of scheduling). See http://www.joyofsetup.com/2007/07/01/semi-custom-actions/ for that. -----Original Message----- From: d8x...@hotmail.com [mailto:d8x...@hotmail.com] Sent: Monday, October 12, 2009 8:27 AM To: Wix-Users Subject: [WiX-users] SqlString roleback options I need to add an existing user to an existing SQL database role. I am not creating the database or any tables. If the user is already a member of the role my script will do nothing. My current Wix implementation works fine except I don't appear to have rollback (remove the user from the role if I added it). here is the psudo code for the sql script: if not exists (...) add user to role end if What, if any, are my options for providing roll back when using SqlString? Can I use the Sql Schema items available in Wix to determine if my script added the user to the role and if so remove the user from the role during rollback? I believe I can perform these actions via a C# custom action (haven't written it yet), but wanted to see if something similar could be done with the Wix tools. _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141665/direct/01/ ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users