Solved

Vista and XP permissions problem

Posted on 2009-04-06
5
312 Views
Last Modified: 2012-08-14
How do you make sure the installation directory allows writing by the user?  How can you make sure to change the settings in a Deployment project?
0
Comment
Question by:ddepuemd
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
CraigLazar earned 500 total points
ID: 24078134
Hi,
I think the machine must have admin writes in order to install applications especially any adjustments to the registry. Most installs effect the registry,
 
0
 

Author Comment

by:ddepuemd
ID: 24078364
I have tried this:

 Dim CurrentPath as String = "C:\TestPath"
 Dim UserName as String = system.environment.username
 
 Dim dInfo As New DirectoryInfo(CurrentPath)
 Dim dSecInfo As DirectorySecurity = dInfo.GetAccessControl(AccessControlSections.Access)
 Dim myRuleValue As Integer = 0
 
 myRuleValue =  FileSystemRights.FullControl   'Add your wanted Access here
 Dim myRule as FileSystemAccessRule
 myRule = New FileSystemAccessRule(UserName myRuleValue, InheritanceFlags.ContainerInherit Or InheritanceFlags.ObjectInherit Or InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)
 dSecInfo.AddAccessRule(myRule)
 dSecInfo.SetAccessRule(myRule)
 dInfo.SetAccessControl(dSecInfo)

but it fails because it is not giving permission for the function to set the rule.  Any ideas on how to set the rule as administrator???
0
 

Author Comment

by:ddepuemd
ID: 24078413
currentpath should have been curdir()
0
 

Author Comment

by:ddepuemd
ID: 24097320
I've modified the code to write that database to the users directory instead of program files...
0
 
LVL 4

Expert Comment

by:CraigLazar
ID: 24097746
good stuff well done, :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create a form which is copy of a form in vb.net 2 34
VB.Net - For Loop Error 5 37
Closing all open child forms. 4 38
Advice in Xamarin 21 56
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now