Beispiel #1
0
        private InstallationStatus MoveFile(string targetFile, string destinationPath, GameModification mod)
        {
            // Have we already moved this file to the exact same destination?
            if (HasMovedFileToSameDestination(targetFile, destinationPath))
            {
                return(InstallationStatus.Success);
            }

            if (ModCollisionTracker.HasMoveCollision(mod, targetFile, destinationPath, modifications, out var collision))
            {
                return(HandleCollision(collision));
            }

            if (!File.Exists(targetFile))
            {
                throw new Exception($"Unable to find target path: {targetFile}");
            }

            MoveFile_Internal(targetFile, destinationPath, mod);
            return(InstallationStatus.Success);
        }