dev 2.1.141 → 2.1.142

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/apps/wix.rb +40 -20
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a460fa5550930d2899ac1d6b1e3e4dff7a98f0414a5eac1d318ac35db1a4f3dc
4
- data.tar.gz: 37dd47c4dc960a331e6eaeb78ca9e99f23480763eab12516dc025e0457256cc6
3
+ metadata.gz: 12250afee504c82a8b62e9d964fae6056c11c155f750047d5158b9eea94b3682
4
+ data.tar.gz: 5bc0897b33e9201b8b2d062edf05f35f0d846c0121572980ed57fc1ca7cae0b4
5
5
  SHA512:
6
- metadata.gz: c8332d58b70296a39e8e3b8ab5751329486f91cc71082b9833e31f0310a0e98d48c8e8accc4560fa13549c24452078fc03e35b27678785aef67aadf9ba375d3f
7
- data.tar.gz: 33da601f0ead56727ebc083738713a180caca1e95581cfc7a91351ceefd2299b21a4c5c7c1fd0415c7b2d3836df4222370dcbedb7cd7053ae861e75ef4e991bf
6
+ metadata.gz: 4af0f09e30f57fc8e3f22d6f749df321c866fac4d04a3df77e2943afb6c2fc215a3b23277a5459818a13ce5ba276e2836e8324fa4487e29e2791a26e40b6c619
7
+ data.tar.gz: aaaa3051d87f40612fd9f4c6c791cce0d79c7aa593a09acff35d1f6f0e349d9b88b8b825096f0980412d9a39fc9147c4c1fda5aea523f9207cfa4e52bba0c067
data/lib/apps/wix.rb CHANGED
@@ -11,26 +11,46 @@ if defined?(DEBUG)
11
11
  #
12
12
  #
13
13
  class Wix
14
- def self.get_build_commands wxs_file
15
- build_commands=nil
16
- if(File.exists?(wxs_file) && !defined?(NO_WIX))
17
- if(Environment.windows?)
18
- ext='msi'
19
- ext='exe' if(IO.read(wxs_file).include?('<Bundle'))
20
- extensions=''
21
- ['WixNetFxExtension','WixBalExtension','WixUtilExtension','WixUiExtension'].each{|e|
22
- extensions="#{extensions}-ext #{e} "
14
+ def self.get_build_commands wxs_file
15
+ build_commands=nil
16
+ if(File.exists?(wxs_file) && !defined?(NO_WIX))
17
+ if(Environment.windows?)
18
+ ext='msi'
19
+ ext='exe' if(IO.read(wxs_file).include?('<Bundle'))
20
+ extensions=''
21
+ ['WixNetFxExtension','WixBalExtension','WixUtilExtension','WixUiExtension'].each{|e|
22
+ extensions="#{extensions}-ext #{e} "
23
+ }
24
+ build_commands=Array.new if build_commands.nil?
25
+ build_commands << "candle #{wxs_file} #{extensions}"
26
+
27
+ if(defined?(VERSION))
28
+ build_commands << "light #{File.basename(wxs_file,'.*')}.wixobj -out #{File.basename(wxs_file,'.*')}-#{VERSION}.#{ext} #{extensions}"
29
+ else
30
+ build_commands << "light #{File.basename(wxs_file,'.*')}.wixobj #{extensions}"
31
+ end
32
+ end
33
+ end
34
+ build_commands
35
+ end
36
+
37
+ def self.get_wix_with_files wxs_template_text, component_id, filenames
38
+ # <Component[-\s\w="]+Id="ApplicationFiles"[-"\s\w=]+>([-<="\/.>\s\w]+)<\/C
39
+ search=wxs_template_text.scan(/<Component[-\s\w="]+Id="ApplicationFiles"[-"\s\w=]+>([-<="\/.>\s\w]+)<\/C/)[0][0]
40
+ replace='\r\n'
41
+ index = 0
42
+ filenames.each{|f|
43
+ replace += "<File Id=\"#{component_id}#{index}\" Source=\"#{f}\"/>\r\n"
44
+ index += 1
23
45
  }
24
- build_commands=Array.new if build_commands.nil?
25
- build_commands << "candle #{wxs_file} #{extensions}"
26
-
27
- if(defined?(VERSION))
28
- build_commands << "light #{File.basename(wxs_file,'.*')}.wixobj -out #{File.basename(wxs_file,'.*')}-#{VERSION}.#{ext} #{extensions}"
29
- else
30
- build_commands << "light #{File.basename(wxs_file,'.*')}.wixobj #{extensions}"
31
- end
32
- end
46
+ wxs_template_text.gsub(search,replace)
47
+ end
48
+
49
+ def self.update_wix_files wxs_filename, component_id, filenames
50
+ wix_text = IO.read(wxs_filename)
51
+ new_text = get_wix_with_files(wix_text, component_id,filenames)
52
+ if(wix_text != new_text)
53
+ File.open(wxs_filename,'w'){|f| f.write(new_text) }
54
+ end
33
55
  end
34
- build_commands
35
- end
36
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.141
4
+ version: 2.1.142
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lou Parslow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-26 00:00:00.000000000 Z
11
+ date: 2019-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -142,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubyforge_project:
146
- rubygems_version: 2.7.3
145
+ rubygems_version: 3.0.1
147
146
  signing_key:
148
147
  specification_version: 4
149
148
  summary: dev