Hi There.

I'm fairly new to vb.net, and i've been battling with this for ages and ages. Up and till a point where i wanted to slit my wrists.

I scouted all over google, and i still couldn't find any solution. So i'm really hoping you guys can help me out here. I'd really appreciate it.

I've got a few files i need to include with my vb application in order to have it work sufficiently and without error. I've got an mdb database, a few text files and a few dll files.

Now, my first problem is, that when i build and run the application, everything works great; exactly as it should. But when i publish my vb application, run the setup file, and then run the app, i get the following error: System.Data.OleDb.OleDbException: Could not find file 'C:\Users\admin`\AppData\Local\Apps\2.0\RG2AM4KN.N3Q\1QVM5LL9.GOO\test..tion_9fa9db93dabd8b22_0001.0000_67986ff05357f122\database.mdb' Appart from the file not existing, why does my application install to the AppData directory?

Isn't there a way i can have my application installed to the C:\Program Files directory instead?

That's the main issue i want to be able to sort at the moment, with the help of you guys.

So please, if possible, i'd really appreciate it if someone can help me out here.

Thank you in advance


what installer?>.Net Deployment and package?

what installer?>.Net Deployment and package?

Thank you for your reply Jx_Man.

It's not an installer as such, it's the setup.exe file of my application after i published it.

Then, when i double-click the setup file, the .NET framework says "Verifying Requirements. Please wait...".

But, overall, that's not the issue. When i click that setup file, it installs my application to the AppData directory, in which case I'd like my application to install in the Program Files directory as per default.

How am i able to change the install path of my project, so that when i publish my application, it should install my application to the C:\Program Files directory?

The default installing path is [program files folder]\[product name] if you create a setup with Net Deployment and package without change the default path.
You can see the path in DefaultLocation properties of Application Folder. you can set application installing path there.

If you find out how to change the default installation path let me know, I would like to install my app to the program files folder as well.

As for your datafile issue, I was experiencing the same issue until I did this.

This is Visual Basic 2008 Express Edition.

Goto: My Project
Goto: Publish
Click Application Files
Select all of your database files and files associated with it and change it to Data File.

Now publish your application and install it and see what happens.


I myself, had had the same problem with this, after digging around, i discovered that the "setup.exe" is not a real setup file, all it does is copy all the files to the LocalData/AppData folder. I also found, that since the publish option is an option integrated into the compiler, there is no way to edit the script. I also found that there is a program called Inno Setup.iss that you run the wizard and put in all the program information with links to the main exe and all files to include, and it builds an actual installer with all options including text to show before and after setup, as well as changing the instalation directory and so on.
Happy Programing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.