コード例 #1
0
ファイル: Form.cs プロジェクト: coodjokergl/UnitModeManager
        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);
        }
コード例 #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);
        }