Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm working with WPF project.I want to know can i give admin privileges to application folder when creating windows installer

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
193 views
Welcome To Ask or Share your Answers For Others

1 Answer

You may need to clarify your question. There is some overlap here with Stein's answer, but to expand...

Folders do not get administrative privileges. Programs can get elevated privileges. Folders can have access rights that make them more (or less) accessible to programs with various privileges. Therefore:

  1. If you want the installer to somehow enable your program to run as administrator (elevated), then the installer cannot do this. The program itself needs an elevation manifest which requests elevation to administrator privilege, which means that ordinary limited users cannot run it.

  2. If the issue is that you have (or want to create) data files in the Program Files folder and your application cannot write to them when limited users run it, then the program is storing these files in the wrong location. Folders have names such as User's Application Data because that's what they are supposed to be used for. Changing the security of the Program Files folder containing your program code is generally considered insecure because limited users can then change your code files. The certification rules are a useful guideline:

"10.3 Your app data, which must be shared among users on the computer, should be stored within ProgramData

10.4 Your app’s data that is exclusive to a specific user and that is not to be shared with other users of the computer, must be stored in Users\AppData"

You haven't said what tool you are using to create your MSI file, that might be useful to know if you have further questions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...