Closed
Bug 20773
Opened 25 years ago
Closed 25 years ago
If a file already exists in the target location, filecopy script fails. Error -201 returned, Install Failed.
Categories
(Core Graveyard :: Installer: XPInstall Engine, defect, P3)
Tracking
(Not tracked)
VERIFIED
FIXED
M15
People
(Reporter: depman1, Assigned: ssu0262)
Details
builds 1999120208-M12 and 1999120308-M12. reproduced on Win98. 1. Make sure you have smrtupdt.txt file located on your C:\..\Program\chrome directory. My dir = C:\Program Files\Netscape\Seamonkey\chrome. Alternatively, 2. Go to XPInstall test page: http://jimbob/trigger2.html. 3. From the dropdown menu, select a_fileop_filecopy. 4. Press Trigger case. OK. 5. Check target directory. Result 1: smrtupdt.txt time stamp is not updated. old copy (i.e. 12/3/99 5:07). 6. Check logfile. Result 2: (logfile contents): http://jimbob/jars/a_fileop_filecopy.xpi -- 12/03/1999 17:09:19 --------------------------------------------------------------------------- Acceptance: a_fileop_filecopy ----------------------------- ** AddSubcomponent returns = 0 ** FileCopy returns = 0 Item [1/2] Installing: C:\Program Files\Netscape\Seamonkey\smrtupdt.txt Install **FAILED** with error -201 Install **FAILED** with error -201 Finished Installation 12/03/1999 17:09:21 Expected: Installation should succeed. No errors reported and smrtupdt.txt should copy to target directory w/ updated timestamp. ****************************************************************************** Here is contents of filecopy script: //////////////////////////////////////////////////////////////////////////////// //////// // a_fileop_filecopy.js // // Acceptance test // • Checks the ability to copy a known file to a known directory // • A file, smrtupdt.txt, is installed under the "Program" directory // • smrtupdt.txt is copied to /chrome // // ~ XPInstall QA // October 4, 1999 //////////////////////////////////////////////////////////////////////////////// ////////// var jarSrc = "smrtupdt.txt" Install.StartInstall("Acceptance: a_fileop_filecopy", "acceptance", "1.1.1.1", 0); f = Install.GetFolder("Program"); g = Install.GetFolder("Chrome"); err1 = Install.AddSubcomponent("fileop_filecopy", jarSrc, f, jarSrc); Install.LogComment("AddSubcomponent returns = " + err1); fileSource = f + "/smrtupdt.txt"; fileTarget = g; err2 = Install.FileCopy(fileSource, fileTarget); Install.LogComment("FileCopy returns = " + err2); if (0 == Install.GetLastError()) Install.FinalizeInstall(); else Install.AbortInstall();
Updated•25 years ago
|
Assignee: cathleen → ssu
Target Milestone: M13
Comment 1•25 years ago
|
||
Note that this test case by itself is bogus, and I have seen several that make the same mistake. This test adds a file and then uses it without calling FinalizeInstall() in between! The initial file is NOT INSTALLED until it is finalized!!! (our tempname generation happens to put the file under the final name if it doesn't already exist, but that's an implementation detail that may change, and is wrong anyway in my opinion.) I am not saying the bug found here is not real, there probably is a copy bug, but this test case would only find it on the second time it is run. Assigning to Sean. If it turns out to be a nsFileSpec problem pass it along to Doug.
Reporter | ||
Updated•25 years ago
|
Summary: If a file already exists in the target location, filecopy doesn't work. Error -201 returned, Install Failed. → If a file already exists in the target location, filecopy (and filemove) script fails. Error -201 returned, Install Failed.
Reporter | ||
Comment 2•25 years ago
|
||
Same thing happens for filemove...I originally found this after running the test a 2nd time, and wanted to edit the bug steps. Placing a file in target location was just a quick way to reproduce the problem, but I see your point. I'll only put the legit steps in from now on! Also, change "Expected" above to: Install script should succeed with no errors. (if file is already in target location, maybe better that it's not overwritten).
Comment 3•25 years ago
|
||
Whoa -- please write a separate bug for FileMove. On many systems you cannot do a "move" to an already occupied location so this might be expected behavior. For "copy" this is clearly a bug.
Reporter | ||
Updated•25 years ago
|
Summary: If a file already exists in the target location, filecopy (and filemove) script fails. Error -201 returned, Install Failed. → If a file already exists in the target location, filecopy script fails. Error -201 returned, Install Failed.
Reporter | ||
Comment 4•25 years ago
|
||
submitted 21085 for filemove case.
Bulk move of XPInstall (component to be deleted) bugs to Installer: XPInstall Engine
Updated•25 years ago
|
Target Milestone: M13 → M15
Comment 6•25 years ago
|
||
Post beta
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•