six-updater-web 0.12.5 → 0.12.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/config/six-updater-web.rb +23 -19
- metadata +2 -2
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ end
|
|
10
10
|
require 'open3'
|
11
11
|
|
12
12
|
module SixUpdaterWeb
|
13
|
-
VERSION = "0.12.
|
13
|
+
VERSION = "0.12.6"
|
14
14
|
|
15
15
|
COMPONENT = "six-updater-web"
|
16
16
|
SIX_PORT = 3000 unless defined?(SIX_PORT)
|
@@ -23,8 +23,8 @@ module SixUpdaterWeb
|
|
23
23
|
ARMA2_STEAM = ['SOFTWARE\\Valve\\Steam\\Common\\ARMA 2', 'InstallPath']
|
24
24
|
|
25
25
|
bpath = if ENV['BASE_PATH']
|
26
|
-
OLDLOCATION = ENV['BASE_PATH'] unless defined?(OLDLOCATION)
|
27
|
-
ENV['BASE_PATH']
|
26
|
+
OLDLOCATION = "#{ENV['BASE_PATH']}" unless defined?(OLDLOCATION)
|
27
|
+
"#{ENV['BASE_PATH']}"
|
28
28
|
elsif defined?(OLDLOCATION)
|
29
29
|
OLDLOCATION
|
30
30
|
else
|
@@ -36,7 +36,7 @@ module SixUpdaterWeb
|
|
36
36
|
TOOL_PATH = File.join(BASE_PATH, 'tools')
|
37
37
|
RUBY_PATH = File.join(TOOL_PATH, "ruby", "bin")
|
38
38
|
#RUB_PATH = "tools/ruby/bin"
|
39
|
-
|
39
|
+
|
40
40
|
args = ARGV.join(" ")
|
41
41
|
if args[/RAILS_ENV=(\w)/]
|
42
42
|
ENV["RAILS_ENV"] = $1
|
@@ -60,7 +60,7 @@ module SixUpdaterWeb
|
|
60
60
|
when /-mingw32$/, /-mswin32$/
|
61
61
|
TEMP_PATH = if ENV['TEMP']
|
62
62
|
if ENV['TEMP'].size > 0
|
63
|
-
File.directory?(ENV['TEMP']) ? ENV['TEMP'] : BASE_PATH
|
63
|
+
File.directory?(ENV['TEMP']) ? ENV['TEMP'].clone : BASE_PATH
|
64
64
|
else
|
65
65
|
BASE_PATH
|
66
66
|
end
|
@@ -75,7 +75,6 @@ module SixUpdaterWeb
|
|
75
75
|
# But requires everyone to update to it, unless we do it for them :D
|
76
76
|
path = File.join(BASE_PATH, "tools")
|
77
77
|
rubypath = File.join(path, 'ruby', 'bin')
|
78
|
-
rubypath.gsub!("/", "\\")
|
79
78
|
tpath = "#{path};#{File.join(path, 'bin')};#{rubypath}"
|
80
79
|
tpath.gsub!('/', '\\')
|
81
80
|
ENV['PATH'] = "" unless ENV['PATH']
|
@@ -127,17 +126,20 @@ module SixUpdaterWeb
|
|
127
126
|
case RUBY_PLATFORM
|
128
127
|
when /-mingw32$/, /-mswin32$/
|
129
128
|
return unless defined?(OPEN_BROWSER)
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
129
|
+
#Thread.new() do
|
130
|
+
file_to_use = "#{LOCAL_URL}:#{SIX_PORT}/main"
|
131
|
+
arguments = nil
|
132
|
+
directory = nil
|
133
|
+
operation = "OPEN"
|
134
|
+
show = nil
|
135
|
+
# sleep 3
|
136
|
+
begin
|
137
|
+
shell = WIN32OLE.new('Shell.Application')
|
138
|
+
shell.ShellExecute(file_to_use, arguments, directory, operation, show)
|
139
|
+
rescue
|
140
|
+
#logger.warn "Unable to open browser: #{$!}"
|
141
|
+
end
|
142
|
+
#end
|
141
143
|
end
|
142
144
|
end
|
143
145
|
end
|
@@ -148,6 +150,8 @@ module SixUpdaterWeb
|
|
148
150
|
def run_program(path, app_path, startpath, cl)
|
149
151
|
logger.info "Current Path: #{Dir.pwd}, BASE_PATH: #{BASE_PATH}, DATA_PATH: #{DATA_PATH}"
|
150
152
|
logger.info "Starting with #{cl} from #{startpath}" #, with #{path}"
|
153
|
+
# TODO: Cleanup
|
154
|
+
startpath = "#{startpath}"
|
151
155
|
begin
|
152
156
|
case RUBY_PLATFORM
|
153
157
|
when /-mingw32$/, /-mswin32$/
|
@@ -173,9 +177,9 @@ module SixUpdaterWeb
|
|
173
177
|
end
|
174
178
|
#logger.info "Unimplemented on current platform: #{RUBY_PLATFORM}"
|
175
179
|
end
|
176
|
-
rescue
|
180
|
+
rescue => e
|
177
181
|
logger.info "WARNING: Something went wrong starting the app"
|
178
|
-
logger.info "#{
|
182
|
+
logger.info "#{e.class}: #{e.message} #{e.backtrace.join("\n")}"
|
179
183
|
end
|
180
184
|
end
|
181
185
|
end
|