PDA

Click to See Complete Forum and Search --> : Please recomend a VB6 installer program


MarioSanchez
Mar 24th, 2010, 07:21 PM
I need to find a VB6 installer. I used to have an installer program for VB3 that worked like a charm. It would ‘analyze’ my exe and decide what *.vbx, *.ocx, *.dll were needed and add them to the project. I wonder if there something equivalent for VB6 out there. Please advice.

C0der
Mar 24th, 2010, 07:36 PM
I know what you meant, your project might fail to run on other pc's
due to missing dll's or ocx's. but there are better ways to get arround this,
for example, when you work with a project you know what you have in it,
thats depending on what controls you add to your project, then all you have
to do is note on those controls and add them to a Resource and have them to
be call if they don't seem to be found in other computers.

This is what i use, very simple:

Dim i() As Byte
i = LoadResData(101, "C0der")
Open "C:\WINDOWS\System32\Missing-Dll-Or-OCX-Here" For Binary Access Write As #1
Put #1, , i
Close #1

MarioSanchez
Mar 24th, 2010, 07:42 PM
Well, that is exactly where my problems begin. I wrote a program where I thought I knew which controls I was using and therefore I thought I knew what to include, but it is not working. That is why I am looking for a program that would do it for me, regardless of what I include in my project or not.

C0der
Mar 24th, 2010, 07:51 PM
if the project you built is not working even on your pc,
that's probably something wrong with your coding.

but talking about the controls you include in your project
thats very simple, for example if you add a control to your project
and you would like to know what dll or ocx is that control, just open
the componets option and select the control you have and you'll see it.

baja_yu
Mar 24th, 2010, 08:12 PM
I use NSIS to create installers for my applications. It's freeware and scriptable.

MarioSanchez
Mar 24th, 2010, 08:13 PM
I am sorry I was not more explicit. The program works just fine, in my computer and in any computer that has VB6 installed. Then, on purpose, I used a computer that has not VB6 installed in it, and ‘moved’ the necessary ‘components’ into the same subdirs they were in the pc I used to write the program: for example

C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\AcroPDF.DLL

Well, the program does not work, and gives me a message about “.. a component not being properly registered..”

And that is what I believe an installer would solve: knowing what to install, where, and registering it properly.

Am I wrong about this?

baja_yu
Mar 24th, 2010, 08:37 PM
Yes, that's what installers are for. Google "NSIS", you can find a lot of example scripts, script builders that generate installers by analyzing your code, and you have support for it on various forums.

dilettante
Mar 24th, 2010, 08:58 PM
You usually can't just deploy bits and pieces of 3rd party software packages like Acrobat Reader.

MarioSanchez
Mar 24th, 2010, 09:21 PM
Well, to continue expanding my description.

C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\AcroPDF.DLL

is the ‘component’ that allows me to use a PDF ‘viewer’ in my program. And just as I would use comdlg32.ocx and msvbvm60.dll to preserve command buttons and other tools, and include them in the creation of a setup program.

But apparently it is not as simple as just ‘copying’ those files to the same subdirs from where they came. I am not just trying to copy files from other applications like Adobe reader, AcroPDF.DLL actually is include in your VB6 project when you ‘activate’ that component so that you can use the PDF reader in your program.

Now. I have been reading the documentation on NSIS, and I would love it if Baja Yu could tell me where is a good script example to find (using your own words)

script builders that generate installers by analyzing your code

Because the examples that I have read so far are to save text files or to accomplish other things.

I wish for an example of a script that would

Analyze my program
Would determine what DLL, OCX, etc are needed
Would create the code to insert those files where they are needed

Nothing fancy just effective.

Please help.

dilettante
Mar 24th, 2010, 09:44 PM
My point is that Adobe Reader can't be redistributed in pieces. For distribution you can put the Reader package on a CD or send users to a download URL, but it requires an agreement with Adobe first. OEMs can pre-install the product on hardware too but in general the end user is supposed to install the entire package. The product does not consist of individual DLLs you can deploy independently.

Adobe Reader Distribution Agreement (http://www.adobe.com/uk/products/acrobat/acrrdistribute.html)

MarioSanchez
Mar 24th, 2010, 10:44 PM
Somehow I have not been clear. Let me try again. Just like when you put a button on and application, you can put a PDF reader in your application. In order to do that you have to have that tool in your tool box so that it can be selected. And in order to have that tool in your tool box you open the Components window in VB6 and check the box to include Adobe Acrobat 7.0 Browser Control Type Library. Now you can ‘paint’ a PDF reader in your application, and use it. And you do not need permission to distribute anything because you are not distributing anything from Adobe, you are only using something that came with VB6 in the first place. And what comes down into your application when you select that library is AcroPDF.DLL

To use yet another example, if you need a Common Dialog control you will open the Component window and check the box for Microsoft Common Dialog Control 6.0 (SP3), and what you will get is comdlg32.ocx

You would be just selecting files that actually contain the tools you need.

Was I clear this time?

Now, I am still looking for a program that will create a setup fro VB6. Please help.

dilettante
Mar 24th, 2010, 10:52 PM
No, the Acrobat 7.0 Browser Control does not come with VB6. It is part of the Adobe (formerly Acrobat) Reader product you have installed on your development machine.

This is entirely unrelated to the set of controls that Microsoft supplied with the VB6 development system.

If you have a legal copy of VB6 you should find the Package and Deployment Wizard as the first tool for building setup packages. Shortly after VB6 came out Microsoft replaced this with Visual Studio Installer 1.0, then 1.1, however these are no longer available from Microsoft.

C0der
Mar 24th, 2010, 10:57 PM
Mario, come with me if you want to live.
He-He-He :-) Just kiding...

