[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

manual program installation

Posted on 2004-11-22
31
Medium Priority
?
4,981 Views
Last Modified: 2008-01-09
Hello,
      SetupWiz is fine for some things but we need to manually install a VB program and I can’t find any info on a manual setup process. How can we determine what registry entries/modifications are made by setup? We tried to inspect the SETUP.LST and Setup.ex_ files but didn’t get anything we could use. Also, how is the process of registering the needed dll/ocx files accomplished? Is this also done via the registry? We downloaded a program that attempts to do a before and after comparison of the registry after a program installation but it’s very confusing. Far better to know what’s added before hand, I’d say. Partial points will be awarded for an interesting discussion. Full measure will go the solution that results in our program successfully loading and running upon system startup after we have manually edited the registry and placed any needed files in their respective folders..

                                          Thanks    

0
Comment
Question by:jvf
  • 11
  • 11
  • 4
  • +3
31 Comments
 
LVL 16

Assisted Solution

by:muzzy2003
muzzy2003 earned 400 total points
ID: 12650243
First thing I would say is if you have run up against the limitations in the SetupWiz, you ought to be going for a program such as Wise or InstallShield to generate your setup. A manual setup may be possible, but there would be no easy uninstall option, as you wouldn't be keeping track of a usage count for shared files or registry settings in the way that a properly created installer package would.

That said, it is possible to do what you want. Generally speaking, you will need to register any OCX or DLL files you need to use, including any of the common control OCXs - this is generally done using regsvr32, which will add a number of keys and values to HKEY_CLASSES_ROOT. To do this manually, have a look for instance at COMCTL.ImageListCtrl under HKEY_CLASSES_ROOT. You would need to manually create this key and its contents, and also the associated key under CLSID, identified by the CLSID entry under the first key. You must do this for each control in the OCX, or each class in the DLL. Get the locations of the files from your current PC.

You will also need to make sure that the VB runtime is installed, if they are not already installed either with the target OS or IE version (which they may well be). Files included for VB 6 are: COMCAT.DLL, MSVBVM60.DLL, OLEAUT32.DLL, OLEPRO32.DLL, STDOLE2.TLB, ASYCFILT.DLL, ADVPACK.DLL, W95INF32.DLL, W95INF16.DLL. You can check which of these need registering by trying to run "regsvr32 <file name and path>" and looking for error messages - any that register successfully, copy the registry entries as in the previous paragraph. Any that don't register just need to go in the appropriate place (which will be in the path).

Finally, of course, you need your application's executable file and any associated files that it needs.

Should cover most stuff, but personally I'd still go for a decent installation package utility.
0
 
LVL 12

Expert Comment

by:Bob Lamberson
ID: 12650723
Have you tried Inno Setup at  http://www.jrsoftware.org/isinfo.php  ?

Bob
0
 

Expert Comment

by:noushadp
ID: 12651420
There is a complete source code of Packages & Depolyment Wizard which comes with Visual Studio.
You could manualy edit this project, change whatever you need and then compile and save.
This project is located in <VB Installation Directory>\Wizard\PDWizard\Setup1
you could open the project and modify it according to your need.
Please make sure to backup the whole Setup1 Directory before you change anything.
Then compile and save it as Setup1.exe in its parent Directory ie, <VB Installation Directory>\Wizard\PDWizard
which already has the file. replace it.
Now open Package & Deployment Wizard from Visual Studio->Tools , you will see all the modification you done.

best of luck...

Noushad
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:noushadp
ID: 12651558
to acces the full tutorial of Customising Your Setup

http://www.developer.com/net/vb/article.php/1539871

best of luck...

Noushad
0
 
LVL 10

Expert Comment

by:fds_fatboy
ID: 12652240
Also, how is the process of registering the needed dll/ocx files accomplished?

Place your dlls/ocxs in the destination directory (normally System32 directory).

Then to register them run regsvr32 [full pathname].

e.g.

regsvr32 "C:\winnt\system32\MyDLL.dll"

n.b. If at a later date, you wish to install a non-binary compatible version of the same dll, you should unregister the existing dll first. Like this:

regsvr32 -u "C:\winnt\system32\MyDLL.dll"
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12652352
Hi!

Installing OCX's and DLL's is not complicated. You don't have to know anything about registry.
All you have to know is which dependencies your VB6 application needs, copy them to the target computer and register them using  
"Regsvr32 filename.ocx" (or dll).
Regsvr32 will create all registry keys your ocx/dll needs.

I wouldn't suggest you to manualy edit registry unless you are 100% sure what you are doing.
Instead I suggest using InnoSetup as BobLamberson suggested.

It's completely free and easy to use.
In my eperience, it covers everything your application needs to install on different Windows OS's.
Not to mention large off-line and on-line documentation.

See this example:
It is the script generated by Inno Setup which I modified to fit my needs in details.
When you start InnoSetup, you'll get a wizard where you can specify almost all settings your Setup will need to know (files, dependencies, directories, icons, etx.)
When it's finished, you'll get a script looking like this one below. You can modify it if you wish, and hit "Compile".
After few minutes your installation package is ready for distribution.
'------------------------------------------------------------------------------------------------
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

;generated by Wizard, unchanged
[Setup]
AppName=ArhView
AppVerName=ArhView 1.0
AppPublisher=Micro Image d.o.o.
AppPublisherURL=http://www.MI.com
AppSupportURL=http://www.MI.com
AppUpdatesURL=http://www.MI.com
DefaultDirName={pf}\ArhView
DefaultGroupName=ArhView
AllowNoIcons=yes
Compression=lzma
SolidCompression=yes

;generated by wizard, unchanged
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

;generated by wizard, changed by me to fit my specific needs
[Files]
;ArhView program files
Source: "E:\davor\VB\ArhView\WinNT\ArhView.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\davor\VB\ArhView\WinNT\ArhList.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\davor\VB\ArhView\ArhView.ico";       DestDir: "{app}"; Flags: ignoreversion
Source: "E:\davor\VB\ArhView\config.cfg";        DestDir: "{app}"; Flags: ignoreversion
Source: "E:\davor\VB\ArhView\HELP.HLP";          DestDir: "{app}"; Flags: ignoreversion

Source: "E:\davor\VB\ArhView\WinNT\vbSendMail.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver

;VB system files
Source: "E:\davor\VB\ArhView\VB6Files\stdole2.tlb";  DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regtypelib
Source: "E:\davor\VB\ArhView\VB6Files\msvbvm60.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\VB6Files\oleaut32.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\VB6Files\olepro32.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\VB6Files\asycfilt.dll"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\VB6Files\comcat.dll";   DestDir: "{sys}"; Flags: restartreplace onlyifdoesntexist uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\VB6Files\VB6STKIT.DLL"; DestDir: "{sys}"; Flags: restartreplace uninsneveruninstall sharedfile

;Win9x files
Source: "E:\davor\VB\ArhView\Win9x\COMCT232.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\Win9x\COMCT332.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\Win9x\COMCTL32.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\Win9x\MSCOMCT2.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\Win9x\MSCOMCTL.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\Win9x\MSFLXGRD.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\Win9x\MSMASK32.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\Win9x\MSSCRIPT.OCX"; DestDir: "{sys}"; MinVersion: 1, 0; Flags: restartreplace sharedfile regserver

;Win2000 files
Source: "E:\davor\VB\ArhView\WinNT\VB5DB.DLL";      DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\msjtes40.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\msrepl40.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\msrd3x40.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\msrd2x40.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\mswdat10.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\mswstr10.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\expsrv.dll";     DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\vbajet32.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\msjint40.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\msjter40.dll";   DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\msjet40.dll";    DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\dao360.dll";     DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\cdosys.dll";     DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\msvcrt.dll";     DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile
Source: "E:\davor\VB\ArhView\WinNT\scrrun.dll";     DestDir: "{sys}"; MinVersion: 0, 1;Flags: restartreplace uninsneveruninstall sharedfile regserver

Source: "E:\davor\VB\ArhView\WinNT\COMDLG32.OCX"; DestDir: "{sys}"; MinVersion: 0, 1; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\mscomctl.ocx"; DestDir: "{sys}"; MinVersion: 0, 1; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\MSFLXGRD.ocx"; DestDir: "{sys}"; MinVersion: 0, 1; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\WinNT\TABCTL32.OCX"; DestDir: "{sys}"; MinVersion: 0, 1; Flags: restartreplace sharedfile regserver

;XP files
Source: "E:\davor\VB\ArhView\XP Files\imgcmn.dll";   DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\imgshl.dll";   DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\jpeg1x32.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\jpeg2x32.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\oieng400.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\oiprt400.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\oislb400.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\oissq400.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\oitwa400.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\oiui400.dll";  DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\tifflt.dll";   DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\xiffr3_0.dll"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: onlyifdoesntexist uninsneveruninstall
Source: "E:\davor\VB\ArhView\XP Files\imgadmin.ocx"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\XP Files\imgscan.ocx";  DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\XP Files\imgthumb.ocx"; DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: restartreplace sharedfile regserver
Source: "E:\davor\VB\ArhView\XP Files\imgedit.ocx";  DestDir: "{sys}"; MinVersion: 0, 5.01; Flags: restartreplace sharedfile regserver

[INI]
Filename: "{app}\ArhView.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.MI.com"

[Icons]
Name: "{group}\ArhView"; Filename: "{app}\ArhView.exe"
Name: "{group}\{cm:ProgramOnTheWeb,ArhView}"; Filename: "{app}\ArhView.url"
Name: "{group}\{cm:UninstallProgram,ArhView}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\ArhView"; Filename: "{app}\ArhView.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\ArhView"; Filename: "{app}\ArhView.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\ArhView.exe"; Description: "{cm:LaunchProgram,ArhView}"; Flags: nowait postinstall skipifsilent

[UninstallDelete]
Type: files; Name: "{app}\ArhView.url"

[Languages]
Name: "hr"; MessagesFile: "compiler:Hrvatski.isl"
Name: "en"; MessagesFile: "compiler:Engleski.isl"
'--------------------------------------------------------------------------------------
As you can probably see, it covers it all. It creates, icons, copies and registeres files under conditions you specify, it creates uninstall script, support for
multiple languages, restarts the machine if required, etc.

Only thing you need to know about your VB6 application when using Inno Setup is what dll's and ocx's you need to include.
I found that out by compiling my App.exe on 3 different OS's (Win95, Win2000 and WinXP) and creating installation packages using Package & Deployment wizard,
on each OS separately.

Then I oppened SETUP.LST file on each computer, gathered all files mentioned there, and copied it to my main development machine to subfolders.
At last, I included all files in InnoSetup script, and set them up so apropriate files are installed on apropriate OS's.
My application still workes on every computer where I tried to install it without any problems.
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 12652364
dbrckovi - the questioner specifically asked for a solution involving file copy and manual registry changes only, that's why I've described the results of a regsvr32 registration in detail in my first post.
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12652397
No problem!

I just wanted to point out that InnoSetup is highly costomisable, and that there is no need to do installation procedure manualy.
But it's up to jvf to decide.
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 12652452
Yes, there are a number of tools that will do the job. InnoSetup is one of them, and I agree with you that if I were jvf I'd be choosing one of the tools. However, I'm sure he has his reasons ...
0
 
LVL 3

Author Comment

by:jvf
ID: 12657608
Just checked in. Thanks to all for your comments. We will make every effort to study them today. We run most of our test equipment with computers and VB programs that I've written. We are in the process of upgrading the computers from discarded hand-me-downs. In order to meet our goal of no moving parts we are using fanless mobo's, fanless power supplies and flash drives (how many computers have you had crap out because a $4 fan went belly up? and hey-how 'bout those $60 hard drives crashing on cue?) Flash drives also have their issues but we're willing to try them. To be reasonably priced, they must be rather small in capacity so we're using XPe (XP embedded) to keep the OS footprint small. We're having trouble getting some of the programs to run. We've tried installing the VB run-time files and an exe but get inconsistent results. We've tried a runonce setup program but that also failed. In the XPe target designer, there is allegedly a way to manually add the necessary files, registry entries, etc. for user programs but it’s rather a black art even if you knew what to add. We are trying all approaches and got curious as to what the automated setup programs actually did, figuring we could duplicate it in the target designer. It may be that a hybrid approach will prevail. Anyway, we’re new at XPe so I’m sure much of our problems are due to inexperience.  
0
 
LVL 3

Author Comment

by:jvf
ID: 12659874
Whew, just read through the posts! Seems like lots of good info that will take some time to digest (in a short week, no less). We only have one comment so far and it concerns the registering of DLLs. I’m familiar with regsvr32 and have used it many times. Part of our project involves loading some files, including a dll and ocx, for a device driver. In the instructions for Win 9x, they mention placing some regsvr32 entries in the RunOnce key. However, for 2000/XP using mostly the same files, there is no mention of using regsrvr32, only certain keys and entries. We thought that perhaps 2000/XP registered the DLLs differently. Could it be that they have a “helper” file that runs and registers their dll?  If so, we would then still use regsrvr32 somewhere, yes? Perhaps in RunOnce or in some batch or script file? We have enjoyed a small victory today by again adding the VB runtime files and a small VB exe to the image. This time our program did execute properly. The complete program will have several other files and DLLs though, so we are going to study the posts before proceeding. One problem seems to be the failure of the image to contain all the files of interest. In the development environment is a series of folders called Repositories where files are stored to be added later. Problem is, it’s hard to tell which Repository to place the files in. Until we get a handle on it, we have adopted a brute force approach and are placing all the files in all eight Repositories.
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 12659922
You can still use regsvr32 on 2000/XP/2003.
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12662610
I'm not at all familliar with XP embedded so I can't be sure, but generally, in order to make some standard VB application work, you have to to install Visual Basic Runtime files.
By "Standard", I mean VB6 application which is using only standard controls like command button, text box etc.
You can find most recent version of these files here: http://www.jrsoftware.org/iskb.php?a=vb
Install them on your developing computer, and copy the following files from ..\System32 to some other folder:
  stdole2.tlb
  msvbvm60.dll
  oleaut32.dll
  olepro32.dll
  asycfilt.dll
  comcat.dll
These are VB6 runtime files. They have to be installed on every computer where you wish to run your VB6 application.

If you have included any other control or DLL (through Project -> References/Controls) which is normaly not included in "Microsoft Common Controls", then you have to install that reference also.
For example, if you have included  Microsoft Scripting Runtime, you have to install and register scrrun.dll with your application.
(path to scrrun.dll is shown under "Location: ...." in Project->References window)

To install these files you can use any Installation Package Wizard/Creator or you can copy the files manualy and use Regsvr32 on them.
It doesn't matter how you install them, ans long as they are installed.

If you want to do it semi-automatic you can create a batch script which will do it for you.
Paste this in notepad and save it as Install.bat in the folder where you have VB6 runtime files:
'-------------------------------------------------------------------------
md c:\vb6files
copy msvbvm60.dll c:\VB6Files\msvbvm60.dll
copy oleaut32.dll c:\VB6Files\oleaut32.dll
copy olepro32.dll c:\VB6Files\olepro32.dll
copy asycfilt.dll c:\VB6Files\asycfilt.dll
copy comcat.dll   c:\VB6Files\comcat.dll
copy stdole2.tlb  c:\VB6Files\stdole2.tlb

RegSvr32 /s c:\VB6Files\msvbvm60.dll
RegSvr32 /s c:\VB6Files\msvbvm60.dll
RegSvr32 /s c:\VB6Files\olepro32.dll
RegSvr32 /s c:\VB6Files\asycfilt.dll
RegSvr32 /s c:\VB6Files\comcat.dll
RegSvr32 /s c:\VB6Files\stdole2.tlb
'-----------------------------------------------------------
Now just run Install.bat, and these files should be installed and registered in c:\vb6files   directory
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12662832
>> they mention placing some regsvr32 entries in the RunOnce key. However, for 2000/XP using mostly the same files
They probably mantioned it becouse Win9x platforms have to be restarted after installing new files, so they are actualy registered next time Windows loads.
WinNT platforms don't have to be restarted, so that's probably why they didn't mention it.

I probably mentioned it before, but basicaly all you have to know is that VB6.EXE needs VB runtime files + all other files which your project references to.
Largest problem that I can see here is how to figure out which additional files have to be installed. It all depends on how you referenced them in your project.

1.) If you have added a reference through Project->References, just read the path to the file under "Location:" and include it with your installation package
2.) If you were using CreateObject function, then it might be tricky, but it's also possible to figure out which file to include (tell me if this is your case)
3.) If you are using a dll lke this:
 Public Declare Sub SomeFunction Lib "SomeDll.dll" Alias "_SomeFunction" (..., ..., ...), then all you have to do is copy SomeDll, to your app's folder or
