3
Answers

How to set folder security permissions during installation

Photo of James Robertson

James Robertson

16y
11.6k
1

Hi all,

I hope this is in the right category.  I have an application that I created which creates new folders under the install path:

'C:\Program Files\My Application\'  and updates / deletes / installs files into.

Of course, whenever the program is run and any of these activities are attempted an access is denied message is shown.  My question is how can I change the permissions for this folder on installation so all users can do these operations.  I should also add that I'm kind of new to Windows development - any help would be greatly appreciated!

Answers (3)

1
Photo of Ravi Sangtani
NA 806 6k 7y
Hi! try this one
  1. bool isfound = false;  
  2. for (int i = 0; i < allstd.Length; i++)  
  3. {  
  4. isfound = false;  
  5. for (int j = 0; j < present.Length; j++)  
  6. {  
  7. if (allstd[i] == present[j])  
  8. {  
  9. isfound = true;  
  10. break;  
  11. }  
  12. }  
  13. if (!isfound)  
  14. {  
  15. MessageBox.Show(allstd[i]);  
  16. }  
  17. }