03-28-2023 04:53 PM
I have a package that installs an UDL file under %ProgramData%. The original UDL file has user permissions set to Full Control. When the UDL file is installed as part of the package it ends up with user permissions of Read & execute/Read. My program (running as User) gets a file I/O error when trying to update this file. With the old school (not the future) installer file permissions could be set. Is it possible to do the same with Package Builder?
Solved! Go to Solution.
03-28-2023 09:43 PM
cmd.exe
/c cacls.exe ""%ProgramData%\<RestOfPathToFile>" /E /G "<UserName>":F"
You should be able to use any of the Installation Target Roots for File Packages values with surrounding "%" characters as documented in the NI Package Manager help.
03-29-2023 09:50 AM
Thank you. Your suggestions works, but after reading that Microsoft is deprecating cacls I modified the Custom Executes to use icacls. With icacls I was able to set permissions for my entire directory with a single command.
/c icacls.exe "%ProgramData%\...\Configuration Files" /grant:r Users:F /t /c
:r Replace attributes
:F Full Access
/t Changes ACLs of specified files in the current directory and all subdirectories.
/c Continues the operation despite any file errors