[RESOLVED] Installer Problem
I made a program and made setup file using VB6 Package and Deployment Wizard. My program runs fine without any bug when I run from project. But if I install it, then after running the program it says "Runtime Error 53. File not found". I made setupfile with all default setting. What is the solution?
Re: [RESOLVED] Installer Problem
how did u solved it? Cause im getting a "File not found" error and i am running the .exe on the computer that I used for my project. But my codes links to a SQL database...will that be the problem?
Re: [RESOLVED] Installer Problem
That's pretty strange because PDW doesn't create a single exe to deploy... So what exe are you moving?
and if you just moved the setup.exe file I can understand why you are getting that error.
Re: [RESOLVED] Installer Problem
PDW created a setup.exe, .CAB file, setup.lst abd a support folder. After I run the setup.exe and installed to my target directory, it have a single .exe file and a log document. It is when I know run the .exe file the error of file not found comes in
Re: [RESOLVED] Installer Problem
Did you install all the dependencies for you project also?
Have you hardcoded paths?
Re: [RESOLVED] Installer Problem
You have to know what files your program is looking for. Have you checked those locations?
Re: [RESOLVED] Installer Problem
sorry I don't quite understand what you mean by
"Did you install all the dependencies for you project also?
Have you hardcoded paths?"
This is my first time using PDW and VB so I just followed the "default" installation. The file error doesn't tell me which file I am missing. All that it shows is
"Run-time error '53':
File not found"
But as Rob mentioned in previous post about hardcode path or file reference path. I do have certain file paths for input and output but those i use AppPath and as mentioned I have connection with SQL in my program. :sick:
I just tried to run PDW again for my project and this time it gave me a shfolder.dll is being used by other program or something and I again still have the same error when I try to run the program that I installed
Re: [RESOLVED] Installer Problem
Hi ah_1026, I am sorry for this late reply. I was outside. Anyway, the solution is v much simple. In my code, I used
Code:
Open (File1.List(i)) For Input As #1
Now File1.List(i) will return the file name, not the whole path as "file1" is a filelistbox. So just use
Code:
Open (location.Text & "\" & File1.List(i)) For Input As #1
instead and the problem will be solved.
Remember, "location" is the text box where the folder location of the files are written, like
Code:
file1.path=loaction.text
Re: [RESOLVED] Installer Problem
To randem,
I told about moving the exe file created after installation, not the setup file. This PDW will create only 3 files, but after setup, it'll create only one exe file (forget about that log file). As previously I used
Code:
Open (File1.List(i)) For Input As #1
, which has no path, only file name, VB will search that file at app.path. That's why, when I move the exe file (which creates after install) to the app.path (where the text files resides), it works.
Anyway, here is the full code after correction, I have two textbox controls ("location" and "output"), two command button controls ("Command1" and "Command2") in my form
Code:
Option Explicit
Private Sub Command1_Click()
On Error GoTo err
If Len(location.Text) = False Or Len(output.Text) = False Then
MsgBox "fill input and output location"
Exit Sub
End If
File1.Path = location.Text & "\"
File1.Pattern = "*.txt"
Dim destFile As String
destFile = location.Text & "\" & output.Text & ".txt"
Dim i As Long
Dim currentLine As String
Open (destFile) For Append As #2
For i = 0 To File1.ListCount - 1
Open (location.Text & "\" & File1.List(i)) For Input As #1
If i > 0 Then Line Input #1, currentLine
Do Until EOF(1)
Line Input #1, currentLine
Print #2, currentLine
Loop
Close #1
Next i
Close #2
Dim absname As String
Dim pat As String
Dim oApp As Excel.Application
Dim oWB As Excel.Workbook
Set oApp = New Excel.Application
Set oWB = oApp.Workbooks.Add
pat = location.Text & "\" & output.Text & ".txt"
oApp.Workbooks.OpenText FileName:=pat, Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, Tab:=True
Set oWB = oApp.Workbooks(output.Text & ".txt")
oWB.SaveAs FileName:=location.Text & "\" & output.Text & ".xls", FileFormat:=xlWorkbookNormal
oWB.Close SaveChanges:=False
Set oWB = Nothing
oApp.Quit
Set oApp = Nothing
MsgBox "Conversion Completed Succesfully"
err:
End Sub
Private Sub Command2_Click()
On Error GoTo err
Dim shlShell As Variant, shlFolder As Variant
Set shlShell = New Shell32.Shell
Set shlFolder = shlShell.BrowseForFolder(Me.hWnd, "Select a Folder", 1)
Dim savelocation As String
location.Text = shlFolder.Items.Item.Path
err:
End Sub
Re: [RESOLVED] Installer Problem
Bottom line: If you move things you risk errors the app should be installed. If you hardcode locations you app may fail. Things are not at the same place on the target machine. If you do not have all the dependencies your app may fail if those files are not already on the target machine.
If it works on your machine but not on the target machine, one of the above issues is likely the problem.
Re: [RESOLVED] Installer Problem
Yup, you are right. Thats why I correct my code (the last code I posted is the corrected version) so that no movement of files is required.
Re: [RESOLVED] Installer Problem
Why was the app exe not in the app.path to begin with?
Re: [RESOLVED] Installer Problem
Ok, I think I need ti clarify why was I writing this code. I made this program which will merge some tab delimited text files into a excel file. For that
1) I take input for the folder locations of those text files (in "location" text box).
2) Then I read the text(*.txt) file names from that folder through a file-list-box.
3) Then I do the all necessary things.
No, how can I put my app exe in app.path? Because app.path (the folder location) will be selected by the users. Thats why when open text files,
i have to use
vb Code:
Open (location.Text & "\" & File1.List(i)) For Input As #1
instead of
vb Code:
Open (File1.List(i)) For Input As #1
to avoid error.
Re: [RESOLVED] Installer Problem
Ok, I think I need ti clarify why was I writing this code. I made this program which will merge some tab delimited text files into a excel file. For that
1) I take input for the folder locations of those text files (in "location" text box).
2) Then I read the text(*.txt) file names from that folder through a file-list-box.
3) Then I do the all necessary things.
No, how can I put my app exe in app.path? Because app.path (the folder location) will be selected by the users. Thats why when open text files,
i have to use
vb Code:
Open (location.Text & "\" & File1.List(i)) For Input As #1
instead of
vb Code:
Open (File1.List(i)) For Input As #1
to avoid error.
Re: [RESOLVED] Installer Problem
That is the location where you install it... How do you install it to another location?
Re: [RESOLVED] Installer Problem
Either I don't get ur question, or u dont get my point. Sorry for both the cases. Anyway, the point I made is location.Text returns the path you selected after program run. This has no relation with app path or anything. There is a browse button in the form ("command1") and user will select the folder where the text files are in. Now where is the confusion?
Re: [RESOLVED] Installer Problem
Then what was it you had to move to get it to work?
Re: [RESOLVED] Installer Problem
the app exe. I have to move it to the folder where the text files resides so that the selected folder through browse button becomes app.path. Anyway, I pointed that problem and solved that. So, that should be it !
Re: [RESOLVED] Installer Problem
Sorry for trying to help...
Re: [RESOLVED] Installer Problem
hey .. never mind . I am newbie in VB so I may not understand what u tried to tell me. But as I dont have that problem now, we may drop this here. Hope to get ur support in future. Thanx