Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a program/installation package that needs Admin rights

I have created a program in C# with Visual Studio 2008.

I can package it as a .msi file, which installs just fine. However, when installed, for instance, in the Program Files (x86) folder, which is the default, it can't write to the .xml file that's included (using .xml for settings and small storage). It only works when running as Administrator.

My question is, how do you build your Setup and Deployment so that it gets Admin rights automatically instead of needing user compatibility setup?

like image 545
user3215251 Avatar asked Oct 25 '25 21:10

user3215251


1 Answers

Its not recommended by microsoft to place any user files in the programFiles directory, it doesn't belong there.

Instead write those files in the ProgramData folder.

EDIT: A fast search found a duplicate question and answer here

like image 85
Ezi Avatar answered Oct 27 '25 11:10

Ezi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!