Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Package & Deployment Questionssss

Status
Not open for further replies.

psandekian

Programmer
Oct 12, 2000
48
US
Hi. I'm using VB 6.0 and I have a couple of questions regarding Package & Deployment. Here they are:

1. Can I have another executable run when the user installs my application? I need to have another application installed in order for mine to work. Can I add this to the setup.lst file or would this be added somewhere else?

2. When I tried to install the package myself as a test, I had 2 files that were "in use" even though I had nothing else running. They were MSVCRT.DLL and MFC42.DLL. Are these files part of Windows NT? Can I leave these out?

3. Also when I tried to install the package, I had 1 file that had an "error occurred while registering" it. It is EXPSRV.DLL. Again, can I leave this file out?

Any help is greatly appreciated!
Thanks.
Patty


 
Patty
answer to question 2 and 3.
You certainly can leave the dll files and your application will still launch provided that your users have these files. If any of your users fail to run setup you will simply have to copy the dlls onto their systems. I still have to confirm a response to question 1. As soon as I confirm that I am right, I will post the response.
 
Patty,

Regarding question 1, I've done that, but it was kind of a pain. Here is what I did. It may not be the only way or the easiest way, but it worked.

The program SETUP1.EXE is the main program executing when you develop an install with Package and Deployment Wizard.

It turns out Microsoft delivers the VB source code to SETUP1.EXE with Visual Studio! I found it in directory:
...\Microsoft Visual Studio\VB98\Wizards\PDWizard\Setup1

I pulled this project up in VB and made a change to extract an EXE file from the CAB file and run it (it was IMMC.EXE, an install for MMC version 1.2, which I needed).

Here are the code changes I made.

frmSetup1:
Form_Load

Just before the label ExitSetup: I added the following lines

DoEvents

'We need to install MMC 1.2. Display message.
ShowStaticMessageDialog "Installing Microsoft Management Console Version 1.2"
InstallMMC
HideStaticMessageDialog


The last three lines call procedures. The first and last procedures are already there, the middle one I wrote by copying a similar procedure. It is as follows:

Public Sub InstallMMC()
Const strFile_MMC_Install = "IMMC.EXE"
Const strFILE_MMC_ARGS = " /q:a /c:""setup.exe /QN1"""

Dim sTarget As String

'Create the folder if it doesn't exist already.
If Not (DirExists(gsTEMPDIR)) Then
MkDir gsTEMPDIR
End If
sTarget = gsTEMPDIR & strFile_MMC_Install
ExtractFileFromCab gsCABFULLNAME, gstrAT & strFile_MMC_Install, sTarget, gintCabs, gstrSrcPath
If FileExists(sTarget) Then
SyncShell sTarget & strFILE_MMC_ARGS, INFINITE
End If

End Sub



I basically copied the code from another location and modified it as needed. Some of it is not very obvious as to what it is doing, but essentially it is extracting the install program from the CAB file into a temp directory and running it. The INFINITE parameter says for the install to wait for the program to finish before it continues.

After that I compiled the new SETUP1.EXE. Then I saved the original SETUP1.EXE that was in the directory
...\Microsoft Visual Studio\VB98\Wizards\PDWizard
and copied my now one into there. The SETUP1.EXE that is in that directory is the one that will get included when you build a package.

After that I just built the package as normal. One extra thing I did after building the package was remove the file IMMC.EXE from the setup.lst file, section [Setup 1 Files]. That way even though it is in the cab file and can be extracted and run, it doesn't actually get copied to a permanent location on the users machine, since they won't need it any more. So you could decide whether or not to do that with your EXE.

Anyway, as you can see, this was not a quick solution, but it worked. Maybe someone else has a better way. The good thing was it was nice to find out the SETUP1.EXE source was included and could be customized to suit my needs.

Anyway, good luck.
 
Thanks for the help. I made the changes to the Setup1.exe like what you suggested and then I ran P&D Wizard. When I install my application, it uses the old Setup1.exe. What did I do wrong.

I copied the original files to a backup directory that I created and then I made my changes in the original directory. I created the executable replacing the original Setup1.exe. Do I need to change something like a path? Did it follow the original Setup1.exe file when I copied it? I did see a VBShell.tlb file. Is this causing me problems.

I know it's not using my Setup1.exe because I changed an image on one of the buttons and it's still using the original image.

Any ideas? I'm clueless right now.
Thanks.
Patty
psandekian@earthlink.net

 
steve - thanks for the code.

was wondering, what if the seconday install requires a reboot of the system? how do i tell the install program it has to do this at the end?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top