This is where you use the property that the action set.  You do not allow the 
user off of the dialog until they enter credentials that work and the property 
is set to the value you expect.  This way it is up to the installer to exit the 
install if they do not have the needed information, but you give them all the 
chances they need to get it right.

Mat Skildum


-----Original Message-----
From: Kevin Burton [mailto:kev...@buyseasons.com]
Sent: Thursday, March 10, 2011 12:38 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] C# Custom Action questions

But I want the install to fail. If it continues with the wrong credentials it 
will try to start services with the wrong credentials.

Kevin Burton
Senior Software Engineer
BUYSEASONS
262-901-2000 Office
262-901-2312 Fax
kev...@buyseasons.com


-----Original Message-----
From: Skildum, Mathew [mailto:mathew.skil...@aspect.com]
Sent: Thursday, March 10, 2011 12:32 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] C# Custom Action questions

In cases where you checking things like credentials you want the actions to 
return success so that the install does not fail.  As it was said, you set a 
property if the call succeeded and check if the property is set.

You use the other return values in those cases where you want the install to 
fail and not continue such as when updating configuration files or updating 
anything that the application requires to function.

The basic rule of thumb is when in the UI sequence always have actions return 
success and set properties use in conditional statements.  When the action is 
called in the Execute sequence and it is critical to the success of the product 
always have the action return success or failure so that the install can fail 
and rollback when needed.

Mat Skildum


-----Original Message-----
From: Kevin Burton [mailto:kev...@buyseasons.com]
Sent: Thursday, March 10, 2011 12:21 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] C# Custom Action questions

So CA's always return Success. What are the other return values used for? Thank 
you. For the tip.

The problem that I am having now is that it doesn't appear that the CA is 
getting called. I look in the log and see the message indicated earlier in this 
thread indicating that the DLL "could not be run". Any idea for this?

Kevin Burton
Senior Software Engineer
BUYSEASONS
262-901-2000 Office
262-901-2312 Fax
kev...@buyseasons.com

-----Original Message-----
From: Castro, Edwin G. (Hillsboro) [mailto:edwin.cas...@fiserv.com]
Sent: Thursday, March 10, 2011 12:03 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] C# Custom Action questions

You'll want to set a property that can be checked in a condition.

Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
P Please consider the environment before printing this e-mail

