Ejemplo n.º 1
0
        private void CreateApphostShim(string commandName, FilePath entryPoint)
        {
            string appHostSourcePath;

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension + ".exe");
            }
            else
            {
                appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension);
            }

            var appHostDestinationFilePath = GetShimPath(commandName).Value;
            var appBinaryFilePath          = PathUtility.GetRelativePath(appHostDestinationFilePath, entryPoint.Value);

            EmbedAppNameInHost.EmbedAndReturnModifiedAppHostPath(
                appHostSourceFilePath: appHostSourcePath,
                appHostDestinationFilePath: appHostDestinationFilePath,
                appBinaryFilePath: appBinaryFilePath);
        }
Ejemplo n.º 2
0
        public void CreateApphostShellShim(FilePath entryPoint, FilePath shimPath)
        {
            string appHostSourcePath;

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension + ".exe");
            }
            else
            {
                appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension);
            }

            var appHostDestinationFilePath = shimPath.Value;
            var appBinaryFilePath          = PathUtility.GetRelativePath(appHostDestinationFilePath, entryPoint.Value);

            EmbedAppNameInHost.EmbedAndReturnModifiedAppHostPath(
                appHostSourceFilePath: appHostSourcePath,
                appHostDestinationFilePath: appHostDestinationFilePath,
                appBinaryFilePath: appBinaryFilePath);

            _filePermissionSetter.SetUserExecutionPermission(appHostDestinationFilePath);
        }