cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

XCopyFile fails if UAC enabled - Help

I have a Basic MSI I'm installing on Windows 7. I have Require Administrative Privileges set to yes, so only someone with admin rights can install. I have a custom action that uses XCopyFile to copy a file. When UAC is enabled, this action fails and the file is not copied over. If i turn off UAC, it works like a charm.

I'm installing as a user with admin rights, so why is XCopyFile failing with UAC turned on, even at the second lowest setting? I'm not even getting prompted by UAC, the call just returns a failed result.
Labels (1)
0 Kudos
(4) Replies
TsungH
Level 12

Where in sequence is your custom action scheduled? Is your installer using setup.exe?
0 Kudos
anom217
Level 8

Due to client requirements, I don't have a setup.exe and am launching straight from the MSI.

I run into this issue with all of my CA's scheduled anywhere in the sequence. I did find a way to force my CA's to work by calling them as Deferred in System Context rather than just Deferred. There is no option to do this for immediate actions though, so that's still an issue getting some of them to execute correctly.

Also, any files I install manually through a CA don't have proper permissions. When I try to modify them after install, I get access denied errors, and have to manually change the permissions.
0 Kudos
TsungH
Level 12

Installation is not supposed to make changes to the system during UI Sequence and Immediate Execute Sequence, since there is no rollback when there is an error or user cancels installation. Also, there is no elevation of privileges (please refer to Installation Mechanism). Hence, those system-changing custom actions should be scheduled only in Deferred Execute Sequence and paired with their corresponding rollback custom action.

I would expect files copied by Deferred Custom Action in System Context, i.e., without impersonation, would be owned by SYSTEM.
0 Kudos
anom217
Level 8

I have a CA that sets file permissions on my install destination. It gives full rights to the Everyone group. After installation, I looked at the Security tab on some of my installed files, and the Everyone group was there and set correctly. But I still couldn't edit the files, still got access denied. When I disabled the UAC I was then able to access everything fine.
0 Kudos