Extract the logic for determining the path to an archive file.