To elaborate more on my problem with some code sample:

I have username and domain fields on UI dialog and I want to check if the
user exists in the domain before the installation continues any further. So,
in the Finish control of dialog, I inserted events to run CustomActions as
shown below. To

<Control Id="Finish" Type="PushButton" X="236" Y="323" Width="56"
Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" >
          <Publish Event="DoAction" Value="RunUserCheck"
Order="1"></Publish>
          <Publish Event="DoAction" Value="CheckUserExistsCA"
Order="2"></Publish>
          <Publish Event="SpawnDialog" Value="UserMissingDlg">Not
UserFound</Publish> 
          <Publish Event="EndDialog" Value="Return">UserFound</Publish>
        </Control>

Here are the custom action definitions

    <CustomAction Id="RunUserCheck" Execute="immediate"
Property="CheckUserExistsCA" Value="&quot;[POWERSHELLEXE]&quot;
-ExecutionPolicy RemoteSigned -NoProfile -NoExit -Command {import-Module
ActiveDirectory; $a=&quot;&quot; ; try{$a=get-ADUser
&quot;[IAMUSERNAME]&quot;}catch{};"/>
    <CustomAction Id="CheckUserExistsCA" BinaryKey="WixCA"
DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>


I am not scheduling these custom actions anywhere in <InstallUISequence>
which is correct I presume.

In one of the posts, I read that the validation custom action should not be
"deferred" and should be "immediate". but I cannot do this, because of the
syntax of property usage.

Can someone help in fixing the code to validate a user's existence in
domain.

thanks,
sangeeta
-- 
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Check-if-user-exists-in-UI-tp5829564p5832104.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to