示例#1
0
        // TODO

        public virtual void SetPaths(IAbsoluteDirectoryPath appPath        = null, IAbsoluteDirectoryPath dataPath = null,
                                     IAbsoluteDirectoryPath localDataPath  = null, IAbsoluteDirectoryPath tempPath = null,
                                     IAbsoluteDirectoryPath configPath     = null, IAbsoluteDirectoryPath toolPath = null,
                                     IAbsoluteDirectoryPath sharedDataPath = null)
        {
            //if (PathsSet) throw new Exception("Paths are already set!");
            if (PathsSet)
            {
                this.Logger().Debug("Paths were already set!");
            }

            EntryLocation = CommonBase.AssemblyLoader.GetEntryLocation();
            EntryPath     = CommonBase.AssemblyLoader.GetEntryPath();
            ProcessExtensions.DefaultWorkingDirectory = EntryPath;
            AppPath             = appPath ?? GetAppPath();
            DataPath            = dataPath ?? GetDataPath();
            NotePath            = DataPath.GetChildDirectoryWithName("Notes");
            LocalDataRootPath   = GetLocalDataRootPath();
            LocalDataPath       = localDataPath ?? GetLocalDataPath();
            LocalDataSharedPath = sharedDataPath ?? GetLocalDataSharedPath();
            SharedDllPath       = GetLocalSharedDllPath();
            LogPath             = LocalDataPath.GetChildDirectoryWithName("Logs");
            TempPath            = tempPath ??
                                  Path.Combine(Path.GetTempPath(), Common.AppCommon.ApplicationName)
                                  .ToAbsoluteDirectoryPath();
            ToolPath          = toolPath ?? LocalDataSharedPath.GetChildDirectoryWithName("Tools");
            ToolMinGwBinPath  = ToolPath.GetChildDirectoryWithName("mingw").GetChildDirectoryWithName("bin");
            ToolCygwinBinPath = ToolPath.GetChildDirectoryWithName("cygwin").GetChildDirectoryWithName("bin");
            ConfigPath        = configPath ?? ToolPath.GetChildDirectoryWithName("Config");
            StartPath         = Directory.GetCurrentDirectory().ToAbsoluteDirectoryPath();

            AwesomiumPath = LocalDataSharedPath.GetChildDirectoryWithName("CEF");

            MyDocumentsPath = GetMyDocumentsPath();
            ProgramDataPath = GetProgramDataPath();
            SharedFilesPath = AppPath;

            ServiceExePath     = Common.IsMini ? EntryLocation : SharedFilesPath.GetChildFileWithName(ServiceExe);
            SelfUpdaterExePath = SharedFilesPath.GetChildFileWithName(SelfUpdaterExe);

            SynqRootPath = ProgramDataPath.GetChildDirectoryWithName("Synq");

            PathsSet = true;
        }
示例#2
0
 IAbsoluteDirectoryPath GetSystemSharedPath()
 => ProgramDataPath.GetChildDirectoryWithName(CompanyPath).GetChildDirectoryWithName("Shared");