sub-folder where your dll originaly should be.

There is tons of details which might be important to know when installing your application. Souch as dll file version, will dll work on all OS's, is it legal to distribute them, do they depend on some other files, but that's individual for every application.

Try creating few simple applications and following these steps for each of them, and if you encounter any problem, post the details: what you tried to do, which files and how you installed them, what are the error messages, etc. I'll try to help if I can.
Again I would like to suggest you to use some Setup Wizard becouse lots of them can detect everything you need automaticaly or have instructions on how
to gather required files on your own. I've only used Inno Setup (and Package & Deployment Wizard), and it worked for everything I tried.
0
 
LVL 3

Author Comment

by:jvf
ID: 12767564
Hello everyone,
There is good information here and I will definitely split and award points. Due to time constraints, we haven’t been able to test a new image for the “real” program yet. I would like to keep this post open for another couple of weeks in case we get stumped and have any follow-up questions. Actually, I do have one concerning the Package & Deployment wizard. Our program is written in VB5. We do have a copy of Visual Studio 2003 because, for a couple of reasons, we were going to try writing in VB.net. In addition to mastering the needed learning curve, there were serious device driver issues so we shelved that idea for now. But, we do have the wizard. Is it relevant for our VB5 program?  Again, we are trying to avoid a “setup” style installation that has to “run” to install our program. We want to enter the needed registry values into the proper location in the XPe target designer. When our OS is “built” it would then contain a ready-to-run program (which we will run on startup). If Inno setup or the P&D wizard can help in determining files and registry locations, they could be useful. Other than the VB runtime files, I don’t think our program will use many “extra” ocx/dll files so I think we stand a good chance of success with our manual approach.
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12771214
If you are sure that your app doesn't need any "advanced" features like creating icons, Start-menu items, registering (although all of this is also possible),
you can use batch script to make installation procedure.

 - Download    Msvbvm50.exe     from    http://support.microsoft.com/kb/180071/EN-US/           and copy it to directory with other application files.
 - in this directory create textual file with REG extension and type in registry keys and values which you want to be created on target computer.
       (I don't know it's actual syntax but you'll probably find few REG files on your computer which you can use as example)
- create textual BAT file and write DOS commands; something like this:
.-------------------INSTALL.BAT----------------------------
Echo Off
Msvbvm50.exe
Md c:\MyProgram
Copy Application.exe C:\MyProgram\Application.axe
Copy config.cfg C:\MyProgram\config.cfg
Registry.reg
Echo Completed
Pause
.--------------------------------------------------------------
 - save it in the same directory with other files, and just double click it when you wish to install.
 - there are some other options available with BAT files, like optional execution, command line arguments, messages, etc.
 - you can see the syntax here: http://www.computerhope.com/batch.htm ,        here: http://guymal.com/techCorner/Batch_File_Syntax.shtml
0
 
LVL 3

Author Comment

by:jvf
ID: 12852210
Went backwards for a while and couldn’t boot up anything on additional mobos. We’ve worked it out and are back to program installation.

Dbrckovi, if I understand you correctly you have stated that just installing needed reference files in proper locations is sufficient. This implies that they will somehow register properly without running regsvr32 beforehand. Is this so? I have had to manually register some files on occasion. For this particular program I believe the only two references we need (other than the VB runtime files) are the dbList control and dao360.dll for the jet database engine. The Dblist reference was to Dblist32.oca. I see  .oca and .ocx for dbList32 so I put them both in. Another pgm will need the awful MsComm control.

Anyway, we are getting the dreaded ‘error 429 ActiveX cannot create object error’ and the pgm will not load and run. As explained in previous posts where I answered a tough automation question, Error 429 is my personal Freddie Kruger. Everytine I think I’ve killed it off, it returns. This program doesn’t use any Create or GetObj functions so I don’t know why we would get error 429. I do create recordsets though.

Perhaps I should mention that a simpler version of this program minus the listbox and any references to the jet engine will start and run without problems.
0
 
LVL 11

Accepted Solution

by:
dbrckovi earned 1600 total points
ID: 12865277
I didn't mention registering in my last comment becouse Msvbvm50.exe will install and register Visual Basic Run-time files automaticaly, and you said your application probably won't use components other than VB's standard controls.

If your application is using any additional ActiveX controls and references, then they have to be installed and they most likely have to be registered.
But sometimes DLL's shouldn't be registered at all, but I'll explain this in more details later.

First, I'd like to say what I think is the reason why you got error 429.
The reason is probably that some files are missing.
I thought you'll use simple controls, in which case you can simply use Project->References to get OCX/DLL file name , but dao360.dll is not that simple.
Dao360.dll is not stad-alone. It also depends on many other smaller DLL's. You'll have to install all those files as well.

To get full list of all dependancy files for your application, create normal Setup Package using P&DW, and open Setup.lst file.
You'll see many files there. Like: msjtes40.dll, msrepl40.dll, mswdat10.dll, etc.

They all have to be installed with your application.
Setup.lst, also provides usefull information on where files should be installed, and do they have to be registered or not.
For example:
File6=@msrd2x40.dll,$(WinSysPathSysFile),$(DLLSelfRegister),,7/22/02 11:05:04 AM,422160,4.0.4910.0
   - is saying that msrd2x40.dll has to be copyed to Windows\System32 folder, and it has to be registered

File7=@mswdat10.dll,$(WinSysPathSysFile),,,7/22/02 11:05:04 AM,831760,4.0.3829.2
   - is saying that mswdat10.dll has to be copyed to Windows\System32 folder, but it doesn't have to be registered

Note:
Some DLL's don't have to be registered. They only have to be present in Windows\System32.
Setup.lst and $(DLLSelfRegister) flag tells you that.

As I said above, only ActiveX components have to be registered.
Since OCX files can't contain other that ActiveX controls, OCX files allways have to be registered, but DLL files may or may not contain ActiveX classes.
Old style DLL's don't have ActiveX components, and they can't be registerd. They only have to be copied in Windows\System32 directory.
New style DLL's have ActiveX components, and they have to be registered.

Best way to determine wheather some DLL your app depends on, has to be registered or not is as I stated above; to examine Setup.Lst file.
Next method is to try and select the file in Project->References. If it can be selected, it is ActiveX DLL, if it can't then, this is not ActiveX
     (VB can only use ActiveX DLL's in Project->References)

I hope this is not too confusing. Ask, if I didn't explain something good enough.
0
 
LVL 3

Author Comment

by:jvf
ID: 12869734
Hi dbrckovi,
Your explanation is good. We also figured the error could be due to missing files. We have inspected setup.1st and are attempting to add some more files but evidently haven’t added enough yet. In an earlier post I inquired about the P&DW wizard. We have VB5 and only have the simple ‘SetupWiz’ (which should be sufficient, I hope). My understanding is that P&DW is a part of VB.net or visual studio? We have Visual Studio 2003. Could this be of any help?
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12873869
Yes, P&DW is a part of Visual Studio (at least, visual studio 6.0 which is what I have).
In fact, the wizard itself is written in Visual Basic.

My copy of P&DW is located under:
Start -> Programs -> Microsoft Visual Studio 6.0 -> Microsoft Visual Studio 6.0 Tools -> Package & Deployment Wizard
OR
E:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\PDCMDLN.EXE
OR
in VB IDE: Add-Ins -> Add-In manager

I don't know about Visual Studio 5 or 2004, but I'd bet that they have some version of P&DW.
0
 
LVL 3

Author Comment

by:jvf
ID: 12879750
Under XPe, we get error 429 and the program won't load. If we make a setup program from the VB5 environment it will install and run on most machines here but not on the target machine even under a full version of XP. On this machine and full XP, the program will run but the dbCombo and dbList box are empty. However, we have noticed that another form referencing the database but without the special db controls does retrieve information correctly. This perhaps implies a problem with the dbList32.ocx control and not the dao360 dll. We ran dependency walker on DbList32 and it looks like all major files are installed on the target machine. There are issues with the VB5 data control and dao360. The database references must be coded and not chosen from the control's property windows. Maybe this control is just basically hosed. Barring any insights from anyone, I am going to rewrite the program using "normal" list and combo boxes and use AddItem while looping through a recordset.
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12882094
Try installing VB5DB.DLL to Windows\System32 folder.     (don't register it)

-> http://www.vbug.net/technicalsupport/topicposts.asp?CID=2&TID=3754
0
 
LVL 3

Author Comment

by:jvf
ID: 12888909
Thanks dbrckovi,
We'll try it Monday. Merry Christmas!
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12890584
Merry Christmas!  :-)
0
 
LVL 3

Author Comment

by:jvf
ID: 12923132
Hello everyone,
We are approaching a conclusion to this post. We have had some successes but the Dblist32 control is still giving us fits. It seems that even creating a setup program using the VB5 setup wizard and installing it on a full version of XP is not always successful. We have observed that the associated DBcombo boxes or DBlist boxes will not populate with data on machines where a version of Office is not installed (OfficeXP is on the others but using dao3.6 I think that Office2000 would also work).  However as suspected, if I delete the Dblist control and use “plain” listboxes, I can populate them by looping and using AddItem. Since we don’t have to constantly update the controls this is acceptable but pursuing a solution should probably be done in a new post.

As it turns out, Xpe contains components that will install VB 5 or 6 runtime files as specified so we are doing it that way as opposed to running Msvbvm50.exe somewhere (although we may try running it to see if dbList could finally work). This leads to a request to clarify answers to one of my first questions: how to register any other needed dlls or OCX controls if necessary. A batch file running regsrvr32 has been suggested. The post with examples of  Inno Setup has entries referring to “regserver” and examples of Setup.1st make reference to “SelfRegister” so obviously the affected files are registered somehow. As stated, my preference would to add entries in the RunOnce registry key with the value being the proper regsvr32 syntax. This should work, shouldn’t it?  
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12925289
Yes this should work. You could do it by creating .reg file in Notepad with following content, and then double-clicking it.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"Register Component1"="Regsvr32 /s C:\\Windows\\abc.dll"
"Register Component2"="Regsvr32 /s C:\\Windows\\def.dll"
"Register Component3"="Regsvr32 /s C:\\Windows\\ghi.dll"
"Register Component4"="Regsvr32 /s C:\\Windows\\jkl.dll"
"Register Component5"="Regsvr32 /s C:\\Windows\\opq.dll"
"Register Component6"="Regsvr32 /s C:\\Windows\\rst.dll"

This will run      Regsvr32 /s C:\Windows\abc.dll, Regsvr32 /s C:\Windows\def.dll, etc, next time you restart Windows.
Note that any backslashes inside quatation marks have to be double. Otherwise, key value wont be created.
0
 
LVL 3

Author Comment

by:jvf
ID: 12947657
Hi dbrckovi,
 For us it's easier than that. In the XPe component designer there is a place to specify additional registry entries. We just feed it a keyname with values and when it builds the registry it adds the additional info. That's why we are so interested in figuring out what (if any) "extra" registry entries our project needs. If we know what we need, we can build it into the OS from the start without having to run anything. We have come across various registry inspection tools but even small setup programs can generate a bewildering array of changes. As a result, we haven't yet been able to stomach a full investigation and tabulation of all registry differences and opted for trying to get away with just adding the VB runtime files and the registering of any "extra" ocx/dlls. This method has produced acceptable results for our first project but I fear we're just postponing the inevitable dive into before and after registry comparisons (it seemed so straightforward at first). By the way, I've never seen reference to the /s switch. What is it's meaning?
0
 
LVL 12

Expert Comment

by:Bob Lamberson
ID: 12948914
/s switch. What is it's meaning?

silent; display no message boxes.
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12950155
I'm affraid that just tracking the registry changes won't be enough. You'll have to understand what each new registry key or value
created when registering ActiveX control means.

But I've just remembered a program which helped me completely avoid installation process on several occasions. You can download a trial version at:
http://www.moonlight-software.com/vbpower.htm
It will embed all dependencies (dll, ocx) into application's exe file, and they will be installed silently when application starts.
It worked for me for all simple applications, but I've never tried using it on application which is referencing DAO 3.6.
0
 
LVL 3

Author Comment

by:jvf
ID: 12957967
Interesting, we'll try it. I must travel for a couple of days. When I get back we'll wrap this up and award points.
0
 
LVL 3

Author Comment

by:jvf
ID: 13275794
Thanks, everyone.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question