Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

CRC Error - CD Media vs CAB files


7 replies to this topic

panzercat

panzercat
  • Members
  • 2 posts

Posted 22 May 2003 - 19:33

I wanted to build the setup program to copy files from a CD-ROM folder to the hard drive during installation rather than putting the files to be installed into a .cab file. The purpose was so that later as new patches are available, we can simply copy the new product .exe files to the directory with the setup files and have it install the new patched product without having to rebuild the Install Shield project.

I thought I found all of the places to enable this:
-In the Components tab, I set my component to use a CD-ROM folder which will contain the .exe file
-In File Groups tab, I set the Compressed flag to NO
-In the media tab, in the properties | Layout, I set it for 'All data files should be placed in CDROM folder(s) by the build'

So it seems to do all of that, it creates directories in the media directory and places the exe files in those directories. When I run the install it works fine.

If I then go to the Disk1 folder, and under my utility folder, replace that exe file and then run setup, it starts to copy the file, and then comes up with an error that says "CRC error: The file 'c:\temp\crctest\PasswordUtil.exe' doesn't match the files in the setup's .cab file. The medium from which you are running the setup may be corrupted; contact your software vendor." - Abort/Retry/Cancel. If I abort, nothing gets copied, if I Ignore, it copies the version that apparently it has the .cab file - the old version. I thought by changing the above settings, it would not put the files in a .cab file, and instead just copy them from the CDROM directory. I don't want it to include a version in the .cab file - does it do that by default no matter what settings I use? It seems to have files in both places. I guess their thinking here is that the user could choose to install the program, which would come out of the .cab file, or perhaps with a 'compact' installation choice, it could run from the CDROM drive, but it assumes both copies of the files would be the same.

So it seems I cannot simply replace files in the setup directory without rebuilding Install Shield - unless I completely forget the idea of using the File Groups, and simply copy the files myself in a script.

Has anyone else tried to do something like this and found the proper settings that would allow it?

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 23 May 2003 - 03:17

Wow, such a long explination, but better to say more than less.

Yes, normally CRC checking is a good thing, but not in your case. Fortunately, it's easy to override. Simply use the drop-down combo boxes in InstallShield to add the Miscellaneous | MD5 Error, and then override the resulting OnMD5Error event so it always does the following:

CODE
return ERR_IGNORE

That's it. Problem solved.

By the way, most of these kinds of things have an event associated which drives the default behavior, so next time something similar comes up (i.e. prompt to overwrite a read-only file), check these combo boxes. wink.gif

Edited by TacoBell00, 23 May 2003 - 03:18.

user posted image

panzercat

panzercat
  • Members
  • 2 posts

Posted 23 May 2003 - 20:19

Thanks TacoBell for your help, I don't think I would have ever found the Miscellaneous | MD5 Error option.

That does make the CRC error go away, but it still doesn't fix my real problem. Basically overriding that function has the same effect as pressing Ignore when the CRC error message came up before - and the problem that remains is InstallShield copies the OLD version of the product's executable to the hard drive which apparently is stored in the .cab file, it does not use the exe that is uncompressed in the media.

Is there a way to use File Groups, but not have InstallShield put files in the .CAB files? From the options I selected, I really thought that I had instructed InstallShield to copy the uncompressed file from the media, but it appears to the casual observer that InstallShield secretly puts all of the files from the File Groups into a cab file, and then when I do a build, it also makes a copy of the file and puts it uncompressed in the media.

As far as I can tell, my only option is to abandon File Groups and just manually copy files from the SRCDIR to the TARGETDIR.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 24 May 2003 - 00:11

Okay, I sort of lead you astray on my sample code. Sorry about that.

I thought returning ERR_IGNORE would simply make it ignore the CRC error and copy the file anyway. Turns out such is NOT the case. However, I'm sure it's not copying the old file from the CAB. What it's actually doing is completely skipping the copying of that new file thereby leaving the old, original one intact.

You're in luck though. Looks like there's enough information available to overwrite this behavior to get what you want without sacrificing the File Groups. Over the long weekend, I'll mess around with it and pull together some code which does this for you.
user posted image

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 May 2003 - 06:45

QUOTE (TacoBell00 @ 2003-05-24 01:11)
What it's actually doing is completely skipping the copying of that new file thereby leaving the old, original one intact.

Please double check if this is really true. In my observation (but that might have been version 5) it would copy the new file from CD, but apply size and date information from the CAB file. So look at the version info and content of the file after installation to see what it really is.

The clean solution would be to use XCopyFile to copy that file, or refresh the information in the CAB using the command line CAB tool that comes with IS6.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 25 May 2003 - 11:49

QUOTE (Stefan Krueger @ 2003-05-25 01:45)
QUOTE (TacoBell00 @ 2003-05-24 01:11)
What it's actually doing is completely skipping the copying of that new file thereby leaving the old, original one intact.

Please double check if this is really true. In my observation (but that might have been version 5) it would copy the new file from CD, but apply size and date information from the CAB file. So look at the version info and content of the file after installation to see what it really is.

The clean solution would be to use XCopyFile to copy that file, or refresh the information in the CAB using the command line CAB tool that comes with IS6.

Yeah Stefan you got me there. I meant to say that it "'sounds like' such is NOT the case", and therefore "'What it's probably' doing ... ", but edited out my uncertainty based on panzercat's observations.

I will check it out though because I thought the actions that panzercat had originally taken would be enough, less the CRC message, to get the desired effect. Although I've never tried to achieve this myself, so stay tuned.

By the way, this will be going in the FAQ as part of the advanced topics one we're through.

Edited by TacoBell00, 25 May 2003 - 11:51.

user posted image

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 10 June 2003 - 01:29

I'm sorry panzercat for the delay in getting back with you on this matter. I apologize.

I'll check it out this week and let you know.

Edited by TacoBell00, 11 June 2003 - 00:30.

user posted image

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 24 June 2003 - 00:10

Alright, so I finally got a chance to try this out for myself and I must say I was disappointed. sad.gif

In my test scenario, I had the original file A and the updated file B. In my project I also overrode the "MD5 Error" event to simply return ERR_IGNORE.

Now if nothing was previously installed and I swapped A out with B for my setup, then B's size & content would be automatically installed with A's date/time stamp. No suprise there really.

However, if the file A previously existed, then I could NOT get B to take its place. Either in maintenance mode or in a first time setup. The only way I could achieve this was to either uninstall & reinstall the product or use the ISCab utility to refresh the Data1.cab with the updated information.

However, accomplishing the latter is a three step process the first time around. Have to run it with the -lx option to generate the INI, modify the INI to only include the update files and their respective locations, and then re-run it with the -a option to add the new information.

Not to mention that the next time you rebuild your setup, these CD-ROM files are going to be overwritten anyway back to the originals!

Therefore, it seems to me you're better off updating the real data files any way, or abanding file groups all together and just using XCopyFile.
user posted image