deleteFile fails with "Cannot delete file" when directory contains files with long paths

Answered

Comments

2 comments

  • Avatar
    wojciechka

    Due to compatibility with older versions of Windows, InstallBuilder does not support paths longer than 255 bytes on this platform.

    Regarding rmdir, this command is not an actual binary, but a command accessible from cmd only. The recommended way to delete a directory recursively on Windows is to do:

    <runProgram> <program>cmd</program> <programArguments>/C "rd /Q/S ${installdir.dos}\dir"</programArguments> </runProgram>

    To ensure the deletion does not fail in case the directory does not exist, what can be done is:

    <runProgram> <program>cmd</program> <programArguments>/C "rd /Q/S ${installdir.dos}\dir"</programArguments> <abortOnError>0</abortOnError> <showMessageOnError>0</showMessageOnError> </runProgram>

    The <abortOnError> and <showMessageOnError> will run the command without showing error in case it fails.

  • Avatar
    StevenMedan

    Yeah, I have a "Long Path Tool" that will solve all your problems. You don`t worry now our tools give you a proper solutions to all your file error related problems. Once you try this tool you will be more happier.

Please sign in to leave a comment.