six-updater 0.22.1-x86-mswin32 → 0.22.3-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ require 'rake/testtask'
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.platform = "x86-mingw32"
15
15
  s.name = 'six-updater'
16
- s.version = '0.22.1'
16
+ s.version = '0.22.3'
17
17
  s.has_rdoc = true
18
18
  s.extra_rdoc_files = ['README', 'LICENSE']
19
19
  s.summary = 'Your summary here'
@@ -36,7 +36,7 @@ end
36
36
  spec3 = Gem::Specification.new do |s|
37
37
  s.platform = "x86-mswin32"
38
38
  s.name = 'six-updater'
39
- s.version = '0.22.1'
39
+ s.version = '0.22.3'
40
40
  s.has_rdoc = true
41
41
  s.extra_rdoc_files = ['README', 'LICENSE']
42
42
  s.summary = 'Your summary here'
@@ -58,7 +58,7 @@ end
58
58
 
59
59
  spec2 = Gem::Specification.new do |s|
60
60
  s.name = 'six-updater'
61
- s.version = '0.22.1'
61
+ s.version = '0.22.3'
62
62
  s.has_rdoc = true
63
63
  s.extra_rdoc_files = ['README', 'LICENSE']
64
64
  s.summary = 'Your summary here'
data/lib/six/updater.rb CHANGED
@@ -39,7 +39,7 @@ end
39
39
  module Six
40
40
  # TODO: Evaluate if this module should be a class instead?
41
41
  module Updater
42
- VERSION = '0.22.1'
42
+ VERSION = '0.22.3'
43
43
  COMPONENT = 'six-updater'
44
44
  LOG_LIMIT = 9999
45
45
 
@@ -321,7 +321,7 @@ module Six
321
321
  end
322
322
  log.debug "@config #{@config}"
323
323
 
324
- @procs = find_process(process_name, @config[:app_path])
324
+ @procs = find_process(process_name, full_path)
325
325
  unless @procs.empty?
326
326
  log.warn "WARNING: Found open arma processes! #{@config[:app_exe]}, PIDs: #{@procs}, you might want to abort and close them!"
327
327
  end
@@ -380,6 +380,11 @@ module Six
380
380
  end
381
381
  end
382
382
 
383
+ def full_path
384
+ File.dirname(File.join(@config[:app_path], @config[:app_exe])).gsub("\\", "/")
385
+ end
386
+
387
+
383
388
  def beta_msg
384
389
  if @beta_exe && !@beta
385
390
  log.warn "WARNING: You do not seem to be running the 'beta' modfolder, but have selected 'beta/arma2.exe'"
@@ -415,6 +420,7 @@ module Six
415
420
  reg = /([0-9]*)$/
416
421
  line[reg]
417
422
  pid = $1
423
+ next if pid.nil?
418
424
  line.sub!(reg, "")
419
425
  line.strip!
420
426
  line[/^([\w ]*\.\w*)[ ]*(.*)/]
@@ -423,15 +429,13 @@ module Six
423
429
 
424
430
  case image.downcase
425
431
  when name.downcase
432
+ pid = pid.to_i
433
+ next unless pid > 0
426
434
  unless path && !full.nil?
427
- pid = pid.to_i
428
- next unless pid > 0
429
435
  pids << pid
430
436
  next
431
437
  end
432
- if File.join(path, name).sub("/", "\\").downcase == full.downcase
433
- pid = pid.to_i
434
- next unless pid > 0
438
+ if File.join(path, name).gsub("/", "\\").downcase == full.downcase
435
439
  pids << pid
436
440
  end
437
441
  end
@@ -500,13 +504,15 @@ module Six
500
504
  end
501
505
 
502
506
  def startgame(cmd = nil)
503
- log.info "Starting the game with #{@config[:app_params]} -mod=#{@mods}#{cmd}"
507
+ log.info "Starting the game #{@config[:app_exe]} from #{@config[:app_path]}"
508
+ log.info "#{@config[:app_params]} -mod=#{@mods}#{cmd}"
509
+
504
510
  case RUBY_PLATFORM
505
511
  when /-mingw32$/, /-mswin32$/
506
512
  begin
507
513
  struct = Process.create(
508
514
  :app_name => File.join(@config[:app_path], @config[:app_exe]),
509
- :command_line => " #{@config[:app_params]} -mod=#{@mods}#{cmd}",
515
+ :command_line => " #{@config[:app_params]} \"-mod=#{@mods}#{cmd}\"",
510
516
  :creation_flags => Process::DETACHED_PROCESS,
511
517
  :process_inherit => false,
512
518
  :thread_inherit => false,
@@ -520,7 +526,7 @@ module Six
520
526
  end
521
527
  else
522
528
  Dir.chdir(@config[:app_path]) do
523
- system "#{@config[:app_exe]} #{@config[:app_params]} -mod=#{@mods}#{cmd}"
529
+ system "#{@config[:app_exe]} #{@config[:app_params]} \"-mod=#{@mods}#{cmd}\""
524
530
  end
525
531
  end
526
532
  end
@@ -544,7 +550,7 @@ module Six
544
550
  shortcut.description = "Start Arma2 with #{mods2}"
545
551
  shortcut.path = File.join(@config[:app_path], @config[:app_exe])
546
552
  shortcut.working_directory = @config[:app_path]
547
- shortcut.arguments = "#{@config[:app_params]} -mod=#{mods2}"
553
+ shortcut.arguments = "#{@config[:app_params]} \"-mod=#{mods2}\""
548
554
  end
549
555
  log.info "Created shortcut (in #{path}): #{name}"
550
556
  rescue => e
@@ -341,6 +341,11 @@ module Six
341
341
  if File.exists?(path)
342
342
  log.info "Found keys, processing..."
343
343
  k_path = File.join(@config[:app_path], 'keys')
344
+ FileUtils.mkdir_p(k_path) unless File.exists(k_path)
345
+ unless File.directory?(k_path)
346
+ log.warn "WARNING: Keys folder not existing (or is file), aborting"
347
+ return
348
+ end
344
349
  if File.directory? path
345
350
  Dir[File.join(path, '*.bikey')].each do |key|
346
351
  path, file = File.dirname(key), File.basename(key)
@@ -385,6 +390,10 @@ module Six
385
390
  FileUtils::mv(uconfigpath, "#{uconfigpath}_#{time}") if File.exists?(uconfigpath)
386
391
  if File.directory? path
387
392
  FileUtils::mkdir_p uconfig unless File.exists?(uconfig)
393
+ unless File.directory?(uconfig)
394
+ log.warn "WARNING: Userconfig folder not existing (or is file), aborting"
395
+ return
396
+ end
388
397
  FileUtils::cp_r(path, uconfigpath)
389
398
  else
390
399
  unpack(path, @config[:app_path])
@@ -60,8 +60,8 @@ module Six
60
60
  end
61
61
 
62
62
  def update(opts = {})
63
- # Update the config file with our hosts list
64
- file = File.join(@path, '.rsync/config.yml')
63
+ # # Update the config file with our hosts list
64
+ #file = File.join(@path, '.rsync/config.yml')
65
65
  opts[:hosts] = @repositories
66
66
 
67
67
  # Update!
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-updater
3
3
  version: !ruby/object:Gem::Version
4
- hash: 69
4
+ hash: 65
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 22
9
- - 1
10
- version: 0.22.1
9
+ - 3
10
+ version: 0.22.3
11
11
  platform: x86-mswin32
12
12
  authors:
13
13
  - Sickboy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-24 00:00:00 +02:00
18
+ date: 2010-10-19 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency