|
-
Aug 7th, 2007, 03:30 AM
#1
Thread Starter
Member
[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?
-
Aug 7th, 2007, 03:32 AM
#2
Re: Installer Problem
Depends on what file is not found. Did you add any extra files like a access database or ?
Thread Moved
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 7th, 2007, 03:43 AM
#3
Thread Starter
Member
Re: Installer Problem
No .. Neither I added any extra file, nor I remove anything from the list. And also the msg does not show which file is not found.
-
Aug 7th, 2007, 03:47 AM
#4
Re: Installer Problem
So you are saying that it runs fine on your computer but not wheninstalled on anohter? Does your project have any hard-coded paths or file referenced paths? Usually this is the primary reason as the app cant file some path on the other system as its coded to reflect your system.
If you have any error handling in your app it should tell you what procedure the error in coming from and if you dont then you should add some error handling.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 7th, 2007, 03:57 AM
#5
Thread Starter
Member
Re: Installer Problem
Hi,
after install, if I move the exe file (my program is simple. Only one exe file created after setup. It read and write text file) to the folder where text file is located, then it works. But I cant understand why it happen. I am attaching my code here.
Code:
File1.Path = location.Text & "\" 'File1 is a filelistbox
File1.Pattern = "*.txt"
Dim destFile As String
destFile = location.Text & "\" & output.Text & ".txt"
'location and output are two textboxes
Dim i As Long
Dim currentLine As String
Open (destFile) For Append As #2
For i = 0 To File1.ListCount - 1
Open (File1.List(i)) For Input As #1
Line Input #1, currentLine
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"
-
Aug 7th, 2007, 03:59 AM
#6
Thread Starter
Member
Re: Installer Problem
oops, sorry, I think I got it
-
Aug 10th, 2007, 09:34 PM
#7
Addicted Member
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?
-
Aug 10th, 2007, 10:14 PM
#8
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.
-
Aug 10th, 2007, 10:23 PM
#9
Addicted Member
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
-
Aug 10th, 2007, 10:26 PM
#10
Re: [RESOLVED] Installer Problem
Did you install all the dependencies for you project also?
Have you hardcoded paths?
-
Aug 10th, 2007, 10:29 PM
#11
Re: [RESOLVED] Installer Problem
You have to know what files your program is looking for. Have you checked those locations?
-
Aug 10th, 2007, 10:35 PM
#12
Addicted Member
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. 
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
Last edited by ah_1026; Aug 10th, 2007 at 10:38 PM.
-
Aug 11th, 2007, 02:26 AM
#13
Thread Starter
Member
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
-
Aug 11th, 2007, 02:40 AM
#14
Thread Starter
Member
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
Last edited by abdbuet; Aug 11th, 2007 at 10:17 PM.
-
Aug 11th, 2007, 10:08 PM
#15
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.
-
Aug 11th, 2007, 10:14 PM
#16
Thread Starter
Member
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.
-
Aug 11th, 2007, 10:17 PM
#17
Re: [RESOLVED] Installer Problem
Why was the app exe not in the app.path to begin with?
-
Aug 11th, 2007, 10:26 PM
#18
Thread Starter
Member
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.
-
Aug 11th, 2007, 10:29 PM
#19
Thread Starter
Member
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.
-
Aug 12th, 2007, 01:08 AM
#20
Re: [RESOLVED] Installer Problem
That is the location where you install it... How do you install it to another location?
-
Aug 12th, 2007, 09:27 AM
#21
Thread Starter
Member
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?
-
Aug 12th, 2007, 02:50 PM
#22
Re: [RESOLVED] Installer Problem
Then what was it you had to move to get it to work?
-
Aug 13th, 2007, 08:23 AM
#23
Thread Starter
Member
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 !
-
Aug 13th, 2007, 12:51 PM
#24
Re: [RESOLVED] Installer Problem
Sorry for trying to help...
-
Aug 14th, 2007, 07:54 AM
#25
Thread Starter
Member
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
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
|