<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>resources/installer/LICENSE.txt</filename>
    </added>
    <added>
      <filename>resources/installer/ri_gui.iss</filename>
    </added>
    <added>
      <filename>resources/installer/util.iss</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,6 +3,9 @@
 * Enhancements:
   * Upgraded pure-ruby Readline to 0.2.0
   * Bundle OpenSSL 0.9.8k in cooperative mode (MSVCRT build) [snaury]
+  * Installers now offer option to modify PATH [jonforums]
+  * Installers now register file association [jonforums]
+  * Installers that you can trust: shipping now signed
 
 === preview2 / 2009-08-16
 </diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -33,12 +33,13 @@ module InnoSetup
     cmd &lt;&lt; &quot;/dRubyPath=#{options[:ruby_path]}&quot;
     cmd &lt;&lt; &quot;/o#{options[:output]}&quot; if options[:output]
     cmd &lt;&lt; &quot;/f#{options[:filename]}&quot; if options[:filename]
+    cmd &lt;&lt; '/s&quot;risigntool=signtool.exe $p&quot;' if options[:sign]
 
     sh cmd.join(' ')
   end
 end
 
-# A fake task for now that ensures innosetup is no the PATH,
+# A fake task for now that ensures innosetup is on the PATH,
 # and if not, add %ProgramFiles%\Inno Setup 5
 task :innosetup do
   unless InnoSetup.present?
@@ -51,6 +52,31 @@ task :innosetup do
   fail &quot;You need InnoSetup installed&quot; unless InnoSetup.present?
 end
 
+# Certificate signing tool (signtool.exe) check
+# TODO: move this out
+
+module SignTool
+  EXECUTABLE = &quot;signtool.exe&quot;
+
+  def self.present?
+    ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
+      return true if File.exist?(File.join(path, EXECUTABLE)) &amp;&amp; File.executable?(File.join(path, EXECUTABLE))
+    end
+    false
+  end
+end
+
+task :signtool do
+  unless SignTool.present?
+    fail &quot;You need #{SignTool::EXECUTABLE} present to sign your installer&quot;
+  end
+end
+
+# if SIGNED was specified, chain signtool verification to innosetup check
+if ENV['SIGNED'] then
+  task :innosetup, :needs =&gt; [:signtool]
+end
+
 directory 'pkg'
 
 [RubyInstaller::Ruby18, RubyInstaller::Ruby19].each do |pkg|
@@ -86,7 +112,8 @@ directory 'pkg'
         :ruby_patch   =&gt; info[:patchlevel],
         :ruby_path    =&gt; pkg.install_target,
         :output       =&gt; 'pkg',
-        :filename     =&gt; installer_pkg
+        :filename     =&gt; installer_pkg,
+        :sign         =&gt; ENV['SIGNED']
       )
     end
 </diff>
      <filename>recipes/packager/inno.rake</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,46 @@
-; Ruby Installer - InnoSetup Script (base)
+; RubyInstaller - InnoSetup Script (base)
 ; This script is used to build Ruby Installers for Windows
 
 ; PRE-CHECK
-; Verify if both RubyPath and RubyVersion are defined
-; by ISCC using /d parameter:
-;  iscc rubyinstaller.iss /dRubyVersion=X.Y.Z /dRubyPatch=123 /dRubyPath=sandbox/ruby18_mingw
+; Verify that RubyPath, RubyVersion, and RubyPath are defined by ISCC using
+; /d command line arguments.
+;
+; Usage:
+;  iscc rubyinstaller.iss /dRubyVersion=X.Y.Z /dRubyPatch=123; \
+;                         /dRubyPath=sandbox/ruby
+;                         [/dInstVersion=26-OCT-2009]
 
 #if Defined(RubyVersion) == 0
-  #error Please provide a RubyVersion definition using /d parameter.
+  #error Please provide a RubyVersion definition using a /d parameter.
 #endif
 
 #if Defined(RubyPatch) == 0