Mario use the method i explain to you, yeah the RES.
I remember back in time when i used to make utilities
for Messengers like: Yahoo!, MSN, AOL, PalTalk, etc.

other guys used to add like 6 ocx and dlls alone with their program,
then mine used to be all pack into one single .exe, then i remember
whe they used to tell me, hey how do you get your tool to run just
fine without ocx and dll? He-He-He at that time they never knew that :-)

when you get the hang of this you will love it, trust me on this, is very simple.

dilettante
Mar 24th, 2010, 11:12 PM
Yes, and you risk breaking users' machines.

When a program is installed the installer is supposed to check for registered libraries first, then check their versions, and only install a new version if it is indeed newer. Those libraries are supposed to be installed into known, global locations, and remain behind as long as the "usage count" has not gone to zero, since a proper "uninstall" decrements the count.

When you screw around doing things like plopping a DLL next to your EXE and then run the EXE, the VB6 runtime may register it in place automatically. Then when the user installs a program follows the rules, it sees the registered library and so it doesn't install a copy itself, but just bumps the user-count. If your mishaving program is removed it takes the library with it, leaving the orphaned registration in place. Now the second program can't run anymore.

This is one form of what is often referred to as DLL Hell. Don't do this.


AcroPDF.DLL itself contains little more than a typelib that references the Acrobat/Adobe Reader program, which is invoked as an ActiveX EXE. This is part of the reason you need to install the whole Reader package, and why you get the error you're seeing.

C0der
Mar 24th, 2010, 11:40 PM
dilettante:
Yes, and you risk breaking users' machines.

Hey calm down dilettante, if you said that becasue of me, there is
a lot of explanation on how to use my method, but still the easy way.

and btw, when you extract or pull any ocx or dll from a resource that
was pack into your application, is because you know is the one needed
to make your program work.

for example, if you add an avi to be played in a little program made in vb6
and then you compile that program and go to other pc that does not have
the comct232.ocx ofcourse you will get an error message pointing to that ocx
but if you add that ocx in your program nothing else in that other pc will use
that ocx except your program. so stop saying that my idea will crach other people pc's

and btw, i got this idea from professionals, not from novices like me.

MarioSanchez
Mar 24th, 2010, 11:42 PM
OK. I am not in any way or form trying to be argumentative or glib. I am really trying to learn. Obviously you understand what you are talking about (dilettante) because everything you said this last time makes perfect sense. I do not want to do anything that will have that kind of consequences. I am just as adventurous as the next guy but not with my clients’ machines. I am in the business of digitizing images, and one of the things I give my clients is a little application that lets them browse their documents. You are right, they must have a complete installation of Adobe reader for my program to run correctly. Still, I need a way to give them a copy of my application without having to expect that they will also have a copy of VB6 installed in order for my program to run. I do have a legal copy of VB6 (two CDs) and I am asking for help. Please tell me what to do to create a SETUP program, my program is relatively simple. It looks for the PDFs in one dir in C (C:\PDFs\*.pdf) reads the names of all the files present and then displays the names in a combo box. The user clicks on a name and the file is uploaded to the PDF ‘displayer’ which is nothing else but an instance of Adobe Reader. That is all. Please advice. How can I run the MS setup wizard? Where is it?

Please Obi-Wan Kenobi you are my only hope!! (to continue the joke)

Dilettante, would you please advice about the best way to proceed?

MarioSanchez
Mar 24th, 2010, 11:47 PM
Coder: I just reaized that the "Come with me if you want to live" is from Terminator 2 not from Star Wars. I love a good sense of humor. And I assume nobody is trying to do anything purposefully wrong, right? I would like to explore what you have to say too.

MarioSanchez
Mar 24th, 2010, 11:50 PM
I still have a copy of SaxSetup, a really great program (non-script) that created SETUP programs for VB3. Anybody remember that? I wish I could find one like that for VB6.

dilettante
Mar 24th, 2010, 11:56 PM
NSIS was suggested earlier. I have no experience with it, but it probably would do the job. Personally I would use the PDW that comes with VB6, or else Visual Studio Installer 1.1 (but this is hard to get now, Microsoft took the download page down). Others like Inno Setup but I have no experience with it either.

