PDA

View Full Version : XcopyFile function bug



NewsArchive
11-05-1999, 01:00 AM
-2147024894 is a standard system error which means "The system cannot find
the file specified. "

What the value of SRCDIR and szSourceFileName here?


pjh <semaphore@email.com> wrote in message
news:3823083c.1@news.installshield.com...
> For all of you that enjoy a challenge, here's a bone. This problem is
> somewhat lengthy to define, so I'll lay out a small snippet of code that
> should reproduce the error on anyone's machine. The problem is that
> XCopyFile does not seem to work at all when a CD-ROM disc swap during
setup
> is performed, but this works when running from network drive, then telling
> IS that another MyInstallations subdir is disc #2 when it asks...
>
> if(EnterDisk("Please insert Disc #2", "NksDataOper.mdb") < 0) then
>
> MessageBox("Setup cannot continue without the correct disk.
> Aborting.", SEVERE);
> abort;
>
> else
>
> if(ComponentIsItemSelected(MEDIA, "Databases\\DataSEC")) then
> gszSECLocal = "1";
> nCur++;
> nResult = XCopyFile(SRCDIR + "\\" + szSourceFileName,
> TARGETDIR, COMP_UPDATE_DATE);
> endif;
>
> endif;
>
> I have a bunch of large databases that I put into the LastDisk in
Setup
> Files tab, Advanced node. After the main installshield engine runs and
> installs all of my program files and dependencies, I have subroutines that
> prompt for the data CDs and then use XCopyFile to move them all over
(cannot
> include in regular install, too big, take too long to build and is more
> managable this way).
>
> This code works great when testing ur install across the network,
> selecting the LastDisk subdir under MyInstallations as Disk2. BUT...after
> burning everything onto CDs, no XCopyFile worky, no CopyFile worky either,
> comes up with error -2147024894, which is not in KB, newsgroup, IS help,
or
> tech support brains. It seems to have something to do with the swapping
of
> media in the drive.
>
> My test computer is a clean machine that always has 98 or 95 OS
> installed clean before every test. This is a new machine, so there are no
> hardware or primitive-version firmware problems, this seems to be a
> low-level bug somewhere in the XCopyFile and CopyFile code chain.
>
> Sorry for writing a novel about this...but it does seem to be a VERY
> real problem, as I am dead in the water. I already threw IS Windows
> Installer in the frickin garbage because it had so many bugs. I switched
> over the IS6 (MP1), and it seemed to jump right in there and solve all my
> problems and work really beautifully. BUT NOW, when I am on final test of
> my builds, IT BOMBS!!!!! Dammit!! Folks, can we get SOMETHING right
> here????? Where's MP2? huh??? Where are the answers? Why don't tech
> support staff ever call me back? What the hell is going on here?
>
> I feel COMPLETELY RIPPED OFF!
>
> Thanks,
> Peter Holt
>
>

NewsArchive
11-05-1999, 01:00 AM
Thanks for your reply.

This is not a problem with my code, my variables, or the values of them
because the code works when testing across the network. The problem only
occurs after burning final, tested install onto CDs for real-world testing.
I can pop in the data CDs and copy the files over using Windows Explorer, so
it can't be a media or hardware fault either.

Here's a good example of what I believe is happening:

1. Put a floppy diskette into your A: drive and bring up it's contents
in Windows Explorer so that you can see it's files in the right-hand pane of
Explorer.

2. Remove the disk.

3. Insert new disk.

4. Now try to run one of the files in the Explorer's right-hand pane.

This will cause an error, because the OS will still believe that the
original disk is in the drive and will blindly attempt to execute a file
from media that has changed -- ie the OS does not realize that you made a
disk swap. You will get an error similar to "invalid disk serial number" or
something. I believe that IS is not properly refreshing itself to handle
this, and therefore does not realize that a new disk has been inserted.

Also, notice the tag file in the EnterDisk call. It does see this file
on the newly inserted CD and accepts it, but then XCopyFile will die when
trying to copy that same exact file.

Hope that helps...thanks for the quick response.

Peter Holt

Mingbiao Fei <fei@is.com> wrote in message
news:382315b0.0@news.installshield.com...
> -2147024894 is a standard system error which means "The system cannot find
> the file specified. "
>
> What the value of SRCDIR and szSourceFileName here?
>
>
> pjh <semaphore@email.com> wrote in message
> news:3823083c.1@news.installshield.com...
> > For all of you that enjoy a challenge, here's a bone. This problem
is
> > somewhat lengthy to define, so I'll lay out a small snippet of code that
> > should reproduce the error on anyone's machine. The problem is that
> > XCopyFile does not seem to work at all when a CD-ROM disc swap during
> setup
> > is performed, but this works when running from network drive, then
telling
> > IS that another MyInstallations subdir is disc #2 when it asks...
> >
> > if(EnterDisk("Please insert Disc #2", "NksDataOper.mdb") < 0)
then
> >
> > MessageBox("Setup cannot continue without the correct disk.
> > Aborting.", SEVERE);
> > abort;
> >
> > else
> >
> > if(ComponentIsItemSelected(MEDIA, "Databases\\DataSEC"))
then
> > gszSECLocal = "1";
> > nCur++;
> > nResult = XCopyFile(SRCDIR + "\\" + szSourceFileName,
> > TARGETDIR, COMP_UPDATE_DATE);
> > endif;
> >
> > endif;
> >
> > I have a bunch of large databases that I put into the LastDisk in
> Setup
> > Files tab, Advanced node. After the main installshield engine runs and
> > installs all of my program files and dependencies, I have subroutines
that
> > prompt for the data CDs and then use XCopyFile to move them all over
> (cannot
> > include in regular install, too big, take too long to build and is more
> > managable this way).
> >
> > This code works great when testing ur install across the network,
> > selecting the LastDisk subdir under MyInstallations as Disk2.
BUT...after
> > burning everything onto CDs, no XCopyFile worky, no CopyFile worky
either,
> > comes up with error -2147024894, which is not in KB, newsgroup, IS help,
> or
> > tech support brains. It seems to have something to do with the swapping
> of
> > media in the drive.
> >
> > My test computer is a clean machine that always has 98 or 95 OS
> > installed clean before every test. This is a new machine, so there are
no
> > hardware or primitive-version firmware problems, this seems to be a
> > low-level bug somewhere in the XCopyFile and CopyFile code chain.
> >
> > Sorry for writing a novel about this...but it does seem to be a VERY
> > real problem, as I am dead in the water. I already threw IS Windows
> > Installer in the frickin garbage because it had so many bugs. I
switched
> > over the IS6 (MP1), and it seemed to jump right in there and solve all
my
> > problems and work really beautifully. BUT NOW, when I am on final test
of
> > my builds, IT BOMBS!!!!! Dammit!! Folks, can we get SOMETHING right
> > here????? Where's MP2? huh??? Where are the answers? Why don't tech
> > support staff ever call me back? What the hell is going on here?
> >
> > I feel COMPLETELY RIPPED OFF!
> >
> > Thanks,
> > Peter Holt
> >
> >
>
>

NewsArchive
11-05-1999, 01:00 AM
Attached is the script that does all the copying using XCopyFile. The entry
point is function StartDatabasesCopy that is called from the OnFirstUIAfter
event in setup.rul.

Mingbiao Fei <fei@is.com> wrote in message
news:382315b0.0@news.installshield.com...
> -2147024894 is a standard system error which means "The system cannot find
> the file specified. "
>
> What the value of SRCDIR and szSourceFileName here?
>
>
> pjh <semaphore@email.com> wrote in message
> news:3823083c.1@news.installshield.com...
> > For all of you that enjoy a challenge, here's a bone. This problem
is
> > somewhat lengthy to define, so I'll lay out a small snippet of code that
> > should reproduce the error on anyone's machine. The problem is that
> > XCopyFile does not seem to work at all when a CD-ROM disc swap during
> setup
> > is performed, but this works when running from network drive, then
telling
> > IS that another MyInstallations subdir is disc #2 when it asks...
> >
> > if(EnterDisk("Please insert Disc #2", "NksDataOper.mdb") < 0)
then
> >
> > MessageBox("Setup cannot continue without the correct disk.
> > Aborting.", SEVERE);
> > abort;
> >
> > else
> >
> > if(ComponentIsItemSelected(MEDIA, "Databases\\DataSEC"))
then
> > gszSECLocal = "1";
> > nCur++;
> > nResult = XCopyFile(SRCDIR + "\\" + szSourceFileName,
> > TARGETDIR, COMP_UPDATE_DATE);
> > endif;
> >
> > endif;
> >
> > I have a bunch of large databases that I put into the LastDisk in
> Setup
> > Files tab, Advanced node. After the main installshield engine runs and
> > installs all of my program files and dependencies, I have subroutines
that
> > prompt for the data CDs and then use XCopyFile to move them all over
> (cannot
> > include in regular install, too big, take too long to build and is more
> > managable this way).
> >
> > This code works great when testing ur install across the network,
> > selecting the LastDisk subdir under MyInstallations as Disk2.
BUT...after
> > burning everything onto CDs, no XCopyFile worky, no CopyFile worky
either,
> > comes up with error -2147024894, which is not in KB, newsgroup, IS help,
> or
> > tech support brains. It seems to have something to do with the swapping
> of
> > media in the drive.
> >
> > My test computer is a clean machine that always has 98 or 95 OS
> > installed clean before every test. This is a new machine, so there are
no
> > hardware or primitive-version firmware problems, this seems to be a
> > low-level bug somewhere in the XCopyFile and CopyFile code chain.
> >
> > Sorry for writing a novel about this...but it does seem to be a VERY
> > real problem, as I am dead in the water. I already threw IS Windows
> > Installer in the frickin garbage because it had so many bugs. I
switched
> > over the IS6 (MP1), and it seemed to jump right in there and solve all
my
> > problems and work really beautifully. BUT NOW, when I am on final test
of
> > my builds, IT BOMBS!!!!! Dammit!! Folks, can we get SOMETHING right
> > here????? Where's MP2? huh??? Where are the answers? Why don't tech
> > support staff ever call me back? What the hell is going on here?
> >
> > I feel COMPLETELY RIPPED OFF!
> >
> > Thanks,
> > Peter Holt
> >
> >
>
>

NewsArchive
10-09-2000, 12:00 AM
Hallo Dirk,

because the files I have to copy, aren't that big, I have made a workaround
with open binary, readbytes and writebytes.
It works, but I get files with new creationdate.

I'm looking for a API-solution.

Question:
Do you have pure 1.52-projects, that don't show this behaviour?

Johannes

"Dirk Gessner" <Dirk.Gessner@Metechnology.com> schrieb im Newsbeitrag
news:39ddbdad$1@12.41.20.38...
> > does anybody have tried to use XCopyFile/CopyFile in the IS-Script?
> > Very often, but not allways, I get -2147023174 as returncode.
>
> That is exactly what I get, if I migrate a working project from ISWI 1.10
to
> ISWI 1.5. The error number may differ alittle bit. I get this or a similar
> error from every call of this functions. The temporary solution is to have
> two machines: one for the maintenance of ISWI1.10 project and one for the
> ones based on ISWI 1.5 - very frustrating.
> I asked for this behavior in this newsgroup (no answer) and at
Installshield
> Germany (they didn't know anything about such a behavior).
>
> I'm very interested in a solution too.
>
> Dirk
>
>

NewsArchive
10-09-2000, 12:00 AM
> because the files I have to copy, aren't that big, I have made a
workaround
> with open binary, readbytes and writebytes.
> It works, but I get files with new creationdate.

I thought about a similary solution. But I need to copy a lot of template
files. So this is no solution to me. It would be possible to perform the
copy action via a console command.

> Question:
> Do you have pure 1.52-projects, that don't show this behaviour?

We don't use 1.52 but 1.50. Here the error occurs sometimes. Sometimes it
disappears in a irregular manner.

Dirk

NewsArchive
11-17-2000, 01:00 AM
Thanks for the response!, If I use it in OnFirstUIBefore how do I make sure
its not transfered again during the Component_Installing event?

Thanks again

"Olga-InstallShield" <supportnews@installshield.com> wrote in message
news:3a14bc2f$1@12.41.20.38...
> Vic,
>
> It depends on when you want the exe file to be available.
> If you want it to be available before the support files that are in
> components are, then you put it in the OnFirstUIBefore event.
> If you want it to be available after the support files are on the target
> machine you put the XCopyFile call in the OnFirstUIAfter.
> If you want it to be copied concurrently with the support files you put it
> in the Component_Installing event.
> I hope this clarifies the issue.
>
> --
> Sincerely,
>
> Olga K.
> InstallSheild Technical Support
>
> "Vic" <vjdavis@travelbrains.com> wrote in message
> news:3a14b5f5$1@12.41.20.38...
> > Hello,
> > I'm completely new to InstallShield and I need some help. I want to use
> > XCopy to load an executable onto the user's machine (in addition to a
main
> > executable and support files that are in a component that should be
> > transfered normally) and check and see if a older version exits...if it
> does
> > I want to overwrite it otherwise just leave it alone. XCopy seens to be
> the
> > way to go but where does this function belong. The event structure is
> still
> > a bit fuzzy to me. Anybody have any advice or instructions?
> >
> > Vic
> >
> >
>
>

NewsArchive
11-17-2000, 01:00 AM
Vic,

The OnFirstUIBefore is called when the setup is installing for the first
time.
Just make sure you do not include this particular file in the file groups.
Just include it in the SetupFiles tab and use the XCopyFile command in the
OnFirstUIBefore event.

--
Sincerely,

Olga K.
InstallSheild Technical Support

"Vic" <vjdavis@travelbrains.com> wrote in message
news:3a14d4c4$1@12.41.20.38...
> Thanks for the response!, If I use it in OnFirstUIBefore how do I make
sure
> its not transfered again during the Component_Installing event?
>
> Thanks again
>
> "Olga-InstallShield" <supportnews@installshield.com> wrote in message
> news:3a14bc2f$1@12.41.20.38...
> > Vic,
> >
> > It depends on when you want the exe file to be available.
> > If you want it to be available before the support files that are in
> > components are, then you put it in the OnFirstUIBefore event.
> > If you want it to be available after the support files are on the target
> > machine you put the XCopyFile call in the OnFirstUIAfter.
> > If you want it to be copied concurrently with the support files you put
it
> > in the Component_Installing event.
> > I hope this clarifies the issue.
> >
> > --
> > Sincerely,
> >
> > Olga K.
> > InstallSheild Technical Support
> >
> > "Vic" <vjdavis@travelbrains.com> wrote in message
> > news:3a14b5f5$1@12.41.20.38...
> > > Hello,
> > > I'm completely new to InstallShield and I need some help. I want to
use
> > > XCopy to load an executable onto the user's machine (in addition to a
> main
> > > executable and support files that are in a component that should be
> > > transfered normally) and check and see if a older version exits...if
it
> > does
> > > I want to overwrite it otherwise just leave it alone. XCopy seens to
be
> > the
> > > way to go but where does this function belong. The event structure is
> > still
> > > a bit fuzzy to me. Anybody have any advice or instructions?
> > >
> > > Vic
> > >
> > >
> >
> >
>
>

OsmanH
10-18-2001, 03:01 AM
IDE :
IS Pro 2000 ( ver. 6.1 )

Message :
(sorry for my english)
hi everybody !

I have a problem with XcopyFile function. After setting up the SRCDIR (to a path which doesn't exist) and the TARGETDIR to copy files, the xcopyfile function returns me 0 ( the file copy was succefull), but no files were copied.

And I have registred my Installshield Pro, and I cannot download the maintenance release. (I don't know the problem yet, I will send a message to Installshield later, if anyone can send me the release ?)

thank you :)

Osman hussain
osman.hussain@delphisoft.ch

JG Heithcock
07-11-2008, 04:59 PM
I was also having this error (using either XCopyFile or CopyFile) and discovered I needed to use LongPathToShortPath.

Here is the relevant code snippet (I am copying a file from the install dir to the folder containing it):


szSrcPath = INSTALLDIR ^ "myfile.dat";
LongPathToShortPath(szSrcPath);
szTargPath = INSTALLDIR ^ "..\\myfile.dat";
LongPathToShortPath(szTargPath);
nResult = CopyFile(szSrcPath, szTargPath);

Hope this helps!

JG