Link to home
Start Free TrialLog in
Avatar of ChrisK
ChrisKFlag for United States of America

asked on

VB5 Unexpected Error ?!?!?!?!

I created a program a few days ago and distributed it to some of my friends online.  It works for me and most of my friends, but some of them can't run it, they get an "Unexpected Error" message, nothing else is said.  I sent them all the msvbvm50.dll and mswinsck.ocx.  Those are the 2 files I know I need.  So why would they be getting this unexpected error and not me or a lot of the others????
Avatar of Jason_G
Jason_G

Hi ChrisK,
What version of VB do you have, because if you have Professional or Enterprise, the easiest thing to do would be to use the Application Setup Wizard, to make a setup file for your app.  I'm not entirely sure what is causing the error, but it is most likely caused by the user not having your .dll's registered on their machine, which a setup program will do automatically.

You could use regsrv32.exe to register your files on their machine.

What exactly did you make?  An ActiveX control, Standard EXE, etc?

Perhaps, the reason it works on some of their machines and not others, is because they have VB installed?

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
Avatar of ChrisK

ASKER

Well, these others don't have VB, so that's not it....I'm gonna make the setup wizard exe but how do I make it create a directory under programs for the program instead of just placing the icon under programs, and how about placing an icon directly on the desktop?
ASKER CERTIFIED SOLUTION
Avatar of percosolator
percosolator

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ChrisK

ASKER

Great, I said I'd try that, but then answer my OTHER question then that ties in with the setup wizard.
Hi Chris,
Just so I understand exactly where you want it, besides the desktop icon, can you write the directory, such as c:\myapp\

I'm not sure I quite understand where you want it to be placed.

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
Hi Chris,
For now, here's an article from VB Books Online on Creating a Setup Program: Step by Step.

Whether you chose to create your setup with the Setup Wizard or by using the Setup Toolkit directly, there are certain steps that must be taken.
1.      Determine the files you need to distribute. The Setup Wizard automatically determines this information and then generates the Setup.lst file. In addition, for each ActiveX component or control that you create in Visual Basic for use in other projects, the Setup Wizard can create a dependency (.dep) file. All run-time files that are required by any ActiveX controls you used in your application, for example, are listed in this file. The .dep file will then be used by the Setup Wizard if your current project uses the ActiveX component or control created by that project. See "Dependency Files Explained" later in this chapter for more information.
2.      Create or write your setup program (Setup1.exe). The Setup Wizard creates the setup executable from the Setup Toolkit project. If you want to modify the default setup program, back up the Setup Toolkit project files and make changes as desired. You can rename this project as you see fit, as long as you change the Setup.lst to reflect the new name. See "Modifying the Setup Project" later in this chapter for information on customizing the Setup1.vbp project.
3.      Compress the appropriate files. The Setup Wizard compresses and copies the appropriate files to the distribution media. Some files (Setup.exe and Setup.lst) are copied to the distribution media uncompressed. If you use the Setup Toolkit, you’ll have to do the compression manually using Compress.exe. See "Compressing the Setup Files" later in this chapter for more information.
4.      If using disks, determine the disk layout. The Setup Wizard takes care of this automatically, determining the layout and notifying you of the number of disks needed. If you are using the Setup Toolkit, see "Determining the Layout of the Distribution Disks" later in this chapter for more information.
5.      Determine where to install the files on the user’s machine. Different types of files need to be installed to different directories on the user’s machine. For example, in Windows 95, setup and program files are usually installed to \Program Files\YourAppName, and system and dependency files are copied into the Windows\System directory. You can specify other paths in the Setup Wizard if you need to override the default settings. When using the Setup Toolkit directly, you will need to manually add this information to the Setup.lst file. See "Creating the Setup.lst File" later in this chapter for more information.
6.      Modify Setup.lst to include all the files on your list. The Setup Wizard automatically creates the Setup.lst for you, deriving this list from your application’s dependencies, program files, etc. When using the Setup Toolkit directly, you need to create this list manually. See "Creating a Setup.lst File" later in this chapter for more information.
7.      Create the distribution media. The Setup Wizard will prompt you for the type of media you want to use. You may select disks, a network server, or distribution via automatic code download from the Internet. You can also create distribution media manually. See "Creating Distribution Disks" and "Distribution Options" later in this chapter for more information.
8.      Test the setup program. Whether using the Setup Wizard or the Setup Toolkit, you should test your application’s setup prior to distribution. See "Testing Your Setup Program" later in this chapter for more information.
      
Advanced Features
Additionally, you may want to add advanced features to your setup program. Many advanced features are integrated in the Setup Wizard; however, you may need to modify some aspect of these features manually. The following list identifies these features and points you to the section within this chapter that discusses them in greater detail:
·      Create Internet component download packages. Use the Setup Wizard to create .cab files for the ActiveX components that you use in your Internet applications. See “Internet Component Download” later in this chapter for more information.
·      Install ActiveX components. Use the Setup Wizard to create setup programs for both the client and server in a Remote Automation or Distributed COM (sometimes called DCOM) environment. See “Installing Remote Automation and Distributed COM Components” later in this chapter for more information.
·      Install Data Access Components. If you used Data Access Objects (DAO) in your application, see “Installing Data Access Components” later in this chapter for more information on how to use the Setup Wizard to install them.
·      Distribute Your Application on a Network. The Setup Wizard gives you two options for installing your applications on a network. See “Distribution Options” later in this chapter for more information.

Avatar of ChrisK

ASKER

Simple, you click START then programs and ACCESSORIES for example is a directory / folder.  Most programs create their own folder for it to install to.  It already automatically puts it in program files, which I like, but what if I wanted to change that?  And then I want it to create a folder under programs to place the programs shortcut in, so it would be START\programs\myprogram\myprogram.exe.  And then how do I make it automatically put a shortcut to the program on the desktop in the install?
Hi Chris,
You must manually edit the setup.lst file, that the setup wizard generates.  And this is the key you want to edit,

DefProgramGroup      - which specifies the default name of the Program Group (in Windows NT 3.51) or folder (in Windows 95 or Windows NT 4.0). Note that by default no folder is created for your application under Windows 95 or Windows NT 4.0. Instead, the program shortcut is created directly in the Programs menu of the Start menu.

To edit the setup.lst, just hold shift down, and right click on the setup.lst file, then choose notepad to open it.

Also, for other info, on changing setup options, just do a search for "setup.lst" in the VB Books Online.

I hope this helps.

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com
Avatar of ChrisK

ASKER

Ok we are 1 step closer now but still no go.  I put in for example:

DefProgramGroup=\MyStuff\theprogram.exe

that doesn't work...also tried

DefProgramGroup=MyStuff\theprogram.exe

And I don't see anything in the setup.lst that would automatically create a shortcut on the desktop AS WELL as putting the program in it's own shortcut folder.

Hi Chris,
I believe, if you want any additional features not provided by the setup wizard (such as desktop icons, etc), you must access the setup toolkit, which is located in the program files\devstudio\vb\setupkit\ folder.  If you open an existing project with VB, and navigate to this folder, and open the setup1.vbp file, you will have access to all the code contained in the setup wizard, and here is where you would add any additional code commands.

Good luck!

Sincerely,
Jason

Jason Gorman (jason_gorman@scholars.com)
Learning Advisor, scholars.com
Microsoft Authorized Technical Education Center
Novell Authorized Online Training Provider
http://scholars.com