Exemplo n.º 1
0
        private bool TestWritePermissions()
        {
            var success = true;

            success = Utils.IsDirectoryWritable(managedPath) && success;
            success = Utils.IsFileWritable(managerAssemblyPath) && success;
            success = Utils.IsFileWritable(GameInfo.filepathInGame) && success;

            foreach (var file in libraryPaths)
            {
                success = Utils.IsFileWritable(file) && success;
            }

            //if (machineDoc != null)
            //{
            //    success = Utils.IsFileWritable(machineConfigPath) && success;
            //}
            if (selectedGameParams.InstallType == InstallType.DoorstopProxy)
            {
                success = Utils.IsFileWritable(doorstopPath) && success;
            }
            else
            {
                success = Utils.IsFileWritable(entryAssemblyPath) && success;
                if (injectedEntryAssemblyPath != entryAssemblyPath)
                {
                    success = Utils.IsFileWritable(injectedEntryAssemblyPath) && success;
                }
            }

            return(success);
        }
Exemplo n.º 2
0
        private bool TestWritePermissions()
        {
            var success = true;

            success = Utils.IsDirectoryWritable(managedPath) && success;
            success = Utils.IsFileWritable(managerAssemblyPath) && success;
            success = Utils.IsFileWritable(GameInfo.filepathInGame) && success;
            success = libraryPaths.Aggregate(success, (current, file) => Utils.IsFileWritable(file) && current);

            if (selectedGameParams.InstallType == InstallType.DoorstopProxy)
            {
                success = Utils.IsFileWritable(doorstopPath) && success;
            }
            else
            {
                success = Utils.IsFileWritable(entryAssemblyPath) && success;
                if (injectedEntryAssemblyPath != entryAssemblyPath)
                {
                    success = Utils.IsFileWritable(injectedEntryAssemblyPath) && success;
                }
            }

            return(success);
        }