Board index » delphi » Delphi 1.0 takes control...

Delphi 1.0 takes control...

Hi,

Can any one  help me with this small problem or tell me where I
can go to find a solution.

Software: Delphi 1.0 16 bit. Windows 3.xx.

Program: I have created a setup program which will install zip files
onto a machine via floppy disks. I am using the VCLUnzip component. The
setup program is on disk one and all the zip files are on disk two. The
program will unzip all the files from disk two onto the hard disk. All
this works fine apart from...

The Problem: The user will goto File -> Run in windows 3.xx and type
a:setup.exe. The program will load from floppy and will ask the user to
insert disk two. When the user inserts disk two and clicks OK I get a
system Error 'Cannot read from Disk'. This does not make any sense. It
appears that the setup program takes control of the floppy disk drive.
Even if I goto file manager or DOS when setup is loaded I cannot do a
directory listing (DIR).

The program however will work if I run it from the delphi enviourment or
if setup is run from the C: drive. It also works fine if I run it from
windows 95.

Please can you tell me if there is something I need to do to release the
floppy disk and get the setup program to reconize that there is another
disk in? Is this a fault with Delphi or with windows?

I would appreaciate any suggestions or help you could give me

Richard Wilde
Software Engineer
ri...@kc3.co.uk
http://www.kc3.co.uk

 

Re:Delphi 1.0 takes control...


In article <360B5304.2...@kc3.co.uk>,
   Richard Wilde <ri...@kc3.co.uk> wrote:

[snipped]

I don't know if it is related to your problem, but I had
also weird lockups when attempting to run an installation
program I wrote sometime ago. It would run fine under Win95,
from the Delphi environment, from the hard drive, but would
fail from the floppy disk.