> -----Original Message-----
> From: Kevin Burton [mailto:kev...@buyseasons.com]
> Sent: Thursday, March 10, 2011 6:05 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] C# Custom Action questions
>
> How does the custom action indicate that the credentials are incorrect?
>
> Kevin Burton
> Senior Software Engineer
> BUYSEASONS
> 262-901-2000 Office
> 262-901-2312 Fax
> kev...@buyseasons.com
>
> -----Original Message-----
> From: Simon Dahlbacka [mailto:simon.dahlba...@gmail.com]
> Sent: Wednesday, March 09, 2011 11:21 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] C# Custom Action questions
>
> You shouldn't return failure if the credentials are incorrect, if you
> do so you will get this error.
>
> "been there, done that... "
> On Mar 10, 2011 6:34 AM, "Kevin Burton" <kev...@buyseasons.com> wrote:
> > I read that. Which of the four rules is this violating?
> >
> > I made the warning go away by making the C# CA 'immediate' thus I
> > don't
> have to have another custom action to remember the property. So I have
> >
> > <CustomAction Id="CA_CheckCredentials"
> > Return="check"
> > Execute="immediate"
> > BinaryKey="CustomActionsDLL"
> > DllEntry="CheckCredentials"/>
> >
> > And the schedule
> >
> > <InstallExecuteSequence>
> > <Custom Action="CA_CheckCredentials" After="InstallInitialize" />
> > </InstallExecuteSequence>
> >
> > But in the verbose log I get:
> >
> > MSI (s) (B8:9C) [22:04:26:415]: Note: 1: 1723 2: CA_CheckCredentials 3:
> CheckCredentials 4: D:\WINDOWS\Installer\MSI410.tmp
> > Action start 22:04:26: CA_CheckCredentials.
> > MSI (s) (B8:9C) [22:04:26:415]: Product: Bsi WebServices -- Error 1723.
> There is a problem with this Windows Installer package. A DLL required
> for this install to complete could not be run. Contact your support
> personnel or package vendor. Action CA_CheckCredentials, entry:
> CheckCredentials,
> library: D:\WINDOWS\Installer\MSI410.tmp
> >
> > Error 1723. There is a problem with this Windows Installer package.
> > A DLL
> required for this install to complete could not be run. Contact your
> support personnel or package vendor. Action CA_CheckCredentials, entry:
> CheckCredentials, library: D:\WINDOWS\Installer\MSI410.tmp
> >
> > The error says that the DLL cannot be run. Why? I believe I have
> > followed
> the instructions for writing a managed CA to the tee (though there
> seems to be some disagreement between the online tutorial
> http://www.tramontana.co.hu/wix/ and this book).
> >
> >
> > -----Original Message-----
> > From: Castro, Edwin G. (Hillsboro) [mailto:edwin.cas...@fiserv.com]
> > Sent: Wednesday, March 09, 2011 5:26 PM
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] C# Custom Action questions
> >
> > ICE63 - http://msdn.microsoft.com/en-us/library/aa369008.aspx
> >
> > Edwin G. Castro
> > Software Developer - Staff
> > Electronic Banking Services
> > Fiserv
> > Office: 503-746-0643
> > Fax: 503-617-0291
> > www.fiserv.com
> > P Please consider the environment before printing this e-mail
> >
> >
> >> -----Original Message-----
> >> From: Kevin Burton [mailto:kev...@buyseasons.com]
> >> Sent: Wednesday, March 09, 2011 2:15 PM
> >> To: General discussion for Windows Installer XML toolset.
> >> Subject: Re: [WiX-users] C# Custom Action questions
> >>
> >> I think I have solved this problem. The CA was scheduled in the
> >> InstallExecuteSequence and was marked as 'deferred' so I created
> >> the following 'Custom Data'.
> >>
> >> <CustomAction Id="SetProperty" Property="CA_CheckCredentials"
> >> Value="[SERVICEUSER],[SERVICEPASSWORD]" /> <CustomAction
> >> Id="CA_CheckCredentials"
> >> Return="check"
> >> Execute="deferred"
> >> BinaryKey="CustomActionsDLL"
> >> DllEntry="CheckCredentials"/>
> >>
> >> And scheduled it like (I am trying to follow the instructions on
> >> page
> >> 133 of
> >> 'WiX: A Developer's Guide to Windows Installer XML' by Nick
> >> Ramirez)
> >>
> >> <InstallExecuteSequence>
> >> <Custom Action="SetProperty" Before="CA_CheckCredentials" />
> <Custom
> >> Action="CA_CheckCredentials" After="InstallInitialize" />
> >> </InstallExecuteSequence>
> >>
> >> Now I get the ICE warning:
> >>
> >> warning LGHT1076: ICE63: Some action falls between
> >> InstallInitialize and RemoveExistingProducts.
> >>
> >> Is this a "bad" warning? I don't completely understand why this
> >> scheduling is bad. I would like to know that the credentials are
> >> bad
> >> *before* the existing products are removed.
> >>
> >> If I look at the .msi generated with Orca I see that in the
> >> InstallExecuteSequence table
> >>
> >> InstallInitialize 1500
> >> SetProperty 1501
> >> CA_CheckCredentials 1502
> >> RemoveExistingProducts 1503
> >>
> >> This seems like a valid sequence to me but I am obviously missing
> >> something as the warning is there for a purpose.
> >>
> >> -----Original Message-----
> >> From: Christopher Painter [mailto:chr...@deploymentengineering.com]
> >> Sent: Wednesday, March 09, 2011 3:30 PM
> >> To: General discussion for Windows Installer XML toolset.
> >> Subject: Re: [WiX-users] C# Custom Action questions
> >>
> >> If I had to guess you calling this CA as a ControlEvent off a
> >> Dialog / Control in your UI sequence.  Am I correct?  If so, it's a known 
> >> issue
> >> that Msi lacks the ability to process messages in this scenario.   The
> >> workaround is to set a dummy property to see a "PROPERTY CHANGED"
> >> message in the log file where the value is the data you are trying
> >> to
> log.
> >>
> >> Chris
> >>
> >> ---
> >> Christopher Painter, Author of Deployment Engineering Blog Have a
> >> hot tip, know a secret or read a really good thread that deserves
> >> attention? E-Mail Me
> >>
> >>
> >>
> >> ----- Original Message ----
> >> From: Kevin Burton <kev...@buyseasons.com>
> >> To: General discussion for Windows Installer XML toolset.
> >> <wix-users@lists.sourceforge.net>
> >> Sent: Wed, March 9, 2011 3:24:17 PM
> >> Subject: [WiX-users] C# Custom Action questions
> >>
> >>
> >> I have a very simple C# Custom Action that is supposed to verify
> credentials:
> >>
> >> using Microsoft.Deployment.WindowsInstaller;
> >>
> >> namespace BuySeasons.BsiServices.Install {
> >>     public class CustomActions
> >>     {
> >>         [CustomAction]
> >>         public static ActionResult CheckCredentials(Session session)
> >>         {
> >>             session.Log(string.Format("Begin CheckCredentials -
> >> {0}/{1}", session["SERVICEUSER"], session["SERVICEPASSWORD"]));
> >>             bool valid = false;
> >>             using (PrincipalContext context = new
> >> PrincipalContext(ContextType.Domain, "ASGARD"))
> >>             {
> >>                 valid =
> >> context.ValidateCredentials(session["SERVICEUSER"],
> >> session["SERVICEPASSWORD"]);
> >>             }
> >>             if(valid)
> >>                 return ActionResult.Success;
> >>             else
> >>                 return ActionResult.Failure;
> >>         }
> >>     }
> >> }
> >> It is included in the WiX Product as
> >>
> >>     <Binary Id="CustomActionsDLL"
> >>
> >> SourceFile="C:\Projects\....\bin\$(var.Configuration)\BrainCustomAc
> >> ti
> >> o
> >> ns.C
> >> A.dll"
> >> />
> >>
> >>     <CustomAction Id="CA_CheckCredentials"
> >>                   Return="check"
> >>                   Execute="deferred"
> >>                   BinaryKey="CustomActionsDLL"
> >>                   DllEntry="CheckCredentials"/>
> >>
> >> And scheduled as:
> >>
> >>     <InstallExecuteSequence>
> >>       <Custom Action="CA_CheckCredentials" After="InstallInitialize"
> >> />
> >>     </InstallExecuteSequence>
> >>
> >> This all compiles to a .msi without error. I can see
> >> CA_CheckCredentials in Orca just where I want it. But it doesn't
> >> seem to be called. I look at the verbose log and the closest
> >> reference I see
> is:
> >>
> >> Action start 14:56:05: InstallInitialize.
> >> MSI (s) (B0:4C) [14:56:06:052]: Doing action: CA_CheckCredentials
> >> MSI
> >> (s)
> >> (B0:4C) [14:56:06:052]: Note: 1: 2205 2:  3: ActionText
> >>
> >> I don't see the string 'Begin CheckCredentials' as in the code above.
> >> What do you think I have done wrong?
> >>
> >> -------------------------------------------------------------------
> >> --
> >> -
> >> --------
> >> Colocation vs. Managed Hosting
> >> A question and answer guide to determining the best fit for your
> >> organization - today and in the future.
> >> http://p.sf.net/sfu/internap-sfd2d
> >> _______________________________________________
> >> WiX-users mailing list
> >> WiX-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wix-users
> >>
> >>
> >>
> >>
> >>
> >> -------------------------------------------------------------------
> >> --
> >> -
> >> --------
> >> Colocation vs. Managed Hosting
> >> A question and answer guide to determining the best fit for your
> >> organization - today and in the future.
> >> http://p.sf.net/sfu/internap-sfd2d
> >> _______________________________________________
> >> WiX-users mailing list
> >> WiX-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wix-users
> >>
> >> -------------------------------------------------------------------
> >> --
> >> -
> >> --------
> >> Colocation vs. Managed Hosting
> >> A question and answer guide to determining the best fit for your
> >> organization - today and in the future.
> >> http://p.sf.net/sfu/internap-sfd2d
> >> _______________________________________________
> >> WiX-users mailing list
> >> WiX-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> ----------------------------------------------------------------------
> --------
> > Colocation vs. Managed Hosting
> > A question and answer guide to determining the best fit for your
> organization - today and in the future.
> > http://p.sf.net/sfu/internap-sfd2d
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> ----------------------------------------------------------------------
> --------
> > Colocation vs. Managed Hosting
> > A question and answer guide to determining the best fit for your
> > organization - today and in the future.
> > http://p.sf.net/sfu/internap-sfd2d
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> ----------------------------------------------------------------------
> --------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit for your
> organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> ----------------------------------------------------------------------
> --------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit for your
> organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - 
today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - 
today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - 
today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - 
today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to