RubyPackager 0.1.0.20091021
Sign up to get free protection for your applications and to get access to all the features.
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/AUTHORS +3 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/ChangeLog +17 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/Credits +35 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/LICENSE +31 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/README +18 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/ReleaseInfo +8 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/TODO +11 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Distributors/SourceForge.rb +159 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Installers/Gem.rb +122 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/ReleaseInfo.rb +227 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Releaser.rb +447 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/Tools.rb +72 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/i386-mswin32/Installers/NSIS.rb +60 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/i386-mswin32/PlatformReleaser.rb +173 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/lib/RubyPackager/i386-mswin32/edicon/edicon.exe +0 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/ReleaseInfo.rb +16 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Icon.ico +0 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Installer/Icon.ico +0 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Installer/InstallLicense.txt +31 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Distribution/i386-mswin32/Installer/install.nsi +51 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Applications/Basic/Main.rb +8 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/Common.rb +50 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/i386-mswin32/run.rb +19 -0
- data/F:/RR/Source/rubypackager/svn/rubypackager/Releases/i386-mswin32/0.1.0.20091021/Normal/2009_10_21_19_10_02/Release/test/run.rb +19 -0
- data/test/run.rb +19 -0
- metadata +87 -0
@@ -0,0 +1,60 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
module RubyPackager
|
7
|
+
|
8
|
+
module Installers
|
9
|
+
|
10
|
+
class NSIS
|
11
|
+
|
12
|
+
# Check that we can use this installer
|
13
|
+
#
|
14
|
+
# Return:
|
15
|
+
# * _Boolean_: Can we use this installer ?
|
16
|
+
def checkTools
|
17
|
+
rSuccess = true
|
18
|
+
|
19
|
+
# Check that makensis is present
|
20
|
+
if (!system('makensis /VERSION'))
|
21
|
+
puts "!!! Need to have MakeNSIS installed in the system PATH to create installer."
|
22
|
+
puts "!!! Please download and install MakeNSIS in the PATH from http://nsis.sourceforge.net/Main_Page"
|
23
|
+
rSuccess = false
|
24
|
+
end
|
25
|
+
|
26
|
+
return rSuccess
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create the installer with everything in the release directory.
|
30
|
+
#
|
31
|
+
# Parameters:
|
32
|
+
# * *iRootDir* (_String_): The Root directory
|
33
|
+
# * *iReleaseDir* (_String_): The release directory (all files to put in the installer are there)
|
34
|
+
# * *iInstallerDir* (_String_): The directory where the installer has to be put
|
35
|
+
# * *iVersion* (_String_): Release version
|
36
|
+
# * *iReleaseInfo* (_ReleaseInfo_): Release info
|
37
|
+
# Return:
|
38
|
+
# * _String_: File name to distribute, or nil in case of failure
|
39
|
+
def createInstaller(iRootDir, iReleaseDir, iInstallerDir, iVersion, iReleaseInfo)
|
40
|
+
rFileName = nil
|
41
|
+
|
42
|
+
if (iReleaseInfo.InstallInfo[:NSISFileName] == nil)
|
43
|
+
puts '!!! No NSISFileName specified among the Install description.'
|
44
|
+
else
|
45
|
+
lNSISOK = system("makensis /DVERSION=#{iVersion} \"/DRELEASEDIR=#{iReleaseDir.gsub(/\//,'\\')}\" \"#{iRootDir.gsub(/\//,'\\')}\\#{iReleaseInfo.InstallInfo[:NSISFileName].gsub(/\//,'\\')}\"")
|
46
|
+
if (lNSISOK)
|
47
|
+
lInstallerDir = File.dirname("#{iRootDir}/#{iReleaseInfo.InstallInfo[:NSISFileName]}")
|
48
|
+
rFileName = "#{iReleaseInfo.ExecutableInfo[:ExeName]}_#{iVersion}_setup.exe"
|
49
|
+
FileUtils.mv("#{lInstallerDir}/setup.exe", "#{iInstallerDir}/#{rFileName}")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
return rFileName
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
@@ -0,0 +1,173 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
# This file prepares a win32 distribution
|
7
|
+
|
8
|
+
# Require needed to generate the temporary ruby file that produces the executable
|
9
|
+
require 'tmpdir'
|
10
|
+
|
11
|
+
module RubyPackager
|
12
|
+
|
13
|
+
class PlatformReleaser
|
14
|
+
|
15
|
+
PLATFORM_DIR = File.dirname(__FILE__)
|
16
|
+
|
17
|
+
# Check if the tools we will use to generate an executable are present
|
18
|
+
#
|
19
|
+
# Parameters:
|
20
|
+
# * *iRootDir* (_String_): Root directory
|
21
|
+
# * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
|
22
|
+
# Return:
|
23
|
+
# * _Boolean_: Are tools correctly useable ?
|
24
|
+
def checkExeTools(iRootDir, iIncludeRuby)
|
25
|
+
rSuccess = true
|
26
|
+
|
27
|
+
if (iIncludeRuby)
|
28
|
+
# We need allinoneruby
|
29
|
+
if (Gem.find_files('allinoneruby').empty?)
|
30
|
+
puts "!!! Need to have allinoneruby gem to release including Ruby."
|
31
|
+
puts "!!! Please install allinoneruby gem (gem install allinoneruby)."
|
32
|
+
rSuccess = false
|
33
|
+
end
|
34
|
+
end
|
35
|
+
# Check that edicon is present
|
36
|
+
if (!File.exists?("#{PLATFORM_DIR}/edicon/edicon.exe"))
|
37
|
+
puts "!!! Need to have edicon.exe installed in #{PLATFORM_DIR}/edicon to set a Windows executable's icon."
|
38
|
+
puts "!!! Please install edicon, part of Ocra Gem (gem install ocra), and copy from the Gem directory (ocra-1.1.1/share/ocra/edicon.exe) to #{PLATFORM_DIR}/edicon/edicon.exe."
|
39
|
+
rSuccess = false
|
40
|
+
end
|
41
|
+
# Check that exerb is present
|
42
|
+
if (!system('exerb.bat --version'))
|
43
|
+
puts "!!! Need to have exerb installed in the system PATH to create a Windows executable."
|
44
|
+
puts "!!! Please download and install exerb from http://exerb.sourceforge.jp/index.en.html"
|
45
|
+
rSuccess = false
|
46
|
+
end
|
47
|
+
|
48
|
+
return rSuccess
|
49
|
+
end
|
50
|
+
|
51
|
+
# Create the binary.
|
52
|
+
# This is called when the core library has been copied in the release directory.
|
53
|
+
#
|
54
|
+
# Parameters:
|
55
|
+
# * *iRootDir* (_String_): Root directory
|
56
|
+
# * *iReleaseDir* (_String_): Release directory
|
57
|
+
# * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
|
58
|
+
# * *iReleaseInfo* (_ReleaseInfo_): The release information
|
59
|
+
# Return:
|
60
|
+
# * _Boolean_: Success ?
|
61
|
+
def createBinary(iRootDir, iReleaseDir, iIncludeRuby, iReleaseInfo)
|
62
|
+
rSuccess = true
|
63
|
+
|
64
|
+
lBinSubDir = "Launch/#{RUBY_PLATFORM}/bin"
|
65
|
+
lRubyBaseBinName = nil
|
66
|
+
lRubyLaunchCmd = nil
|
67
|
+
if (iReleaseInfo.ExecutableInfo[:TerminalApplication])
|
68
|
+
lRubyBaseBinName = 'ruby'
|
69
|
+
lRubyLaunchCmd = 'ruby'
|
70
|
+
else
|
71
|
+
lRubyBaseBinName = 'rubyw'
|
72
|
+
lRubyLaunchCmd = 'start rubyw'
|
73
|
+
end
|
74
|
+
lBinName = "#{lRubyBaseBinName}-#{RUBY_VERSION}.exe"
|
75
|
+
if (iIncludeRuby)
|
76
|
+
# First create the binary containing all ruby
|
77
|
+
lBinDir = "#{iReleaseDir}/#{lBinSubDir}"
|
78
|
+
FileUtils::mkdir_p(lBinDir)
|
79
|
+
lOldDir = Dir.getwd
|
80
|
+
Dir.chdir(lBinDir)
|
81
|
+
lCmd = nil
|
82
|
+
if (iReleaseInfo.ExecutableInfo[:TerminalApplication])
|
83
|
+
lCmd = "allinoneruby.bat #{lBinName}"
|
84
|
+
else
|
85
|
+
lCmd = "allinoneruby.bat --rubyw #{lBinName}"
|
86
|
+
end
|
87
|
+
rSuccess = system(lCmd)
|
88
|
+
if (!rSuccess)
|
89
|
+
puts "!!! Error while executing \"#{lCmd}\""
|
90
|
+
end
|
91
|
+
Dir.chdir(lOldDir)
|
92
|
+
end
|
93
|
+
if (rSuccess)
|
94
|
+
# Then create the real executable
|
95
|
+
# Generate the Ruby file that launches everything for Windows
|
96
|
+
lTempFileName = "#{Dir.tmpdir}/EXE_#{RUBY_PLATFORM}_Gen.rb"
|
97
|
+
File.open(lTempFileName, 'w') do |oFile|
|
98
|
+
oFile << "
|
99
|
+
\#--
|
100
|
+
\# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
101
|
+
\# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
102
|
+
\#++
|
103
|
+
|
104
|
+
\# This file is generated by RubyPackager for Windows.
|
105
|
+
\# This is a temporary file that should not exist anymore once the release has been done.
|
106
|
+
|
107
|
+
\# This file has to launch the correct binary. There can be several binaries dependending on the configuration.
|
108
|
+
\# This is the file that will be created as the executable to launch.
|
109
|
+
|
110
|
+
module RubyPackager
|
111
|
+
|
112
|
+
\# Execute a shell command
|
113
|
+
\#
|
114
|
+
\# Parameters:
|
115
|
+
\# * *iCmd* (_String_): The shell command to execute
|
116
|
+
\# Return:
|
117
|
+
\# * _Boolean_: Success ?
|
118
|
+
def self.shellExecute(iCmd)
|
119
|
+
puts \"> \#{iCmd}\"
|
120
|
+
rSuccess = system(iCmd)
|
121
|
+
|
122
|
+
if (!rSuccess)
|
123
|
+
puts \"Error while executing '\#{iCmd}'\"
|
124
|
+
end
|
125
|
+
|
126
|
+
return rSuccess
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
\# Test if Ruby is installed
|
132
|
+
lSuccess = false
|
133
|
+
lCurrentDir = Dir.getwd
|
134
|
+
if (system('#{lRubyBaseBinName} --version'))
|
135
|
+
\# Launch directly
|
136
|
+
puts \"Ruby found in environment. Using it directly.\"
|
137
|
+
lSuccess = RubyPackager::shellExecute(\"#{lRubyLaunchCmd} -w \\\"\#{lCurrentDir}/#{iReleaseInfo.ExecutableInfo[:StartupRBFile]}\\\" \#{ARGV.join(' ')}\")
|
138
|
+
end
|
139
|
+
if (!lSuccess)
|
140
|
+
\# Use allinoneruby
|
141
|
+
puts \"Ruby not found in environment. Using shipped Ruby.\"
|
142
|
+
lSuccess = RubyPackager::shellExecute(\"start \\\"Title\\\" \\\"\#{lCurrentDir}/#{lBinSubDir}/#{lBinName}\\\" \\\"\#{lCurrentDir}/#{iReleaseInfo.ExecutableInfo[:StartupRBFile]}\\\" \#{ARGV.join(' ')}\")
|
143
|
+
if (!lSuccess)
|
144
|
+
puts 'Unable to execute the application. Please reinstall it.'
|
145
|
+
puts 'Hit enter to quit.'
|
146
|
+
$stdin.gets
|
147
|
+
end
|
148
|
+
end
|
149
|
+
"
|
150
|
+
end
|
151
|
+
lOldDir = Dir.getwd
|
152
|
+
Dir.chdir(iReleaseDir)
|
153
|
+
rSuccess = system("exerb.bat -o #{iReleaseInfo.ExecutableInfo[:ExeName]}.exe #{lTempFileName}")
|
154
|
+
Dir.chdir(lOldDir)
|
155
|
+
if (rSuccess)
|
156
|
+
File.unlink(lTempFileName)
|
157
|
+
# And set its icon
|
158
|
+
lEdiconCmd = "#{PLATFORM_DIR}/edicon/edicon.exe #{iReleaseDir}/#{iReleaseInfo.ExecutableInfo[:ExeName]}.exe #{iRootDir}/#{iReleaseInfo.ExecutableInfo[:IconName]}"
|
159
|
+
rSuccess = system(lEdiconCmd)
|
160
|
+
if (!rSuccess)
|
161
|
+
puts "!!! Error while executing \"#{lEdiconCmd}\""
|
162
|
+
end
|
163
|
+
else
|
164
|
+
puts "!!! Error while executing \"exerb.bat -o #{iReleaseInfo.ExecutableInfo[:ExeName]}.exe #{lTempFileName}\""
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
return rSuccess
|
169
|
+
end
|
170
|
+
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
$ReleaseInfo = RubyPackager::ReleaseInfo.new(
|
7
|
+
'BasicTest_HelloWorld',
|
8
|
+
'0.0.1',
|
9
|
+
['Main.rb'],
|
10
|
+
[],
|
11
|
+
'Main.rb',
|
12
|
+
'BasicTest',
|
13
|
+
"Distribution/#{RUBY_PLATFORM}/Icon.ico",
|
14
|
+
"Distribution/#{RUBY_PLATFORM}/Installer/install.nsi",
|
15
|
+
true
|
16
|
+
)
|
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
The license stated herein is a copy of the BSD License (modified on July 1999).
|
3
|
+
The AUTHOR mentionned below refers to the list of people involved in the
|
4
|
+
creation and modification of any file included in the delivered package.
|
5
|
+
This list is found in the file named AUTHORS.
|
6
|
+
The AUTHORS and LICENSE files have to be included in any release of software
|
7
|
+
embedding source code of this package, or using it as a derivative software.
|
8
|
+
|
9
|
+
Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
10
|
+
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
12
|
+
modification, are permitted provided that the following conditions are met:
|
13
|
+
|
14
|
+
1. Redistributions of source code must retain the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer.
|
16
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
17
|
+
this list of conditions and the following disclaimer in the documentation
|
18
|
+
and/or other materials provided with the distribution.
|
19
|
+
3. The name of the author may not be used to endorse or promote products
|
20
|
+
derived from this software without specific prior written permission.
|
21
|
+
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
23
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
24
|
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
25
|
+
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
27
|
+
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
30
|
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
31
|
+
OF SUCH DAMAGE.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
;--
|
2
|
+
; Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
; Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
;++
|
5
|
+
|
6
|
+
; install.nsi
|
7
|
+
;
|
8
|
+
; This script creates an installer using NSIS for a simple test program
|
9
|
+
; The compiler must define the following symbols:
|
10
|
+
; * VERSION (/DVERSION=0.0.1.20090430)
|
11
|
+
; * RELEASEDIR ("/DRELEASEDIR=C:\Releases\MyRelease")
|
12
|
+
|
13
|
+
;--------------------------------
|
14
|
+
; Global attributes
|
15
|
+
Name "BasicTest"
|
16
|
+
Caption "Basic Testing - Hello World"
|
17
|
+
Icon "Icon.ico"
|
18
|
+
OutFile "setup.exe"
|
19
|
+
|
20
|
+
;--------------------------------
|
21
|
+
; Compiler tuner
|
22
|
+
XPStyle on
|
23
|
+
|
24
|
+
;--------------------------------
|
25
|
+
; Default location
|
26
|
+
InstallDir "$PROGRAMFILES\Test"
|
27
|
+
|
28
|
+
;--------------------------------
|
29
|
+
; License
|
30
|
+
LicenseText "Welcome to HelloWorld installation (v. ${VERSION})."
|
31
|
+
LicenseData "InstallLicense.txt"
|
32
|
+
|
33
|
+
;--------------------------------
|
34
|
+
; List of wizard pages to display
|
35
|
+
Page license
|
36
|
+
Page components
|
37
|
+
Page directory
|
38
|
+
Page instfiles
|
39
|
+
|
40
|
+
;--------------------------------
|
41
|
+
; List of installable components
|
42
|
+
InstType "Full"
|
43
|
+
|
44
|
+
;--------------------------------
|
45
|
+
; Sections giving what to install
|
46
|
+
|
47
|
+
Section "Core"
|
48
|
+
SectionIn 1 RO
|
49
|
+
SetOutPath $INSTDIR
|
50
|
+
File /r ${RELEASEDIR}\*.*
|
51
|
+
SectionEnd
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# To change this template, choose Tools | Templates
|
2
|
+
# and open the template in the editor.
|
3
|
+
#--
|
4
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
5
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
6
|
+
#++
|
7
|
+
|
8
|
+
puts "Hello World"
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
module RubyPackager
|
9
|
+
|
10
|
+
module Test
|
11
|
+
|
12
|
+
# Execute a test
|
13
|
+
#
|
14
|
+
# Parameters:
|
15
|
+
# * *iApplicationName* (_String_): Name of the application for the test
|
16
|
+
# * *iReleaseInfoName* (_String_): Name of release info file
|
17
|
+
# * *iIncludeRuby* (_Boolean_): Do we include Ruby in the release ?
|
18
|
+
def execTest(iApplicationName, iReleaseInfoName, iIncludeRuby)
|
19
|
+
# Go to the application directory
|
20
|
+
lOldDir = Dir.getwd
|
21
|
+
lAppDir = File.expand_path("#{File.dirname(__FILE__)}/Applications/#{iApplicationName}")
|
22
|
+
Dir.chdir(lAppDir)
|
23
|
+
# Clean the Releases dir if it exists already
|
24
|
+
FileUtils::rm_rf("#{lAppDir}/Releases")
|
25
|
+
# Launch everything
|
26
|
+
lArgs = []
|
27
|
+
if (iIncludeRuby)
|
28
|
+
lArgs << '-r'
|
29
|
+
end
|
30
|
+
lArgs << "Distribution/#{iReleaseInfoName}"
|
31
|
+
lSuccess = RubyPackager::Launcher.new.run(lArgs)
|
32
|
+
Dir.chdir(lOldDir)
|
33
|
+
# Check if everything is ok
|
34
|
+
assert(lSuccess)
|
35
|
+
# Get the name of the directory
|
36
|
+
lDirs = Dir.glob("#{lAppDir}/Releases/#{RUBY_PLATFORM}/*")
|
37
|
+
assert_equal(1, lDirs.size)
|
38
|
+
lReleaseDir = lDirs[0]
|
39
|
+
# Read the release info ourselves
|
40
|
+
require "#{lAppDir}/Distribution/#{iReleaseInfoName}"
|
41
|
+
# TODO: OS independent. Don't test .exe anymore here.
|
42
|
+
assert(File.exists?("#{lReleaseDir}/Installer/#{$ReleaseInfo.ExeName}_#{$ReleaseInfo.Version}_setup.exe"))
|
43
|
+
assert(File.exists?("#{lReleaseDir}/Release/#{$ReleaseInfo.ExeName}.exe"))
|
44
|
+
# Clean the Releases dir
|
45
|
+
FileUtils::rm_rf("#{lAppDir}/Releases")
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
3
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
4
|
+
#++
|
5
|
+
|
6
|
+
module RubyPackager
|
7
|
+
|
8
|
+
class BasicTest < ::Test::Unit::TestCase
|
9
|
+
|
10
|
+
include RubyPackager::Test
|
11
|
+
|
12
|
+
# Test the basic usage without embedded Ruby
|
13
|
+
def testBasicWithoutRuby
|
14
|
+
execTest('Basic', 'ReleaseInfo.rb', false)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# To change this template, choose Tools | Templates
|
2
|
+
# and open the template in the editor.
|
3
|
+
#--
|
4
|
+
# Copyright (c) 2009 Muriel Salvan (murielsalvan@users.sourceforge.net)
|
5
|
+
# Licensed under the terms specified in LICENSE file. No warranty is provided.
|
6
|
+
#++
|
7
|
+
|
8
|
+
require 'test/unit'
|
9
|
+
|
10
|
+
# Add the path
|
11
|
+
lRootDir = File.expand_path("#{File.dirname(__FILE__)}/..")
|
12
|
+
$LOAD_PATH << lRootDir
|
13
|
+
$LOAD_PATH << "#{lRootDir}/lib"
|
14
|
+
|
15
|
+
require 'bin/Release'
|
16
|
+
require 'Common'
|
17
|
+
|
18
|
+
# Run the test cases for our platform
|
19
|
+
require "#{File.dirname(__FILE__)}/#{RUBY_PLATFORM}/run"
|