Login  Register

Re: Distributing a prototype Dolphin app

Posted by Blair McGlashan-3 on Jul 14, 2004; 6:23pm
URL: https://forum.world.st/Distributing-a-prototype-Dolphin-app-tp3370977p3370985.html

"Peter Kenny" <[hidden email]> wrote in message
news:[hidden email]...

>
> Thanks Chris (and Bill Schwab) for the comments - I think I may persuade
> myself that the cost of an upgrade to D Pro now is not too great,
> especially
> when set against the cost of going to Canada for the conference. However,
> this does not deal with the question whether I can set up my program
> (whether from DVE or Pro) to run from the CD without installing anything
> on
> the host machine. The link Chris cites suggests not - it implies that it
> is
> essential to have the VM DLL in c:\Program Files\myApp and two MS DLLs in
> c:\Windows\System32. This means it will be a bit more difficult to do a
> demonstration - I have to  allow time to get the installation done and
> verified, rather than just put the CD in the drive and set it running. Is
> there such a thing as a ready-to-run CD version if I produce it using
> Lagoon?

It is not necessary to install anything on the host machine (unless you have
used external components that required installation). We gave out a stack of
Dolphin trial CDs* at a conference some years ago that had an autorun
executable
on them written in Dolphin itself. DPro includes the fundamentals of this as
an autorun sample. I've pasted the package comment below.

All of the DLLs can exist in the same directory as the deployed executable.
If you deploy as a ToGo executable (frankly there isn't much reason not to
do so) then you won't even need the VM DLL - just place the C runtime
library DLLs (MSVCRT.DLL and MSVCP60.DLL) in the root of the CD where the
autorun exe lives. In most cases you'll get away without those because they
are used by so many other programs that they are almost certainly on the
machine already, but to be sure put them on the CD because they don't take
much room.

Of course your autorun doesn't need to be a setup menu, you could launch
directly into the executable. To do that all you'd need would be to deploy
your application in ToGo mode, place it and the CRT DLLs on the CD, and then
write an autorun.inf to lauch it.

Regards

Blair

*I recall that before the conference started, we thought we'd better do a
final test that the CDs worked in our hotel room. We'd booked a room at the
Drake hotel in Chicago in order to enjoy a bit of R&R before the conference.
Unfortunately we felt rather uncomfortable even in the Drake when we
discovered that the CD didn't work. It spun up but the application would not
launch. We'd tried them at home before flying over, so we began to get
worried that they might have been damaged somehow in transit in the
aeroplane hold. Now starting to panic, we tried another, and that did work.
Phew! We decided that we would have to test every single one to sort out the
ones that worked from those that didn't. This took a few hours as I recall.
And do you know what? The only one which was faulty was the first one that
we had tried!

---------------------------
Dolphin Smalltalk Autoplay Sample.
Copyright (c) Object Arts Ltd, 2001-2002.

Autoplay is an application for use as a CD-ROM autoplay setup menu. As a
sample Autoplay demonstrates:
- Embedding the Microsoft Web Browser control in a Dolphin application (see
also the Simple Web Browser sample)
- How to prevent multiple instances of an application being started (see
AutoPlaySessionManager>>allowDuplicates)
- Simple command line processing (see AutoplaySessionManager>>main)
- Sizing a shell to precisely the right dimensions to fit a given client
area.

Although simple, Autoplay is capable of practical use, indeed Object Arts
used it for the Dolphin Pro Trial distributed at Smalltalk Solutions 2001,
and we will certainly use it again. Autoplay is now (as of Dolphin 5)
deployed in "ToGo" mode, and so does not require the Dolphin VM to run.
However to be sure that it will run on all machines, it is a good idea to
place the C runtime libraries (MSVCRT.DLL and MSVCP60.DLL) in the root
directory of the CD along with Autoplay.exe.

Autoplay can display a single page of HTML (specified by the first command
line argument, but defaulting to 'autorun.htm') at a specified fixed size
(specified by the second command line argument but defaulting to 480x480).
Normally this HTML file would contain little but an IMG tag and a map to
specify the location of links in the map. When the user clicks on the links
the HREF associated with the link is passed to the ShellExecute() API, the
result of which is to spawn off the appropriate application in another
window to open that particular type of file. This means that a separate
explorer window is opened to browse the CD (should that option be present)
and avoids the user being prompted to save/open the setup executable/MSI.

For example:

 <HTML>
   <HEAD>
     <TITLE>My Application</TITLE>
   </HEAD>
   <BODY scroll=no leftMargin=0 topMargin=0 bottomMargin=0 rightMargin=0>
     <MAP name="mymap">
       <AREA href="ReadMe.htm" shape="rect" coords="345, 147, 455, 169">
         <AREA href="setup.exe" shape="rect" coords="283, 174, 455, 197">
       <AREA href="./" shape="rect" coords="378, 266, 456, 286">
     </MAP>
     <IMG border="0" src="setupmenu.jpg" usemap="#mymap" width="480"
height="480">
   </BODY>
 </HTML>

The scroll and margin attributes associated with the BODY tag are important
to prevent the Web Browser Control displaying an unwanted scrollbar and
surrounding the graphic with a border of blank space. The areas in the map
respectively relate to the "Read Me", "Install XXX", and "Browse this CD"
links in the graphic.

CD-ROM Autoplay also requires an Autorun.inf file to be located in the root
directory of the CD-ROM. The content of this .inf file is of the following
format (for example):

 [autorun]
 OPEN=autoplay.exe autorun.htm 480@480
 ICON=AUTOPLAY.EXE,0

This specifies to run the autoplay executable (deployable from this package)
to display 'autorun.htm' in the root directory with area for a 480x480
image/page. The 'command line' arguments are parsed by
<AutoplaySessionManager> and passed to <Autoplay> before it is shown. The
separator between the width and height is not important as long as it is not
whitespace.