It turned out that one DLL (CTL3DV2.DLL), which was located
in the same directory as the install program, doesn't like
to be loaded from the install disk (it is needed by the
installation program to give a 3-D look to controls); it
seems that the latest version tolerates only to be installed
in the WINDOWS\SYSTEM\ directory, and multiple copies of
this DLL all over the place aggravate the situation. To
prevent this situation, I removed the CTL3DV2.DLL file from
the directory where the install program is located (the root
directory of your .

It's a long shot, but your first disk may contain files that
are needed (and could be still open) when the second disk is
inserted.

Hope this helps,

REMOVE nospam. in my address

Please note our recent change of area code from
714 to 949

Quoc Thang NGUYEN
Laboratory of Cellular and
Molecular Neurobiology
Dept. of Psychobiology
University of California, Irvine
Irvine, CA92717 USA
Ph: (949) 824-4730
Fx: (949) 824-3522

Re:Delphi 1.0 takes control...


Quote
Richard Wilde <ri...@kc3.co.uk> writes:
>Software: Delphi 1.0 16 bit. Windows 3.xx.

>Program: I have created a setup program which will install zip files
>onto a machine via floppy disks. I am using the VCLUnzip component. The
>setup program is on disk one and all the zip files are on disk two. The
>program will unzip all the files from disk two onto the hard disk. All
>this works fine apart from...

>The Problem: The user will goto File -> Run in windows 3.xx and type
>a:setup.exe. The program will load from floppy and will ask the user to
>insert disk two. When the user inserts disk two and clicks OK I get a
>system Error 'Cannot read from Disk'. This does not make any sense. It
>appears that the setup program takes control of the floppy disk drive.
>Even if I goto file manager or DOS when setup is loaded I cannot do a
>directory listing (DIR).

>The program however will work if I run it from the delphi enviourment or
>if setup is run from the C: drive. It also works fine if I run it from
>windows 95.

>Please can you tell me if there is something I need to do to release the
>floppy disk and get the setup program to reconize that there is another
>disk in? Is this a fault with Delphi or with windows?

>I would appreaciate any suggestions or help you could give me

>Richard Wilde
>Software Engineer
>ri...@kc3.co.uk
>http://www.kc3.co.uk

It is Windows. You have to write a 'stub' whose only purpose is to
copy (unzip/whatever) the real install program from the floppy to
the hard drive (temp directory) and start the real install program
from there. Here is the skeleton for the stub (compiled: SETUP.EXE):

program Stub;
{some of the routines I omitted for clarity: GetEnvVar, CopyFile}
uses SysUtils, WinTypes, WinProcs;
var
  S : string;
begin
S := GetEnvVar('TEMP');
if S = '' then
   S := 'C:\';
if S[Length(S)] <> '\' then
   S := S + '\';
S := S + 'MYSETUP.EXE';
try
  {write your CopyFile(Source, Target) code here}
  CopyFile(ExtractFilePath(ParamStr(0))+'MYSETUP.EXE', S);
except
  on EInOutError do
     begin
     MessageBox(0, 'Copying install program failed', 'Error', mb_Ok);
     Raise;
     end;
end;
S := S + ' ' + ExtractFilePath(ParamStr(0)) + #0; {WinExec expects PChar}
if WinExec(@S[1], sw_ShowNormal) < 32 then
   MessageBox(0, 'Cannot start install program', 'Error', mb_Ok);
end.

As you can see, the real install program gets the source path (floppy or any
directory in fact) as a parameter so it knows where to install the files from.

Thomas Nagy
-----------------------------------------------------------
Check out my cats! (http://members.tor.shaw.wave.ca/~tnagy/)

Re:Delphi 1.0 takes control...


That's not quite true.

If you write a generic windows app and make sure you load and lock all
resources, libraries etc. so Windows doesn't try to 'swap out' and 'reload'
anything you can do it. Or at least I managed to do it for a 3 disk
installation program for Win3.1 that still seems to work correctly under
95/98/NT also.

I will state, all it does is create a directory, use the 'lzexpand' dll to
expand and copy the files from the floppies and creates a program group and
program icons (Start menu additions under Win95). It does not create any
shortcuts, uninstall information (I wrote an uninstall program also to
match) or edit the registry in any way under Win95.

I did it this way so I could include a DOS batch file to also install with
(if something was going wrong) and later versions of DOS have the EXPAND
program included to handle the 'compressed' files. To uninstall, simply
delete the directory

By the way, the COMPRESS program to create EXPAND files comes with BC5.x.

I'd be happy to post the code (or ask via email) if enough want it as a
'template' of what to try. Pascal, compiles under Delphi1. have no idea for
Delphi 2,3 & 4.

Paul J. Poirier
p...@istar.ca

Quote
Thomas Nagy wrote in message ...
>Richard Wilde <ri...@kc3.co.uk> writes:
>>Software: Delphi 1.0 16 bit. Windows 3.xx.

>>Program: I have created a setup program which will install zip files
>>onto a machine via floppy disks. I am using the VCLUnzip component. The
>>setup program is on disk one and all the zip files are on disk two. The
>>program will unzip all the files from disk two onto the hard disk. All
>>this works fine apart from...

>>The Problem: The user will goto File -> Run in windows 3.xx and type
>>a:setup.exe. The program will load from floppy and will ask the user to
>>insert disk two. When the user inserts disk two and clicks OK I get a
>>system Error 'Cannot read from Disk'. This does not make any sense. It
>>appears that the setup program takes control of the floppy disk drive.
>>Even if I goto file manager or DOS when setup is loaded I cannot do a
>>directory listing (DIR).

>>The program however will work if I run it from the delphi enviourment or
>>if setup is run from the C: drive. It also works fine if I run it from
>>windows 95.

>>Please can you tell me if there is something I need to do to release the
>>floppy disk and get the setup program to reconize that there is another
>>disk in? Is this a fault with Delphi or with windows?

>>I would appreaciate any suggestions or help you could give me

>>Richard Wilde
>>Software Engineer
>>ri...@kc3.co.uk
>>http://www.kc3.co.uk

>It is Windows. You have to write a 'stub' whose only purpose is to
>copy (unzip/whatever) the real install program from the floppy to
>the hard drive (temp directory) and start the real install program
>from there. Here is the skeleton for the stub (compiled: SETUP.EXE):

>program Stub;
>{some of the routines I omitted for clarity: GetEnvVar, CopyFile}
>uses SysUtils, WinTypes, WinProcs;
>var
>  S : string;
>begin
>S := GetEnvVar('TEMP');
>if S = '' then
>   S := 'C:\';
>if S[Length(S)] <> '\' then
>   S := S + '\';
>S := S + 'MYSETUP.EXE';
>try
>  {write your CopyFile(Source, Target) code here}
>  CopyFile(ExtractFilePath(ParamStr(0))+'MYSETUP.EXE', S);
>except
>  on EInOutError do
>     begin
>     MessageBox(0, 'Copying install program failed', 'Error', mb_Ok);
>     Raise;
>     end;
>end;
>S := S + ' ' + ExtractFilePath(ParamStr(0)) + #0; {WinExec expects PChar}
>if WinExec(@S[1], sw_ShowNormal) < 32 then
>   MessageBox(0, 'Cannot start install program', 'Error', mb_Ok);
>end.

>As you can see, the real install program gets the source path (floppy or
any
>directory in fact) as a parameter so it knows where to install the files
from.

>Thomas Nagy
>-----------------------------------------------------------
>Check out my cats! (http://members.tor.shaw.wave.ca/~tnagy/)

Re:Delphi 1.0 takes control...


I am living in a nightmare I swear.

I have a Delphi 3 app which now supports drag & drop when the app is OPEN.

Now I want to say, have an alias on my win95 desktop, and I want to drag a
file on it.  This means I have to catch it with the param tag right?  Okay
all the files open, except they are all 8.3 letters!  I have tried several
routines one in which it ALMOST works until you try to drag & drop from
network neighborhood. Then the network path gets all messed up,
\\&@\@r5\blah\blah

I am at the end of my rope! Ahhhhhhh!  Now I hear that NT paramstr returns the
long filename!!!!! ahhhhhhh.

Could someone PLEASE spread some light on what I am doing wrong?  Please, I
will give you my first born!

Here is the URL for the short - long conversion I tried.

http://www.zdjournals.com/ddj/9608/ddj9681.htm

Here is the URL for the drag & Drop.

http://www.chami.com/tips/delphi/111196D.html

if you have and answer could you email it to me as well as post it?

thanks!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

Other Threads