Is the CA immediate or deferred? A quick test (printf("%d\n", IsUserAnAdmin());) on my Win7 system shows IsUserAnAdmin (I am) returns false in a normal cmd shell. But if I elevate, then it's true. (This implies your CA is immediate).
Dave ________________________________ From: Lukas Haase <lukasha...@gmx.at> To: wix-users@lists.sourceforge.net Sent: Monday, June 24, 2013 11:17 AM Subject: [WiX-users] Custom Action ALWAYS with admin rights Hi, I have a custom action in a DLL. If I check admin rights in the DLL with IsUserAnAdmin it returns FALSE! The wxs file makes sure that installation can only run with admin privs: <Condition Message="This installation requires admin privileges"> Privileged </Condition> The custom action is included via: <Binary Id='UpdateInstall' SourceFile='UpdateInstall.dll' /> <InstallExecuteSequence> <Custom Action='UpdateInstall' After='InstallFinalize'>NOT Installed</Custom> </InstallExecuteSequence> The UpdateInstall.dll exports UpdateInstall just as: [...] extern "C" UINT __stdcall UpdateInstall(MSIHANDLE hInstall) { if(IsUserAnAdmin()) MsiMessageBox(hInstall, "admin privs", 0); else MsiMessageBox(hInstall, "NO admin privs!!", 0); } Thanks, Luke ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users