|
-
Jun 30th, 2005, 09:08 AM
#1
Thread Starter
Member
[RESOLVED] installer problem
I have my completed VB.NET program but in order to make it as generic as possible, I had to copy all of the external files the VB.NET program uses to the bin folder. I created a Windows installer so the program can be distributed. I installed it on a different machine from that which created the program. I tried running it but I get an error message saying it can't find a file needed. Aren't all of the files in the bin folder compiled with the program? If not how do I get them where they are needed? Thanks in advance for the advice!!
Dave
-
Jun 30th, 2005, 09:28 AM
#2
Hyperactive Member
Re: installer problem
You should include a .NET Framework Redistributable package with your program. The computer that you are running it on probably does not have that.
-
Jun 30th, 2005, 09:56 AM
#3
Thread Starter
Member
Re: installer problem
Okay, how do you include the kit? Do you somehow put it in the installer file or is it separate? I take it that the kit can be obtained from Microsoft? Thanks again!
Dave
-
Jun 30th, 2005, 10:00 AM
#4
Fanatic Member
Re: installer problem
I don't think that any files that you've put in the bin folder manually automatically get included in your install.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Jun 30th, 2005, 10:03 AM
#5
Thread Starter
Member
Re: installer problem
If they do not get included automatically and I NEED them to be in the bin folder so they can be found by the program, then what do I have to do?
Dave
-
Jun 30th, 2005, 10:33 AM
#6
Hyperactive Member
Re: installer problem
In the installer be sure to specify all the files you want included... Also when you install your stuff on another computer it's always a good idea to check what the installer copied over...
Here's the link for Redistributable:
Microsoft .NET Framework Version 1.1 Redistributable Package
P.S.: Be sure to install the framework package before you run your program.
-
Jun 30th, 2005, 10:45 AM
#7
Thread Starter
Member
Re: installer problem
Thanks. I will try this out and see if it works.
Dave
-
Jun 30th, 2005, 10:45 AM
#8
Re: installer problem
Also, you can download the bootstrapper plug-in
http://msdn.microsoft.com/vstudio/do.../bootstrapper/
to install the framework when your program loads. It's handy if you're deploying over a network, or on a CD, but if your program is being downloaded, you might just want to use the built in launch condition that points to the web to download the 25 meg dotnetfx.exe framework redistributable.
Bill
-
Jun 30th, 2005, 11:10 AM
#9
Thread Starter
Member
Re: installer problem
Okay, I included all the files in the setup file using the Windows setup wizard. When I run the program after installing, it still cannot find the files. In my VB.NET program I had to put those files in the bin directory so the program could find them without hard coding the directory path. The .NET framework is installed on the computer where I am trying to run the program. Could the problem be with NOT hardcoding the path to the outside files? If so is there a way to tell the .NET program that the files needed are in the directory where the program is running?
Dave
-
Jun 30th, 2005, 11:15 AM
#10
Re: installer problem
Try this:
Right click on your setup project in the solution explorer, and go to add.. then pick the files you need in the working directory. Then, make sure they are under "Application Folder" underneath "File System on target Machine". they should automatically get added.
Bill
-
Jun 30th, 2005, 11:29 AM
#11
Thread Starter
Member
Re: installer problem
They are in a folder called Module Retagetable Folder under the File System on Target Machine. Here is the code for the button that starts the program....
Dim strFlight As String
Dim strArgu As String
Dim strDirectory As String
Dim strVers As String
Dim strProg As String
Dim oProc As New Process
strFlight = LTrim(RTrim(CType(lstFlights.SelectedItem, String)))
If txtPath.Text = "" Then
MessageBox.Show("You must type in the version of Windows you are using in the space provided!!", "Data entry error")
Exit Sub
End If
strVers = UCase(txtPath.Text)
If strVers = "XP" Then
strProg = "cmd"
Else
strProg = "command.com"
End If
If Val(strFlight) < 1060 Then
strDirectory = "ah64a1\"
Else
strDirectory = "ah64a2\"
End If
strArgu = strDirectory & strFlight & "\"
Try
oProc.StartInfo.FileName = strProg
'oProc.StartInfo.Arguments = "/k call " & strPath & "\close.bat " & strPath & "\" & strDirectory & strFlight & "\"
oProc.StartInfo.Arguments = "/k call close.bat " & strDirectory & strFlight & "\"
oProc.Start()
Catch MyError As IOException
MessageBox.Show(MyError.ToString)
MessageBox.Show(MyError.Message)
Finally
End Try
Should the program be finding the files using this code?
Dave
-
Jun 30th, 2005, 11:32 AM
#12
Hyperactive Member
Re: installer problem
you don't have to hardcode that path, you can just do:
Application.StartupPath & "\file.txt"
-
Jun 30th, 2005, 11:36 AM
#13
Thread Starter
Member
Re: installer problem
Do I type that in for each file and will it work with directories? I have two directories included with the program where other files are located.
-
Jun 30th, 2005, 11:37 AM
#14
Thread Starter
Member
Re: installer problem
I am in dire need of a GOOD book that helps with this kind of problem. I am a noob at this so it has to be written for the lowest common denominator. Any suggestions?
-
Jun 30th, 2005, 11:41 AM
#15
Hyperactive Member
Re: installer problem
Application.StartupPath is just the path of your .exe no matter where it is located. And yes you might want to type that in for every time you use a file in the same directory as your exe.
If your exe is here: C:\temp\files\program.exe
and you put something like this in your code: Application.StartupPath & "\whatever\hey.txt"
then it will be the same as: C:\temp\files\whatever\hey.txt
-
Jun 30th, 2005, 11:45 AM
#16
Hyperactive Member
Re: installer problem
I don't have any good book suggestions (migrated from VB6), but try looking at Amazon.com and just read some of the suggestions that other users give. If you want something "for the lowest common denominator" , try Step by Step books...
-
Jun 30th, 2005, 12:18 PM
#17
Thread Starter
Member
Re: installer problem
The Application.StartUpPath is fine but the file it needs is not put in that path by the installer so the program can't find it. The files I need are listed under the Detected Dependencies folder of the Setup folder in Solution Explorer. I also included Debug Symbols, Content Files, Localized resources, and Primary output. I am sure I am overlooking something simple but my ignorance of the syntax is showing. By the way, I program in QuickBasic here at work. We need a simple easy-to-use way to run the QB program which is why I am trying VB.NET.
Dave
Last edited by davros51; Jun 30th, 2005 at 12:32 PM.
-
Jun 30th, 2005, 12:51 PM
#18
Hyperactive Member
Re: installer problem
If you are just using VB .NET to run stuff, have you considered using batch programming instead? (just a suggestion: maybe that'll be more convinient)
-
Jun 30th, 2005, 01:14 PM
#19
Thread Starter
Member
Re: installer problem
The boss wants a GUI to start it up. I don't know why. I guess he is concerned the people using this program are not familiar with DOS. And maybe their computers do not have a DOS base. We are still using Win 98 because everything is either batch or QB. I took VB6 in school but they made us do our final project in VB.NET so I had to learn the language on the fly. Glad I had some exposure but certainly not enough to solve this file problem.
-
Jun 30th, 2005, 02:27 PM
#20
Hyperactive Member
Re: installer problem
Well, you should double check the files and where you are putting them in the setup. Sometimes the smallest bugs are the meanest.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|