I'm creating a deployment project for a windows application created in C#. I'm added a checkbox user interface dialog and one of the properties is named SENDMAIL. I've created a custom action class (installer class) within a stand alone assembly which does some actions according to the checked state of SENDMAIL.
On the Custom Action screen of the installation project, I've added the CustomActionData as "/SENDMAIL=[SENDMAIL]". When I use the following code Context.IsParameterTrue("SENDMAIL"), it ALWAYS returns true, no matter if the checkbox is checked or not.
The reason for this is that when the installer runs and I check the box it is passing in the parameters "/SENDMAIL=1" which is a true value. When I uncheck the box, the installer passes in "/SENDMAIL=" which equates to an empty string. According the the IsParameterTrue documentation, an empty string, "true", "1" or "yes" constitutes a true value, everything else is false. Why is the installer passing in an empty string for an unchecked checkbox as opposed to null, "off", "no", "0"... anything but an empty string? I've also checked a parameter passed in by the installer itself with no help from the user "LogToConsole" and it comes out null, which returns false. So why are my parameters comming up incorrect? Any ideas?
Best regards,
Akusei
On the Custom Action screen of the installation project, I've added the CustomActionData as "/SENDMAIL=[SENDMAIL]". When I use the following code Context.IsParameterTrue("SENDMAIL"), it ALWAYS returns true, no matter if the checkbox is checked or not.
The reason for this is that when the installer runs and I check the box it is passing in the parameters "/SENDMAIL=1" which is a true value. When I uncheck the box, the installer passes in "/SENDMAIL=" which equates to an empty string. According the the IsParameterTrue documentation, an empty string, "true", "1" or "yes" constitutes a true value, everything else is false. Why is the installer passing in an empty string for an unchecked checkbox as opposed to null, "off", "no", "0"... anything but an empty string? I've also checked a parameter passed in by the installer itself with no help from the user "LogToConsole" and it comes out null, which returns false. So why are my parameters comming up incorrect? Any ideas?
Best regards,
Akusei