Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > Problem with setup on WIndows Vista
 

Problem with setup on WIndows Vista

I have a VB2008 application that uses the Windows installer. Things work fine on Windows 2000 and XP. With Vista we have two problems. 1) we get an "Unauthorized Access Exception...access to path is denied" error when trying to write a file to the application directory (located inProgramFiles), and 2) theapplication cannot find the required DLLs - we get an "Unable to load DLL ... specifried module could not be found" error. The DLLs are installed in a /BIN subdirectory of the application folder in ProgramFiles. And yes, they are actually installed there.

I understand there is 'virtual' file writing now in Vista, supposedly as a security feature. So where should we be placing user data files, if not in ProgramFiles? And remember, we want this to work in Windows 2000 and XP (and hopefully W7).

And why can't the application see the DLLs?

thanks,
dave
Dave163  Monday, November 30, 2009 1:49 PM
So where should we be placing user data files, if not in ProgramFiles? And remember, we want this to work in Windows 2000 and XP (and hopefully W7).
Take a look here: http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/a64c14a0-3749-4361-bfba-4ac305d71d4c


And why can't the application see the DLLs?
Take a look here: http://kalpeshshirodker.wordpress.com/2007/09/06/specify-where-to-look-for-referenced-assemblies-in-c-application/its notVB but i guess its the same.
If you have got questions about this, just ask.
Mark the thread as answered if the answer helps you. This helps others who have the same problem !
C# to VB.NET: http://www.developerfusion.com/tools/convert/csharp-to-vb/
Heslacher  Monday, November 30, 2009 3:22 PM
Thanks, but neither of those articles was of direct help. Relative to the first question, I do not hard-code the directory name. I use My.Application.info.DirectoryPath, which works fine on Windows 2000 and XP machines. In terms of the problem with the DLLs, the article listed was for C++, and was not helpful. The question is simple: where should the DLLs be installed so that the application can find and use them under any Windows system?
Dave163  18 hours 35 minutes ago

In Vista/Win 7 you need to store your data in a folder inside:

either Drive:\Documents and setting\Username\Application Data\YourApplicationFolder\

or Drive:\Documents and setting\All Users\Application Data\YourApplicationFolder\

to get the Foldername you can use the following codesnippet ( it works in XP for sure ):

        Dim ForCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
        Dim ForAllUsers As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)

and for the Dll, that has been a C# article and it is the same for VB.NET.

So if your application is located in:

C:\blabla\MyApplication.Exe

and your DLL which is referenced by your application, is named MyDLL.DLL then you need to put it either in

C:\blabla\MyDLL.DLL

or

C:\blabla\MyDLL\MyDLL.DLL



If you have got questions about this, just ask.
Mark the thread as answered if the answer helps you. This helps others who have the same problem !
C# to VB.NET: http://www.developerfusion.com/tools/convert/csharp-to-vb/
Heslacher  17 hours 58 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• serial port problem
• Make my application appear above taskbar?
• Arrays of controls at design time
• Non-English Characters
• I need help with my calculate function
• ExtFloodFill
• HashMaps in VB
• Multi Column in Combo Box
• How to implement resizing handles using the Graphics object
• How to I add the hex value "1A" to a string