
Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Jonathan West was telling us:
Jonathan West nous racontait que :
>> Jonathan West was telling us:
>> Jonathan West nous racontait que :
[quoted text clipped - 6 lines]
>>
>> With VB6, VS 2003, VS 2005 or something else?
Can you please bear with me a bit longer as I foray into the world of
programming outside VBA, about which I do not know a lot?
> VB6. If the customer has Office 2K or later, you can guarantee that
> they have the VB6 runtimes already installed.
Good point, If I use VS2003 to compile an exe, I guess that a user with
Windows 2000 and Office 2000 would not have the proper dll on his machine,
right?
Or, is it that once it is compiled as an exe, it does not matter what the
user has on his machine (I guess I am asking if a compiled exe is a true
stand alone executable file)
>> How did you get many files inside one file to be distributed?
>
> Put them all inside a Winzip self-extracting archive which
> automatically runs the installer.
So, in a nutshell, you write code that queries the info you need for the
installation, copies the unzipped files to the desired location and then
deletes the unzipped files.
For this to work, you need to know the "starting folder" (where the unzipped
files are).
If you compile the code so that the resulting exe will be executed by WinZip
(or WinRar) after excretion, how do you code for that yet unknown location?
Is there in VB6 a method for reading the path were the exe being executed is
located ( a sort of "Selfpath" method or property)?
Or are you not using an exe at all?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Jonathan West - 11 Aug 2006 17:14 GMT
> Jonathan West was telling us:
> Jonathan West nous racontait que :
[quoted text clipped - 12 lines]
> Can you please bear with me a bit longer as I foray into the world of
> programming outside VBA, about which I do not know a lot?
I don't know *that* much more...
>> VB6. If the customer has Office 2K or later, you can guarantee that
>> they have the VB6 runtimes already installed.
>
> Good point, If I use VS2003 to compile an exe, I guess that a user with
> Windows 2000 and Office 2000 would not have the proper dll on his machine,
> right?
Correct.
> Or, is it that once it is compiled as an exe, it does not matter what the
> user has on his machine (I guess I am asking if a compiled exe is a true
> stand alone executable file)
No. Programs written in VB.NET or C# require the appropriate version of the
.NET framework to be installed. While those are downloadable from Microsoft,
you can't assume that people already have it.
>>> How did you get many files inside one file to be distributed?
>>
[quoted text clipped - 4 lines]
> installation, copies the unzipped files to the desired location and then
> deletes the unzipped files.
Exactly so. In fact, if you configure the Winzip Self-extractor properly,
the deletion of the unzipped files is handled automatically by Winzip
itself.
> For this to work, you need to know the "starting folder" (where the
> unzipped files are).
[quoted text clipped - 3 lines]
> location? Is there in VB6 a method for reading the path were the exe being
> executed is located ( a sort of "Selfpath" method or property)?
Yes. When you unzip them they are in the same folder as the installer
executable. In VB6, the App.Path property gets you the folder where the
executable resides. The rest is easy!

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Jean-Guy Marcil - 11 Aug 2006 18:18 GMT
Jonathan West was telling us:
Jonathan West nous racontait que :
>> Jonathan West was telling us:
>> Jonathan West nous racontait que :
[quoted text clipped - 31 lines]
> of the .NET framework to be installed. While those are downloadable
> from Microsoft, you can't assume that people already have it.
Ah, yes, the great advantage of managed code...
>>>> How did you get many files inside one file to be distributed?
>>>
[quoted text clipped - 21 lines]
> executable. In VB6, the App.Path property gets you the folder where
> the executable resides. The rest is easy!
As you write, the rest is easy... except that I have to re-install VB6 on
top of VS 2003 (I have heard that they can co-habit without any problems on
the same system). I guess that once you have written one such package it is
trivial to adapt it to new projects...
Thanks for the info and the ideas.
p.s. One last question on this.. Is it easier to query the registry to get
to the Word "Workgroup Templates" path or to start an invisible Word
instance?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Jonathan West - 12 Aug 2006 16:21 GMT
> As you write, the rest is easy... except that I have to re-install VB6 on
> top of VS 2003 (I have heard that they can co-habit without any problems
[quoted text clipped - 6 lines]
> to the Word "Workgroup Templates" path or to start an invisible Word
> instance?
It can be done either way. The advantages of going the registry route is
that it is quicker, once you have written the code. Starting up an invisible
copy of Word is time-consuming.
The disadvantage of registry route is that you would first have to work out
which version of Word is installed, because the registry keys are in
different places depending on which Office version you are using. It is
possible to find that out by querying the registry, but you would want to
test that code very carefully.
Also be aware that if the user hasn't changed the various folders in the
Tools Options File Locations tab away from the defaults, there is nothing in
the registry key at all, and you have to work out the folders relative to
the user's profile root folder.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Jean-Guy Marcil - 13 Aug 2006 18:47 GMT
Jonathan West was telling us:
Jonathan West nous racontait que :
>> As you write, the rest is easy... except that I have to re-install
>> VB6 on top of VS 2003 (I have heard that they can co-habit without
[quoted text clipped - 21 lines]
> nothing in the registry key at all, and you have to work out the
> folders relative to the user's profile root folder.
Thanks for your thoughts.
So, all in all, the registry way executes faster, but requires more code to
cover all eventualities, whereas late-binding with Word will be simple to
code, but take longer to execute.
Thanks again.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Jonathan West - 14 Aug 2006 00:19 GMT
> Jonathan West was telling us:
> Jonathan West nous racontait que :
[quoted text clipped - 30 lines]
> to cover all eventualities, whereas late-binding with Word will be simple
> to code, but take longer to execute.
That's a perfect summary.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org