### In Files

- rumix/application.rb

### Parent

Object

### Methods

- new
- run
- run

### Files

- wxruby2.lib

### Class Index

Quicksearch

- Wx
- Wx::AcceleratorTable
- Wx::Animation
- Wx::App
- Wx::ArtProvider
- Wx::AuiNotebook
- Wx::Bitmap
- Wx::BusyCursor
- Wx::CheckListBox
- Wx::Choice
- Wx::ClientDC
- Wx::Clipboard
- Wx::Colour
- Wx::ComboBox
- Wx::CommandEvent
- Wx::ControlWithItems
- Wx::DC
- Wx::Event
- Wx::EvtHandler
- Wx::Font
- Wx::Grid
- Wx::HelpController
- Wx::HelpControllerHelpProvider
- Wx::HelpProvider
- Wx::HtmlHelpController
- Wx::HtmlWindow
- Wx::Icon
- Wx::IconBundle
- Wx::Image
- Wx::ImageList
- Wx::KeywordConstructor
- Wx::KeywordConstructor::ClassMethods
- Wx::ListBox
- Wx::ListCtrl
- Wx::Locale
- Wx::MediaCtrl
- Wx::Menu
- Wx::MenuItem
- Wx::Notebook
- Wx::Object
- Wx::PaintDC
- Wx::Point
- Wx::PreviewFrame
- Wx::Rect
- Wx::RichTextCtrl
- Wx::SimpleHelpProvider
- Wx::Size
- Wx::Sizer
- Wx::Sound
- Wx::StandardPaths
- Wx::TextCtrl
- Wx::TextUrlEvent
- Wx::Timer
- Wx::ToolBar
- Wx::ToolBarTool
- Wx::TreeCtrl
- Wx::Window
- Wx::XmlResource
- Rumix
- Rumix::Application
- Rumix::Config
- Rumix::Registry
- Rumix::Widget
- Rumix::Widget::CheckOptionPanel
- Rumix::Widget::OptionItem
- Rumix::Widget::OptionPanel
- Rumix::Widget::RadioOptionPanel
- Rumix::Widget::TitleText
- ROpt
- ROpt::ArgumentParser
- ROpt::ParseResult
- Uconv
- Uconv::Error
- Enumerable
- File
- Ini
- Kernel
- Module
- Object
- Pathname
- WxConstructor
- WxRubyStyleAccessors

No matching classes.

# Rumix::Application

### Constants

TargetPath
  (Not documented)

### Public Class Methods

new() click to toggle source

(Not documented)

    # File rumix/application.rb, line 22
                    def initialize
                            @maked_path_list = []
                    end

run(config, log_io = $stderr, &block) click to toggle source

(Not documented)

    # File rumix/application.rb, line 16
                    def self.run(config, log_io = $stderr, &block)
                            self.new.run(config, log_io, &block)
                    end

### Public Instance Methods

run(config, log_io = $stderr, &block) click to toggle source

