Пример #1
0
        /// <summary>
        /// Creates the store to provide to clients as a service.
        /// </summary>
        /// <exception cref="IOException">A cache directory could not be created or the underlying filesystem can not store file-changed times accurate to the second.</exception>
        /// <exception cref="UnauthorizedAccessException">Creating a cache directory is not permitted.</exception>
        private static MarshalByRefObject CreateStore()
        {
            var identity = WindowsIdentity.GetCurrent();

            Debug.Assert(identity != null);

            var paths  = ImplementationStores.GetDirectories(serviceMode: true);
            var stores = paths.Select(path => new SecureStore(path, identity)).Cast <IImplementationStore>();

            return(new CompositeImplementationStore(stores));
        }
Пример #2
0
    private static string?GuessAppExePath(Feed feed, EntryPoint?entryPoint)
    {
        if (string.IsNullOrEmpty(entryPoint?.BinaryName))
        {
            return(null);
        }

        string?referenceDigest =
            feed.Implementations
            .OrderByDescending(x => x.Version)
            .FirstOrDefault(x => x.Architecture.RunsOn(Architecture.CurrentSystem))
            ?.ManifestDigest.Best;

        if (referenceDigest == null)
        {
            return(null);
        }

        return(Path.Combine(ImplementationStores.GetDirectories().Last(), referenceDigest, entryPoint.BinaryName + ".exe"));
    }