cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Jeppebm
Level 3

ICACLS fails on Windows temp folder

Hi,

I am running a custom action setting folder permissions on the windows temp directory. This is my command:

icacls.exe %WINDIR%\Temp /grant "NETWORK SERVICE":RD

The installer fails with error 1722 on some systems:

Note: 1: 1722 2: SetFolderPerms 3: C:\Windows\SysWOW64\ 4: "C:\Windows\SysWOW64\cmd.exe" /c "C:\Program Files (x86)\MYPROGRAM\SetFolderPermissions.bat"

Running the installer from the command prompt sometimes resolves the problem, which leads me to believe that the installer needs Administrative rights to succeed, but I am not sure.

What could be the cause, and what should I do to resolve it.

I will buy a fictive beer for whoever saves my behind 🙂
Thank you!
Labels (1)
0 Kudos
(1) Reply
TsungH
Level 12

UI Sequenec and Immediate Execute Sequence don't get privilege elevation. Set your custom action to run in Deferred (Execute) Sequence. Or set it to Deferred (Execute) Sequence in System Context if it should run without impersonation. For further explanation, please refer to Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer.
0 Kudos