Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vista & C# - Drag & Drop problem (not related to elevation)

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?

like image 473
Dejan Vesic Avatar asked Mar 02 '09 07:03

Dejan Vesic


People also ask

What is the full meaning of Vista?

Definition of vistaa view or prospect, especially one seen through a long, narrow avenue or passage, as between rows of trees or houses. such an avenue or passage, especially when formally planned. a far-reaching mental view: vistas of the future.

What does Vista mean in US history?

Table of Contents. Volunteers in Service to America (VISTA), American governmental organization (created 1964) that placed volunteers throughout the United States to help fight poverty through work on community projects with various organizations, communities, and individuals.

What does New Vista mean?

a situation which seems to make it possible for particular things to happen or exist. The end of communism opened up new vistas for investment. Synonyms and related words. Opportunities. opportunity.

What does Vista mean in science?

Natural selection is a simple mechanism that causes populations of living things to change over time. In fact, it is so simple that it can be broken down into five basic steps, abbreviated here as VISTA: Variation, Inheritance, Selection, Time and Adaptation.


1 Answers

You have two questions here:

  1. 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.

  1. 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);
    }
like image 197
csharptest.net Avatar answered Oct 03 '22 07:10

csharptest.net