-  #error Please provide a RubyPatch levle definition using /d parameter.
+  #error Please provide a RubyPatch level definition using a /d parameter.
 #endif
 
 #if Defined(RubyPath) == 0
-  #error Please provide the location of the Ruby to be used with RubyPath variable.
+  #error Please provide a RubyPath value to the Ruby files using a /d parameter.
 #else
   #if FileExists(RubyPath + '\bin\ruby.exe') == 0
     #error No Ruby installation (bin\ruby.exe) found inside defined RubyPath. Please verify.
   #endif
 #endif
 
+#if Defined(InstVersion) == 0
+  #define InstVersion GetDateTimeString('dd-mmm-yy&quot;T&quot;hhnn', '', '')
+#endif
+
 ; Grab MAJOR.MINOR info from RubyVersion (1.8)
 #define RubyMajorMinor Copy(RubyVersion, 1, 3)
 #define RubyFullVersion RubyVersion + '-p' + RubyPatch
 
 ; Build Installer details using above values
 #define InstallerName &quot;Ruby &quot; + RubyFullVersion
-#define InstallerPublisher &quot;RubyInstaller Project&quot;
+#define InstallerPublisher &quot;RubyInstaller Team&quot;
 #define InstallerHomepage &quot;http://rubyinstaller.org&quot;
 
+#define CurrentYear GetDateTimeString('yyyy', '', '')
+
 ; INCLUDE
 ; Include version specific definitions
 #define InstallerSpecificFile &quot;config-&quot; + RubyMajorMinor + &quot;.iss&quot;
