Creating an install file

dougan778

New member
Joined
Jul 17, 2006
Messages
2
Programming Experience
Beginner
Hello,

I recently wrote an application for my work in VB .NET 2005. It's our first program in .NET 2005 so our knowledge base about the workings of the IDE is rather limited.

Anyway, the program needs to be installed in multiple locations that don't currently have the .NET 2.0 framework installed (and are not connected to the internet, but they are connected to our intranet). It includes some dll libraries as well (namely MySQL connector/NET). I've looked at setup projects, and also looked at publishing, and I know my problem's solution is somewhere in there, but it is all way too cumbersome to a VB 2005 newbie like myself.

When I publish it, I am able to install it on the remote computer, but the problem is that the program uses several .xml settings files, and when I publish it, it appears to not install to an installation path, instead, it gives me something that I would think behaves similarly to a .jar file. When I run it from the start menu, it appears to load the program into a folder named by a seemingly random jumble of characters. I guess what I'm looking for is a way to install it to a standard directory (ie C:\Program Files\*) so the XML files are always in the same spot when the program is run- publishing seems to move the program around every time it is run. I guess I could just put the XML files in a special folder (ie C:\programsettings\*) and hardcode that into the program, but given the multiple situations that this will be installed in, I see that being a bad idea.

So, I need a way to install it to a standard directory, while being able to package along the dotnetfx.exe file to install the .net 2.0 framework, as well as packaging any necessary .dll files and my .xml settings files. In VB6 it was pretty simple, and I'm sure it is in VB 2005 as well, I just can't seem to figure out how.

So, if anybody can help to point me in the right direction, I would appreciate it.

~Scott Degen
 
I haven't created a Setup project in VS 2005 yet but if it's anything like 2003 it should include the Framework redistributable in the output by default. You should add all your XML files to your application project and set their Build Action to Content. Now when you create your Setup project you just have to add two project outputs to it: the Primary Output and the Content from your application. The Primary Output will include the executable and any libraries that it depends on. The Content will include your XML files and any other files marked as Content. You then just work through each page of the Setup project and set properties as required. When you build it it will create an MSI file, a Setup.exe, the Framework redistributable and a couple of others.

Having said that, publishing your app shouldn't cause an issue with your XML files. If you use Application.StartupPath within your code it will give you the path of the folder from which your application was run, no matter where that is.
 
Back
Top