VS2010, VB.NET and Windows 7 Access Denied on writing to or creating files in Project Files folder

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Ok I know this question has been asked to death but I still have not seen a good answer. I have created an application in VS2010 using VB.NET. In my application I have an error log that is an XML file located in the

<pre class="prettyprint lang-vb Public gstLocalErrorLogLocation As String = Application.StartupPath & "ErrorLog"[/code]
that gets written to in the event of an error so I can trouble shoot application easier. My application also downloads files from our FTP site and puts the files in

<pre class="prettyprint lang-vb Public gstLocalDownloadLocation As String = Application.StartupPath & "download"[/code]
So I have files that get read and written to as well and created and deleted all in the Application.StartupPath which is either "c:Program Files(Application Directory)(Some Directory)(Some File)" or "c:Program Files (x86)(Application Directory)(Some
Directory)(Some File)" depending on 32bit or 64bit Windows 7.
After creating the setup I install it on my test machine that have both Windows 7 32bit and 64bit. Everything in the application works great till I have to write to, delete or creat a file in those directories above. I know it is an access issue and the
UAC. This will get installed on numerous systems so the options I have seen to change file or folder permission on the computers manually is not an option. What has to happen is after I install the application it just works like when you install it on XP.
Some post have suggested that you us a user with administrator privilages or group which is all fine and dandy but the user I have used to test the application has all of that.

So what I am asking is how do you create an application with VS2010 in VB.NET that after creating a setup package and installing on Windows 7 will just work with out "Access to the path c:Program Files(Application Directory)(Some Directory)(Some File)
is denied." If I have to install this on 100 Windows 7 computers it has to be a concreate no manually doing anything just install and work like when we installed on XP.
<hr class="sig George - www.ipdg3.com

View the full article
 
Back
Top