Link to home
Start Free TrialLog in
Avatar of ncw
ncw

asked on

Want to reduce size of setup files

I have built a simple screen saver which has the following forms:
Main form - with image control and timer
Configuration form  - with drive, Directory, and File list box controls
Help form - with image and rich text box control

The problem is the size of the distribution setup package. Ok I can save 200KB (zipped) by just removing the rich text control.
I notice that the setup includes for distribution a library file called 'Msvbvm60.dll' which is 1.4MB alone. Is this file required for every VB6 application?

Also 'Oleaut32.dll' and 'Olepro32.dll' take up 760KB. The only references in the project are to the following:
'Visual Basic For Applications',
'Visual Basic runtime objects and procedures', and
'Visual Basic objects and procedures'.

Is there any way of reducing the size of the distributable CAB file?  
Avatar of hes
hes
Flag of United States of America image

Even if you create a new project with a form and put nothing on the form, and no code. You will get those files with setup
Avatar of header
header

Make sure you remove any controls you are not using:

Press Ctrl+T and click on any entry with a check mark.  If your program is using that control it will not let you remove that entry, but if you program is not using that control it will remove it from you toolbox and your setup program will not include the files for it.
Is there any way of reducing the size of the distributable CAB file?  

No. Not if you want your product to reliably install on any of your customer's PC.

On the other hand.... if you can be absolutely sure that your users will already have a VB product written in VB6, with YOUR version of the VS Service pack installed on their PC, you can remove all those files from the installation package.

But when can you ever be that sure of anything?
ASKER CERTIFIED SOLUTION
Avatar of aut
aut

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
MSVBVM60.DLL is required by any VB application. As caraf_g said, you can get rid of it from the package if you are sure that the user will have the same version of the same file installed in his/her pc.
Avatar of ncw

ASKER

No I wouldn't want to risk removing those distribution file altogether, other than the rtf control.

header:
I've checked that there are no controls in addition to those in a standard progect template (other than the rtf control which will be going!)

aut:
I should be able to view an HTML doc within a form but I suppose that requires an additional control (ie more bytes)

Does the MS Installer do the same job as VB's Package and Deployment Wizard or is it more efficient?
the MS Installer is more efficient. It was designed to replace the Package & Deployment wizard.

As for the HTML, i meant it should open in the user's browser window -- using the ShellExecute() API
Avatar of ncw

ASKER

aut:
I've written the help text in HTML and I tried using the following code hoping it would open the file with ie4 (as when double clicked), but an error message says the file is not found.

Dim RetVal
RetVal = Shell(App.Path & "\Helpfile.htm", 1)
you should use the ShellExecute() API.
Here's the code u need for that:

'In the module, put this line:
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

'Then, you can call this function to launch any URL (whether it's local or online!).
'For example, call it like this:
'Call LaunchURL(App.Path & "\Helpfile.htm")
'    OR
'Call LaunchURL("http://come.to/aut")

Public Function LaunchURL(sURL As String) As Boolean
    'Function returns whether it was successful or not.
    Dim Returns As Long
   
    Returns = ShellExecute(0, "open", sURL, "", "", 0)
    If Returns <> 42 Then
        MsgBox "There seems to be a problem in your web browser software, or it is not configured properly.", vbExclamation, "Cannot Launch Web Browser"
        LaunchURL = False
        Exit Function
    End If
    LaunchURL = True
End Function

Avatar of ncw

ASKER

Yes the ShellExecute function works fine, although I had to change 'If Returns <> 42 Then ' to 'If Returns <= 32 Then '

I have yet to try the MS Installer.

Thanks