(Not documented)

    # File rumix/application.rb, line 26
                    def run(config, log_io = $stderr, &block)
                            log_io.puts("---------------\nRumix Installer\n---------------\ndest : \#{config.dest_dir}\next : \#{config.ext_dest_dir}\n")
                            @maked_path_list.clear

                            # インストール先ディレクトリを作成
                            mkpath(config, log_io, config.dest_dir)

                            # レジストリに情報を書き込む
                            reg = Rumix::Registry.load
                            reg.install_path = config.dest_dir.gsub('/', '\\')
                            reg.store or raise 'failure to store registry'

                            # アンインストーラのインストール
                            block.call(:on_uninstaller_install_start) if block
                            install_from_zip(config, log_io, 'uninstaller.zip', config.dest_dir, &block)
                            block.call(:on_uninstaller_install_complete) if block

                            # rubyのインストール
                            block.call(:on_ruby_install_start) if block
                            if config.ruby_type then
                                    install_from_zip(config, log_io, config.ruby_src_zip_name, File.join(config.dest_dir, 'ruby'), &block)
                            end
                            block.call(:on_ruby_install_complete) if block

                            # 外部ライブラリのインストール
                            block.call(:on_ext_install_start) if block
                            if config.ext_dest_dir then
                                    install_from_zip(config, log_io, 'ext.zip', config.ext_dest_dir, &block)
                            end
                            block.call(:on_ext_install_complete) if block

                            # リファレンスのインストール
                            block.call(:on_man_install_start) if block
                            case config.man_type
                            when :new_chm
                                    case config.ruby_type
                                    when Config::RUBY_191
                                            install_from_zip(config, log_io, 'rubyman-newchm-191.zip', config.dest_dir, &block)
                                    when Config::RUBY_18
                                            install_from_zip(config, log_io, 'rubyman-newchm-18.zip', config.dest_dir, &block)
                                    end
                            when :chm
                                    install_from_zip(config, log_io, 'rubyman-chm.zip', config.dest_dir, &block)
                            when :html
                                    install_from_zip(config, log_io, 'rubyman-html.zip', File.join(config.dest_dir, 'rubymanjp'), &block)
                            end
                            block.call(:on_man_install_complete) if block

                            # シェルのインストール
                            block.call(:on_shell_install_start) if block
                            case config.shell_type
                            when :nyacus
                                    install_from_zip(config, log_io, 'nyacus.zip', config.dest_dir, &block)
                                    unless File.exist?(File.join(config.dest_dir, '_nya')) then
                                            install_from_zip(config, log_io, '_nya.zip', config.dest_dir, &block)
                                    end
                            when :nyados
                                    install_from_zip(config, log_io, 'nyados.zip', config.dest_dir, &block)
                                    unless File.exist?(File.join(config.dest_dir, '_nya')) then
                                            install_from_zip(config, log_io, '_nya.zip', config.dest_dir, &block)
                                    end
                            end
                            block.call(:on_shell_install_complete) if block

                            # 関連ツールのインストール
                            if config.installing_tool_ids.include?(:rubygems) then
                                    block.call(:on_tool_install_start, [:rubygems]) if block
                                    install_tool(config, log_io, 'rubygems', 'setup.rb')
                                    block.call(:on_tool_install_complete, [:rubygems]) if block
                            end

                            if config.installing_tool_ids.include?(:rake) then
                                    block.call(:on_tool_install_start, [:rake]) if block
                                    install_tool(config, log_io, 'rake', 'install.rb')

                                    # rake.bat を作成（なぜか rake のインストーラは作成をやってくれない）
                                    cmd_dest = File.join(config.dest_dir, 'ruby/bin/rake.bat')
                                    original_cmd = File.join(config.dest_dir, 'ruby/bin/rake.rb')

                                    open(cmd_dest, 'w'){|f|
                                            f.puts("@ECHO OFF\nIF NOT \"%~f0\" == \"~f0\" GOTO :WinNT\n@\"ruby.exe\" \"\#{original_cmd}\" %1 %2 %3 %4 %5 %6 %7 %8 %9\nGOTO :EOF\n:WinNT\n@\"ruby.exe\" \"%~dpn0.rb\" %*\n")
                                            log_io.puts "#{cmd_dest} maked."
                                    }

                                    block.call(:on_tool_install_complete, [:rake]) if block
                            end

                            if config.installing_tool_ids.include?(:exerb) then
                                    block.call(:on_tool_install_start, [:exerb]) if block
                                    install_tool(config, log_io, 'exerb', 'setup.rb')
                                    block.call(:on_tool_install_complete, [:exerb]) if block
                            end

                            # 環境変数PATHの追加
                            if config.add_path_env? then
                                    block.call(:on_path_env_add_start) if block
                                    shell = WIN32OLE.new('Wscript.Shell')
                                    ruby_bin_dir = File.join(config.dest_dir, 'ruby/bin')

                                    paths = shell.Environment.item('PATH').split(';')
                                    unless paths.include?(ruby_bin_dir) then
                                            paths << ruby_bin_dir.gsub('/', '\\')
                                            new_path = paths.join(';')
                                            log_io.puts "old PATH = #{shell.Environment.item('PATH')}"
                                            log_io.puts "new PATH = #{new_path}"
                                            if config.real_operating? then
                                                    shell.Environment.setproperty('item', 'PATH', new_path)
                                            end
                                    end
                                    block.call(:on_path_env_add_complete) if block
                            end

                            # スタートメニューにRumix追加
                            if config.add_start_menu? then
                                    block.call(:on_start_menu_add_start) if block
                                    dir_path = Rumix.start_menu_dir_path
                                    #cd(config, log_io, dir_path) do
                                    #   Dir.glob('**/*.lnk') do |path|
                                    #           remove_file(config, log_io, path)
                                    #   end
                                    #end
                                    mkpath(config, log_io, dir_path)

                                    create_shortcut(config, log_io, shell, dir_path, 'ruby/irb - Interactive Ruby Console', 'ruby/bin/irb.bat')
                                    case config.shell_type
                                    when :nyacus
                                            create_shortcut(config, log_io, shell, dir_path, 'NYACUS（コマンドラインシェル）', 'NYACUS.exe')
                                    when :nyados
                                            create_shortcut(config, log_io, shell, dir_path, 'NYADOS（コマンドラインシェル）', 'NYADOS.exe', 'IconLocation' => File.join(config.dest_dir, 'greencat.ico'))
                                    end

                                    case config.man_type
                                    when :new_chm
                                            create_shortcut(config, log_io, shell, dir_path, 'Rubyリファレンスマニュアル', 'ruby-refm.chm')
                                    when :chm
                                            create_shortcut(config, log_io, shell, dir_path, 'Rubyリファレンスマニュアル', 'rubymanjp.chm')
                                    when :html
                                            create_shortcut(config, log_io, shell, dir_path, 'Rubyリファレンスマニュアル', 'rubymanjp/index.html')
                                    end

                                    create_shortcut(config, log_io, shell, dir_path, 'Rumixのアンインストール', 'rumix_uninstall.exe')

                                    block.call(:on_start_menu_add_complete) if block
                            end

                            block.call(:on_complete) if block
                    end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.