Archive: ProgramData Windows 8


ProgramData Windows 8
Hello,

my installer use the "C:\ProgramData" folder to install files for all users. But in Windows 8 NSIS do not write to this folder. I use:


StrCpy $0 "FoxBurner"
; Retrieving CommonApplicationData path (in $1)
System::Call "shfolder::SHGetFolderPath(i $HWNDPARENT, i 0x0023, i 0, i 0, t.r1)"
StrCpy $APPLICATION_COMMON_FOXBURNER_FOLDER "$1\$0"

CreateDirectory $APPLICATION_COMMON_FOXBURNER_FOLDER
# Make the directory "$APPLICATION_COMMON_FOLDER\application name" read write delete accessible by all users
; SID instead of BU as users (it works also on Windows 2000)
AccessControl::GrantOnFile \
"$APPLICATION_COMMON_FOXBURNER_FOLDER" "(S-1-5-32-545)" "FullAccess + GenericRead + GenericWrite + Delete + AddFile"



On Windows 8 this C:\ProgramData only contains a "Microsoft" subfolder but none of the folder I install. Any ideas?
BTW: On Vista/XP/Windows7 everything works fine.

Ingo

My code looks like this:


!define CSIDL_COMMON_APPDATA 0x0023
Var AppDataPath
System::Call "shell32::SHGetFolderPath(0, i ${CSIDL_COMMON_APPDATA}, 0, 0, t .r1)"
StrCpy $AppDataPath "$1\${PRODUCT_PUBLISHER}\${PRODUCT_NAME}"
CreateDirectory "$AppDataPath"
AccessControl::GrantOnFile "$AppDataPath" "(BU)" "GenericRead + GenericWrite"

Works as expected.

If everyone needs write access to something in a common folder you probably have a design (and security) issue in your application.

Also, why not just use setshellvarcontext all?