Class: Releasy::Builders::WindowsWrapped

Inherits:
WindowsBuilder show all
Includes:
Mixins::HasGemspecs, Mixins::Utilities
Defined in:
lib/releasy/builders/windows_wrapped.rb

Overview

Wraps up an application for Windows when not on Windows, based on a RubyInstaller distribution and installing Windows binary gems.

The resulting package will be much larger than a Windows package created on Windows, since it will include the whole Ruby distribution, not just files that are needed.

Limitations:

* Does not DLLs loaded from the system, which will have to be included manually if any are required by the application and no universally available in Windows installations.
* Unless a gem is in pure Ruby or available as a pre-compiled binary gem, it won't work!

Examples:

Releasy::Project.new do
  name "My App"
  add_build :windows_wrapped do
    wrapper "ruby-1.9.3-p0-i386-mingw32.7z" # Required
    exclude_encoding                        # Optional
    exclude_tcl_tk                          # Optional
    add_package :zip                        # Optional
  end
end

Constant Summary

TYPE =
:windows_wrapped
DEFAULT_FOLDER_SUFFIX =
"WIN32"
TCL_TK_FILES =

Files that are required for Tcl/Tk, but which are unlikely to be used in many applications.

%w[bin/tcl*-ri.dll bin/tk*-ri.dll
lib/tcltk
lib/ruby/tk*.rb
lib/ruby/1.*/tk* lib/ruby/1.*/tcl*
lib/ruby/1.*/i386-mingw32/tk* lib/ruby/1.*/i386-mingw32/tcl*
REQUIRED_ENCODING_FILES =

Encoding files that are required, even if we don't need most of them if we select to Mixins::CanExcludeEncoding#exclude_encoding.

%w[encdb.so iso_8859_1.so utf_16le.so trans/single_byte.so trans/transdb.so trans/utf_16_32.so]
VALID_RUBY_DIST =
/ruby-1\.[89]\.\d-p\d+-i386-mingw32.7z/

Constants inherited from WindowsBuilder

Releasy::Builders::WindowsBuilder::EXECUTABLE_TYPES

Constants included from Mixins::Log

Mixins::Log::DEFAULT_LOG_LEVEL, Mixins::Log::LOG_LEVELS

Instance Attribute Summary (collapse)

Attributes included from Mixins::HasGemspecs

#gemspecs

Attributes inherited from WindowsBuilder

#executable_type, #icon

Attributes inherited from Builder

#project, #suffix

Instance Method Summary (collapse)

Methods inherited from WindowsBuilder

#effective_executable_type

Methods included from Mixins::CanExcludeEncoding

#exclude_encoding

Methods inherited from Builder

#initialize, #type

Methods included from Mixins::Log

log_level, log_level=

Methods included from Mixins::HasPackagers

#add_package

Constructor Details

This class inherits a constructor from Releasy::Builders::Builder

Instance Attribute Details

- (String) wrapper



48
49
50
# File 'lib/releasy/builders/windows_wrapped.rb', line 48

def wrapper
  @wrapper
end

Instance Method Details

- (Project) exclude_tcl_tk

Remove TCL/TK from package, which can save a significant amount of space if the application does not require them. This is over 6MB uncompressed, which is a saving of 1.6MB when compressed with 7z format (LZMA).



53
# File 'lib/releasy/builders/windows_wrapped.rb', line 53

def exclude_tcl_tk; @exclude_tcl_tk = true; self; end

- (Boolean) valid_for_platform?



55
# File 'lib/releasy/builders/windows_wrapped.rb', line 55

def valid_for_platform?; not Releasy.win_platform?; end