@@ -46,15 +56,14 @@ AppPublisherURL={#InstallerHomepage}
 AppVersion={#RubyFullVersion}
 DefaultGroupName={#InstallerName}
 DisableProgramGroupPage=true
-LicenseFile=LICENSE.rtf
-InfoAfterFile=changes.txt
+LicenseFile=LICENSE.txt
 Compression=lzma/ultra64
 SolidCompression=true
 AlwaysShowComponentsList=false
 DisableReadyPage=true
 InternalCompressLevel=ultra64
 VersionInfoCompany={#InstallerPublisher}
-VersionInfoCopyright=(c) 2009 {#InstallerPublisher}
+VersionInfoCopyright=(c) {#CurrentYear} {#InstallerPublisher}
 VersionInfoDescription=Ruby Programming Language for Windows
 VersionInfoTextVersion={#RubyFullVersion}
 VersionInfoVersion={#RubyVersion}.{#RubyPatch}
@@ -62,9 +71,25 @@ UninstallDisplayIcon={app}\bin\ruby.exe
 WizardImageFile=compiler:wizmodernimage-is.bmp
 WizardSmallImageFile={#SourcePath}\wizard-logo.bmp
 PrivilegesRequired=none
+ChangesAssociations=yes
+ChangesEnvironment=yes
+SignTool=risigntool sign /a /d $q{#InstallerName}$q /du $q{#InstallerHomepage}$q /t $qhttp://timestamp.comodoca.com/authenticode$q $f
 
 [Languages]
-Name: english; MessagesFile: compiler:Default.isl
+Name: en; MessagesFile: compiler:Default.isl
+
+[Messages]
+en.WelcomeLabel1=Welcome to the [name] Installer
+en.WelcomeLabel2=This will install [name/ver] on your computer. Please close all other applications before continuing.
+en.WizardLicense={#InstallerName} License Agreement
+en.LicenseLabel=
+en.LicenseLabel3=Please read the following License Agreement and accept the terms before continuing the installation.
+en.LicenseAccepted=I &amp;accept the License
+en.LicenseNotAccepted=I &amp;decline the License
+en.WizardSelectDir=Installation Destination and Optional Tasks
+en.SelectDirDesc=
+en.SelectDirBrowseLabel=To continue, click Next, or to select a different folder, click Browse.
+en.DiskSpaceMBLabel=Required free disk space: ~[mb] MB
 
 [Files]
 ; NOTE: Don't use &quot;Flags: ignoreversion&quot; on any shared system files
@@ -72,9 +97,82 @@ Source: ..\..\{#RubyPath}\*; DestDir: {app}; Flags: recursesubdirs createallsubd
 Source: ..\..\sandbox\book\bookofruby.pdf; DestDir: {app}\doc
 Source: setrbvars.bat; DestDir: {app}\bin
 
+[Registry]
+; .rb file for admin
+Root: HKLM; Subkey: Software\Classes\.rb; ValueType: string; ValueName: ; ValueData: RubyFile; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsAdmin and IsAssociated
+Root: HKLM; Subkey: Software\Classes\RubyFile; ValueType: string; ValueName: ; ValueData: Ruby File; Flags: uninsdeletekey; Check: IsAdmin and IsAssociated
+Root: HKLM; Subkey: Software\Classes\RubyFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\bin\ruby.exe,0; Check: IsAdmin and IsAssociated
+Root: HKLM; Subkey: Software\Classes\RubyFile\shell\open\command; ValueType: string; ValueData: &quot;&quot;&quot;{app}\bin\ruby.exe&quot;&quot; &quot;&quot;%1&quot;&quot; %*&quot;; Check: IsAdmin and IsAssociated
+
+; .rbw file for admin
+Root: HKLM; Subkey: Software\Classes\.rbw; ValueType: string; ValueName: ; ValueData: RubyWFile; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsAdmin and IsAssociated
+Root: HKLM; Subkey: Software\Classes\RubyWFile; ValueType: string; ValueName: ; ValueData: RubyW File; Flags: uninsdeletekey; Check: IsAdmin and IsAssociated
+Root: HKLM; Subkey: Software\Classes\RubyWFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\bin\rubyw.exe,0; Check: IsAdmin and IsAssociated
+Root: HKLM; Subkey: Software\Classes\RubyWFile\shell\open\command; ValueType: string; ValueName: ; ValueData: &quot;&quot;&quot;{app}\bin\rubyw.exe&quot;&quot; &quot;&quot;%1&quot;&quot; %*&quot;; Check: IsAdmin and IsAssociated
+
+; .rb file for non-admin
+Root: HKCU; Subkey: Software\Classes\.rb; ValueType: string; ValueName: ; ValueData: RubyFile; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsNotAdmin and IsAssociated
+Root: HKCU; Subkey: Software\Classes\RubyFile; ValueType: string; ValueName: ; ValueData: Ruby File; Flags: uninsdeletekey; Check: IsNotAdmin and IsAssociated
+Root: HKCU; Subkey: Software\Classes\RubyFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\bin\ruby.exe,0; Check: IsNotAdmin and IsAssociated
+Root: HKCU; Subkey: Software\Classes\RubyFile\shell\open\command; ValueType: string; ValueName: ; ValueData: &quot;&quot;&quot;{app}\bin\ruby.exe&quot;&quot; &quot;&quot;%1&quot;&quot; %*&quot;; Check: IsNotAdmin and IsAssociated
+
+; .rbw file for non-admin
+Root: HKCU; Subkey: Software\Classes\.rbw; ValueType: string; ValueName: ; ValueData: RubyWFile; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsNotAdmin and IsAssociated
+Root: HKCU; Subkey: Software\Classes\RubyWFile; ValueType: string; ValueName: ; ValueData: RubyW File; Flags: uninsdeletekey; Check: IsNotAdmin and IsAssociated
+Root: HKCU; Subkey: Software\Classes\RubyWFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\bin\rubyw.exe,0; Check: IsNotAdmin and IsAssociated
+Root: HKCU; Subkey: Software\Classes\RubyWFile\shell\open\command; ValueType: string; ValueData: &quot;&quot;&quot;{app}\bin\rubyw.exe&quot;&quot; &quot;&quot;%1&quot;&quot; %*&quot;; Check: IsNotAdmin and IsAssociated
+
 [Icons]
 Name: {group}\Documentation\The Book of Ruby; Filename: {app}\doc\bookofruby.pdf; Flags: createonlyiffileexists
 Name: {group}\Interactive Ruby; Filename: {app}\bin\irb.bat; IconFilename: {app}\bin\ruby.exe; Flags: createonlyiffileexists
 Name: {group}\RubyGems Documentation Server; Filename: {app}\bin\gem.bat; Parameters: server; IconFilename: {app}\bin\ruby.exe; Flags: createonlyiffileexists runminimized
 Name: {group}\Start Command Prompt with Ruby; Filename: {sys}\cmd.exe; Parameters: /E:ON /K {app}\bin\setrbvars.bat; WorkingDir: {%HOMEDRIVE}{%HOMEPATH}; IconFilename: {sys}\cmd.exe; Flags: createonlyiffileexists
 Name: {group}\{cm:UninstallProgram,{#InstallerName}}; Filename: {uninstallexe}
+
+[Code]
+#include &quot;util.iss&quot;
+#include &quot;ri_gui.iss&quot;
+
+procedure CurStepChanged(const CurStep: TSetupStep);
+begin
+  if CurStep = ssInstall then
+  begin
+    if UsingWinNT then
+    begin
+      Log(Format('Selected Tasks - Path: %d, Associate: %d', [PathChkBox.State, PathExtChkBox.State]));
+
+      if IsModifyPath then
+        ModifyPath([ExpandConstant('{app}') + '\bin']);
+
+      if IsAssociated then
+        ModifyFileExts(['.rb', '.rbw']);
+    end else
+      MsgBox('Looks like you''ve got on older, unsupported Windows version.' #13 +
+             'Proceeding with a reduced feature set installation.',
+             mbInformation, MB_OK);
+  end;
+end;
+
+procedure RegisterPreviousData(PreviousDataKey: Integer);
+begin
+  {* store install choices so we can use during uninstall *}
+  if IsModifyPath then
+    SetPreviousData(PreviousDataKey, 'PathModified', 'yes');
+  if IsAssociated then
+    SetPreviousData(PreviousDataKey, 'FilesAssociated', 'yes');
+end;
+
+procedure CurUninstallStepChanged(const CurUninstallStep: TUninstallStep);
+begin
+  if CurUninstallStep = usUninstall then
+  begin
+    if UsingWinNT then
+    begin
+      if GetPreviousData('PathModified', 'no') = 'yes' then
+        ModifyPath([ExpandConstant('{app}') + '\bin']);
+
+      if GetPreviousData('FilesAssociated', 'no') = 'yes' then
+        ModifyFileExts(['.rb', '.rbw']);
+    end;
+  end;
+end;</diff>
      <filename>resources/installer/rubyinstaller.iss</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>resources/installer/LICENSE.rtf</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>04f8ec956e1b60486162cf46580c9b6717aa8ca2</id>
    </parent>
  </parents>
  <author>
    <name>Luis Lavena</name>
    <email>luislavena@gmail.com</email>
  </author>
  <url>http://github.com/oneclick/rubyinstaller/commit/a1b3146a74a25ab73d5cc8f17d2d8442ea08738c</url>
  <id>a1b3146a74a25ab73d5cc8f17d2d8442ea08738c</id>
  <committed-date>2009-11-05T20:56:20-08:00</committed-date>
  <authored-date>2009-11-05T18:52:00-08:00</authored-date>
  <message>Merged 'installers' and 'signtool'

- Replaced RichText Installer license with text-only
- Added utility and new GUI Installer helper scripts
- Imported cleaned up version of Jon's Inno Script
- Properly quote Registry modifications.
- Adjust language definition to the correct naming.
- Integrated Installers signing tool and tasks
- Updated documentation to reflect latest commits</message>
  <tree>8c15cda8f80c7659733e501751328e09ed4a39a1</tree>
  <committer>
    <name>Luis Lavena</name>
    <email>luislavena@gmail.com</email>
  </committer>
</commit>