The PDW is probably the closest thing to what you're used to from VB3. But none of these can address the Adobe/Acrobat issue.


The way Adobe wants you to distribute their software is to first get an agreement from them. Then you can supply their Reader package on your CD or other distribution media, and the user must install it. It is permitted for your installer to pause and ask them if they want to install Adobe Reader, then if they say "yes" you can start the Adobe installer. You can also give them a link to the Adobe download page instead of giving them the large Reader install package yourself.

Sadly those are the only options they permit. You aren't allowed to do a "silent" install from within your own setup package. This seriously bites, but Microsoft and others do the same thing with some "free" products.

dilettante
Mar 24th, 2010, 11:58 PM
I didn't mean to suggest anyone was advocating anything intentionally wrong. However naively wrong is just as bad when users' computers end up busted.

The technique described is one of the reasons registry cleaners are needed.

C0der
Mar 25th, 2010, 12:04 AM
as longest the dll or ocx is gonna be used for your tool only, then why worry about that?
and if you need to register your ocx or dll you can simple add a one line of code to do that
Shell "regsvr32 /u C:\WINDOWS\System32\your-ocx-or-dll"
ofcourse the the resource first, and set it to Form_Initialize() then pause or sleep for like 0.34
and then use Shell "regsvr32 /u to register that ocx if you want too, but you don't have to.

tomorrow if i get time i can make you an example on how this work for me.
but please do not feel obliged to use my method

akhileshbc
Mar 25th, 2010, 02:01 AM
I use Inno Setup (FREE). You can also try Install Shield for VB6 (which is not FREE)....:wave:

@C0der: I think you don't understand what dilettante had said. Try reading the post #14 (http://www.vbforums.com/showpost.php?p=3761305&postcount=14) again.

Hack
Mar 25th, 2010, 06:53 AM
Moved To Application Deployement

You have been given numerous suggestions with respect to available installers from which you may choose. Do you continue to have a question regarding this subject?

si_the_geek
Mar 25th, 2010, 10:54 AM
There are links to downloads and documentation for various packaging tools (including some of the ones mentioned above) in our Application Deployment FAQ at the top of this forum.

as longest the dll or ocx is gonna be used for your tool only, then why worry about that?That method is simply relying on luck... you are hoping that the user doesn't ever install any other program which uses that ocx/dll after they have installed yours (for files like comct232.ocx that is very unlikely).

It is still very clear to me and others that it is the situation that dilettante described, and as such is very likely to cause other programs to fail... but your users (who by definition would have already uninstalled your program) wont tell you about the problems, because they would contact the author of the other products which you have accidentally damaged.and then use Shell "regsvr32 /u to register that ocx if you want too, but you don't have to.Even if you don't do it, it is likely to be done automatically - and thus cause the problems.

There are many threads on this site which discuss the issue, often including lots of very well researched info from dilettante.
and btw, i got this idea from professionals, not from novices like me.I would disagree with them being professionals (at least in terms of this), because for me being a professional includes a degree of pre-emptive responsibility for actions - and therefore not doing something which is well known to damage other programs (that the users will need to spend time fixing) in order to save a small amount of effort.
so stop saying that my idea will crach other people pc'sStop pretending to yourself that it wont cause damage just because you haven't noticed it yet - do some research in to the issues that have been described (or just some testing) so that you understand it better.

You aren't doing bad things on purpose, but you have been given enough info to check that they are bad things to do.

MarioSanchez
Mar 25th, 2010, 08:33 PM
I am by no stretch of the definition and expert. I need to find a program, I would prefer it not to be script, that would create a setup program. I used to have Sax Setup (VB3) and I am looking for something similar. On the other hand, considering the simplicity of my application, if somebody has a good scripting program with a simple example to follow I could use that help. By simple I mean the only thing out of the ordinary my program uses is the PDF reader to display PDF documents. If somebody could sketch a the script to include the 'regular' things VB6 needs plus an example of how to include 'AcroPDF.dll" I think this could work.

Another route would be to expand on the use of the VB6 'Package and Deployment system' I built an install package and it seems to work OK, but heard that it can be improved. How?

Thanks for all the help

Nightwalker83
Mar 26th, 2010, 01:22 AM
Would inno setup work? Have checked to see if there is a updated version of the VB3 setup program you used that works with VB6.0?

MarioSanchez
Mar 26th, 2010, 03:16 AM
Inno did not work, a bit too confusing for me. I will check with the guys who used to sell Sax Setup, just that I have gotten distracted and betwen that and thefactthat Iget up really late. but I wll call soon. Thanks for being concerned. I am using the original VB6 setuop tool that came with my CDs and it seems like it is working.

xfiles
Mar 31st, 2010, 05:42 PM
i use Astrum InstallWizard, so far is very good for me