PDA

View Full Version : Problem deleting file



NewsArchive
03-04-2010, 02:12 AM
Hi,
Every install I need to delete de Formats.FDB file in the data folder.
I´m using the Delet file script command and allways returns error1.
The path name is ok and so on.
What else can I check?
Thanks
Alberto

NewsArchive
03-04-2010, 02:13 AM
Alberto,

> Every install I need to delete de Formats.FDB file in the data folder.
> I´m using the Delet file script command and allways returns error1.
> The path name is ok and so on.
> What else can I check?

If the function succeeds, the %_SB_ERRORCODE% return value is nonzero.
If the function fails, the return value is zero

In other words, if your %_SB_ERRORCODE% returns "1" then you are safe and
the Delete File(s) installer function deleted the file.

Does this help?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
03-04-2010, 02:13 AM
No, It return 1 and the file is still there...

Alberto

NewsArchive
03-04-2010, 02:13 AM
Forget it... solved, thanks

Alberto

NewsArchive
03-04-2010, 02:14 AM
>
> No, It return 1 and the file is still there...
>

With SB71? The "Delete File(s)..." function is a wrapper to the DeleteFile
Windows API. If this function fails then "0" is returned.

http://msdn.microsoft.com/en-us/library/aa363915(VS.85).aspx

Just tested this in different scenarios (file locked, file not found, file
read-only) and it only returns a nonzero value if the function succeeded.

Friedrich