Reputation: 61
Application in question is .Net 2.0 Framework WinForms. It is supposed to work on large user base (installation from CD). Installation done using InnoSetup.
On two machines, application does not accept Drag & Drop (both application and source of D&D have same elevation level).
By adding Read & Read&Execute rights to INTERACTIVE SID for application shortcut, this problem appears to be solved.
Question: how adding those rights and D&D are related and how to check / set those rights in Installation process?
Upvotes: 6
Views: 1278
Reputation:
You should run the exe file for the project directly and outside of the environment of Visual Studio. I'm working on a Windows Vista platform.
Upvotes: 0
Reputation: 64248
You have two questions here:
- how adding those rights and D&D are related and ...
This I'm totally unsure about. We use D&D in our WinForm app to/from the shell and Outlook without any issues in Vista. I'm not even certain the ACL change you suggest will be certain to fix whatever issue your having.
- how to check / set those rights in Installation process?
The easy way to do this is to create a .Net install class and add the following code:
public static void ReplacePermissions(string filepath, WellKnownSidType sidType, FileSystemRights allow)
{
FileSecurity sec = File.GetAccessControl(filepath);
SecurityIdentifier sid = new SecurityIdentifier(sidType, null);
sec.PurgeAccessRules(sid); //remove existing
sec.AddAccessRule(new FileSystemAccessRule(sid, allow, AccessControlType.Allow));
File.SetAccessControl(filepath, sec);
}
Upvotes: 1
Reputation: 5256
Just a shot in the dark, but is the [STAThread] attribute present on your application's Main() method? Without it, drag and drop won't work at all. (Although this fails to explain the change in behavior with the change of rights on INTERACTIVE SID).
Upvotes: 0