Skip to content

Commit 176baf6

Browse files
committed
Add package release version in addition to the Ruby version.
1 parent c061bd0 commit 176baf6

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The DLL search paths of Ruby processes are extended as soon as rubygems is used,
6666
- Then compile and package ruby:
6767
rake ruby-2.4.0:installer
6868

69-
- If everything works well, you will find: `installer/rubyinstaller-2.4.0-x64.exe`
69+
- If everything works well, you will find: `installer/rubyinstaller-2.4.0-1-x64.exe`
7070

7171
##Known Issues
7272

Rakefile

+8-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ rubies.each do |rubyver|
3030
desc "Build pacman package for ruby-#{rubyver}"
3131
task "compile" => [:devkit, packagefile]
3232

33-
file packagefile => [File.join(packdir, "PKGBUILD")] do
33+
pkgbuild = File.join(packdir, "PKGBUILD")
34+
file packagefile => [pkgbuild] do
3435
chdir(packdir) do
3536
rm_rf(["pkg", "src"])
3637
sh "sh", "makepkg-mingw", "-sf"
@@ -63,8 +64,11 @@ rubies.each do |rubyver|
6364
touch ruby_exe
6465
end
6566

66-
installer_exe = "installer/rubyinstaller-#{rubyver}-x64.exe"
67-
installerfile_listfile = "installer/#{File.basename(installer_exe, ".exe")}.files"
67+
File.read(pkgbuild) =~ /^pkgrel=(\d+)$/
68+
pkgrel = $1 or raise("'pkgrel' not defined in #{pkgbuild}")
69+
70+
installer_exe = "installer/rubyinstaller-#{rubyver}-#{pkgrel}-x64.exe"
71+
installerfile_listfile = "installer/rubyinstaller-#{rubyver}-x64.files"
6872
installerfile_list = File.readlines(installerfile_listfile)
6973
installerfile_list = installerfile_list.map{|path| File.join(sandboxdirmgw, path.chomp)}
7074
installerfiles = installerfile_list.map do |path|
@@ -119,7 +123,7 @@ rubies.each do |rubyver|
119123
default_inst_dir = "C:\\Ruby#{rubyver2.gsub(".","")}-x64"
120124
iss_files = Dir["installer/*.iss"]
121125
file installer_exe => (installerfiles + iss_files + [filelist_iss]) do
122-
sh "cmd", "/c", "iscc", "installer/rubyinstaller.iss", "/Q", "/dRubyVersion=#{rubyver}", "/dRubyPatch=0", "/dRubyBuildPlatform=x64-mingw32", "/dRubyShortPlatform=-x64", "/dDefaultDirName=#{default_inst_dir}", "/O#{File.dirname(installer_exe)}", "/F#{File.basename(installer_exe, ".exe")}"
126+
sh "cmd", "/c", "iscc", "installer/rubyinstaller.iss", "/Q", "/dRubyVersion=#{rubyver}", "/dRubyPatch=0", "/dRubyBuildPlatform=x64-mingw32", "/dRubyShortPlatform=-x64", "/dDefaultDirName=#{default_inst_dir}", "/dPackageRelease=#{pkgrel}", "/O#{File.dirname(installer_exe)}", "/F#{File.basename(installer_exe, ".exe")}"
123127
end
124128
end
125129
end

installer/rubyinstaller.iss

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;
1414
; Usage:
1515
; iscc rubyinstaller.iss /dRubyVersion=X.Y.Z \
16-
; /dRubyPatch=123; \
16+
; /dPackageRelease=3 \
1717
; /dRubyBuildPlatform=x64-mingw32 \
1818
; /dRubyShortPlatform=-x64 \
1919
; [/dInstVersion=26-OCT-2009] \
@@ -23,8 +23,8 @@
2323
#error Please provide a RubyVersion definition using a /d parameter.
2424
#endif
2525

26-
#if Defined(RubyPatch) == 0
27-
#error Please provide a RubyPatch level definition using a /d parameter.
26+
#if Defined(PackageRelease) == 0
27+
#error Please provide a PackageRelease level definition using a /d parameter.
2828
#endif
2929

3030
#if Defined(RubyBuildPlatform) == 0
@@ -41,7 +41,7 @@
4141

4242
; Grab MAJOR.MINOR info from RubyVersion (1.8)
4343
#define RubyMajorMinor Copy(RubyVersion, 1, 3)
44-
#define RubyFullVersion RubyVersion + '-p' + RubyPatch
44+
#define RubyFullVersion RubyVersion + '-' + PackageRelease
4545

4646
; Build Installer details using above values
4747
#define InstallerName "Ruby " + RubyFullVersion + RubyShortPlatform
@@ -81,7 +81,7 @@ VersionInfoCompany={#InstallerPublisher}
8181
VersionInfoCopyright=(c) {#CurrentYear} {#InstallerPublisher}
8282
VersionInfoDescription=Ruby Programming Language for Windows
8383
VersionInfoTextVersion={#RubyFullVersion}
84-
VersionInfoVersion={#RubyVersion}.{#RubyPatch}
84+
VersionInfoVersion={#RubyVersion}.{#PackageRelease}
8585
UninstallDisplayIcon={app}\bin\ruby.exe
8686
WizardImageFile={#SourcePath}\images\wizard-large.bmp
8787
WizardSmallImageFile={#SourcePath}\images\wizard-logo.bmp
@@ -163,7 +163,7 @@ Root: HKLM; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}; ValueType: st
163163
Root: HKLM; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: ; ValueData: ; Flags: uninsdeletekey; Check: IsAdmin
164164
Root: HKLM; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: InstallLocation ; ValueData: {app}; Check: IsAdmin
165165
Root: HKLM; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: InstallDate ; ValueData: {code:GetInstallDate}; Check: IsAdmin
166-
Root: HKLM; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: PatchLevel ; ValueData: {#RubyPatch}; Check: IsAdmin
166+
Root: HKLM; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: PackageRelease ; ValueData: {#PackageRelease}; Check: IsAdmin
167167
Root: HKLM; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: BuildPlatform ; ValueData: {#RubyBuildPlatform}; Check: IsAdmin
168168

169169
; RubyInstaller identification for non-admin
@@ -172,7 +172,7 @@ Root: HKCU; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}; ValueType: st
172172
Root: HKCU; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: ; ValueData: ; Flags: uninsdeletekey; Check: IsNotAdmin
173173
Root: HKCU; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: InstallLocation ; ValueData: {app}; Check: IsNotAdmin
174174
Root: HKCU; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: InstallDate ; ValueData: {code:GetInstallDate}; Check: IsNotAdmin
175-
Root: HKCU; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: PatchLevel ; ValueData: {#RubyPatch}; Check: IsNotAdmin
175+
Root: HKCU; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: PackageRelease ; ValueData: {#PackageRelease}; Check: IsNotAdmin
176176
Root: HKCU; Subkey: Software\RubyInstaller\{#RubyInstallerBaseId}\{#RubyVersion}; ValueType: string; ValueName: BuildPlatform ; ValueData: {#RubyBuildPlatform}; Check: IsNotAdmin
177177

178178
[Icons]

0 commit comments

Comments
 (0)