Пример #1
0
        /// <summary>
        ///     Installs the OpenSauce libraries to the given HCE directory path.
        /// </summary>
        /// <exception cref="OpenSauceException">
        ///     Invalid HCE directory path.
        ///     - or -
        ///     Target directory does not exist.
        ///     - or -
        ///     Package does not exist.
        /// </exception>
        public void Install()
        {
            /// 1. EXTRACT packages from the entry assembly (usually a SFX AmaiSosu.GUI)
            /// 2. VERIFY the packages were extracted properly.
            /// 3. INSTALL packages.
            /// 4. INSTALL Direct3D9 Extensions

            /**
             * 1. Extraction
             */
            WriteInfo("Extracting packages...");

            SFX.Extract(new SFX.Configuration
            {
                Target = new DirectoryInfo(
                    Paths.Temp)
            });

            /**
             * 2. Verification
             */
            WriteInfo("Verifying the OpenSauce installer.");
            var state = Verify();

            if (!state.IsValid)
            {
                WriteAndThrow(new OpenSauceException(state.Reason));
            }

            WriteSuccess("OpenSauce installer has been successfully verified.");

            /**
             * 4. Installation - packages
             */
            WriteInfo("Attempting to install OpenSauce to the filesystem.");

            foreach (var package in _packages)
            {
                package.Install();
            }

            WriteSuccess("OpenSauce has been successfully installed to the filesystem.");
        }
Пример #2
0
        /// <summary>
        ///     Compiles the OpenSauce libraries to packages.
        /// </summary>
        /// <exception cref="OpenSauceException">
        ///     Invalid OpenSauce binaries directory path.
        ///     - or -
        ///     Important OpenSauce binaries don't exist.
        ///     - or -
        ///     Kornner Studios or its contents do not exist.
        ///     - or -
        ///     Direct3D9 Extensions DXSetup is not present.
        /// </exception>
        public void Compile()
        {
            /// Summary
            /// 1. VERIFY expected files/directories are present.
            /// 2. COMPILE packages from selected directories
            /// 3. COMPILE packages to SFX assembly.

            /**
             * 1. Verification
             */
            WriteInfo("Verifying expected files.");
            var state = Verify();

            if (!state.IsValid)
            {
                WriteAndThrow(new OpenSauceException(state.Reason));
            }

            /**
             * 2. Compilation - packages
             */
            WriteInfo("Attempting to copy files to package folder.");

            foreach (var package in _packages)
            {
                package.Compile();
            }

            WriteSuccess("OpenSauce has been successfully compiled to the package workspace.");

            /**
             * 3. Compilation - SFX
             */
            WriteInfo("Compiling packages to fancy, self-extracting application.");

            SFX.Compile(new SFX.Configuration
            {
                Source = Paths.TempDI,
                Target = new DirectoryInfo(CurrentDirectory)
            });
        }