This is the code before files are installed to these folders. The files that are installed can be read, but not modified by even the Admin account that installed the app. What am I doing wrong?
Create Folder $APPDATAALL$\\Railcar Tracking Co
Create Folder $APPDATAALL$\\Railcar Tracking Co\\RMS
Create Folder $APPDATAALL$\\Railcar Tracking Co\\RMS\\FlatFiles
Apply Install (get result into variable SUCCESS)
if Variable SUCCESS not Equals ERROR
if Variable SUCCESS not Equals CANCEL
Grant Complete Access to File System Object "$APPDATAALL$\\Railcar Tracking Co\\RMS"
Grant Complete Access to File System Object "$APPDATAALL$\\Railcar Tracking Co\\RMS\\FlatFiles"
Grant Complete Access to Folder Share "$APPDATAALL$\\Railcar Tracking Co\\RMS"
Grant Complete Access to Folder Share "$APPDATAALL$\\Railcar Tracking Co\\RMS\\FlatFiles"
Apply Install (get result into variable SUCCESS)
end
end
I am not sure if this will work but try it. Your code seems to be right, except for one thing. Please remove all back slashes from the paths after the $APPDATAALL$ variable .
What you can do is pre-create the folder using the Call DLL Function plug-in command, and tapping into the CreateDirectoryA Win32 API in kernel32.dll. Just pass $TARGETDIR$ as the folder parameter and null as the second parameter. And then set the access control in the next line of your script. Be sure to do this all before you call Apply Install.
Also, when setting the permissions, make sure to eliminate the back slashes as I told you before. I hope this helped.
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
I didn't try that method because the person who was being helped tried that method and it didn't create the folder.
Anyway, I tried that method, and I couldn't get it to create the folder either. This is not really the issue, the Create Folder command creates the folder just fine, the problem is with the Set Access Control command - it doesn't seem to properly set the security and permissions for the folder.
Is there an order that needs to be followed? For example, do I need to Grant Complete Access to Folder Share before setting Grant Complete Access to File System Object?
I've done some experimenting and found that it seems that the Create Share command is required to make the folder a share, then you can grant the permissions and security. So I create the folder; make the folder a share; grant access to the share; grant access to the folder.
After running this code, the folder properties Sharing tab shows the correct Share name, permissions for Everyone with Full Control. It shows on the Security tab Everyone has Full Control permissions. However, the ini file that is installed into the folder during installation cannot be modified by an Administrator. Plus, the ini file cannot even be opened by a Limited User.
Create Folder $ALLAPPDATA$Railcar Tracking Co\\RMS\ Apply Install (get result into variable SUCCESS)
Share Folder $ALLAPPDATA$Railcar Tracking Co\\RMS\\ as "RMSShare" (RMSShare)
Apply Install (get result into variable SUCCESS)
Grant Complete Access to Folder Share "RMSShare"
Apply Install (get result into variable SUCCESS)
Grant Complete Access to File System Object "$ALLAPPDATA$Railcar Tracking Co\\RMS\\"
Apply Install (get result into variable SUCCESS)