?
Solved

Vista and XP permissions problem

Posted on 2009-04-06
5
Medium Priority
?
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
CraigLazar earned 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

752 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