wixgem 0.108.0 → 0.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80493efcc975680f41a21d0196dedde83e90a2447b1bdf6eebf1ffdb1de1b49d
4
- data.tar.gz: 7e1508dcaad2346044f97601ea8b754e043fb02fd9e350ad607289063e7660eb
3
+ metadata.gz: acbf145ad790fe0b0faabf479d25e3837f65700d477e93a910d6efcd9f77e04d
4
+ data.tar.gz: cbc834eebb2e65b249f157edf7ebe065548d3cbd26d0968b2bc0ca672e14494e
5
5
  SHA512:
6
- metadata.gz: 399c34135782d39b0cb839c308e4acef986d7126701a57d2d1bc02d7118733dc1e7fa5ee98845e0b863856e711a7f9d56e2d16b6866e49fea2df3ab1e2ea18d7
7
- data.tar.gz: 4644152e7d05ce0919685405043838caedc3f978e985ebcff47e25d739ccbf5197e818fdbbcb0a31b8dd96ef5543e5c35ef59ccf753b137a3ba0e25ab49b4f92
6
+ metadata.gz: 69a025c6eef3598dbf2dba9f68265aa05c04f75af7f92c6af48929860781b9519e65b1bcad5d1824785428b3796a92fd8287f99be637758252234b9f984394e2
7
+ data.tar.gz: c27dba3df585bc4b46de25be5dd988eeb07c3f73f18537ce40e65d84b30131550d80a1de9864272f29754b5a7336d0bbc746a4511cb0ef36efb43725cfd389f6
data/example/example.msi CHANGED
Binary file
data/example/example.msm CHANGED
Binary file
data/lib/custom_action.rb CHANGED
@@ -48,8 +48,8 @@ class CustomAction
48
48
  action.attributes['FileKey'] = file_key
49
49
  end
50
50
 
51
- action.attributes['Directory'] = custom_action[:directory] if(custom_action.key?(:directory))
52
- action.attributes['ExeCommand'] = custom_action[:exe_command] if(custom_action.key?(:exe_command))
51
+ action.attributes['Directory'] = custom_action[:directory] if(custom_action.key?(:directory))
52
+ action.attributes['ExeCommand'] = custom_action[:exe_command] if(custom_action.key?(:exe_command))
53
53
  action.attributes['DllEntry'] = custom_action[:dll_entry] if(custom_action.key?(:dll_entry))
54
54
 
55
55
  if(custom_action.key?(:property))
@@ -0,0 +1,42 @@
1
+ ##require 'rexml/document'
2
+ #require 'SecureRandom'
3
+
4
+ #module Wixgem
5
+
6
+ # https://support.firegiant.com/hc/en-us/articles/230912127-RegistryKey-and-RegistryValue-elements
7
+ class RegistryKey
8
+ def initialize(xml_doc, input)
9
+ @xml_doc = xml_doc
10
+ @input = input
11
+ end
12
+ def add(registry_key)
13
+ unless(registry_key.key?(:root) && registry_key.key?(:key) && registry_key.key?(:value))
14
+ raise 'Registry key must have root, key, and value elements'
15
+ end
16
+
17
+ key_value = registry_key[:value]
18
+ unless(key_value.key?(:name) || key_value.key?(:value) || key_value.key?(:type))
19
+ raise 'Registry value must have name, value, and type elements'
20
+ end
21
+
22
+ registry_keys_component = REXML::XPath.match(@xml_doc, "//Component[@Id='RegistryKeys']")
23
+ if(registry_keys_component.size == 0)
24
+ wix_element = REXML::XPath.match(@xml_doc, "/Wix")[0]
25
+ fragment = wix_element.add_element 'Fragment'
26
+ component_group = fragment.add_element 'ComponentGroup'
27
+ component_group.attributes['Id'] = "rk_#{SecureRandom.uuid.gsub(/-/,'')}"
28
+
29
+ default_feature = REXML::XPath.match(@xml_doc, '//Wix/Product/Feature')
30
+ component_ref = default_feature[0].add_element 'ComponentGroupRef', 'Id' => component_group.attributes['Id']
31
+
32
+ component = component_group.add_element 'Component'
33
+ component.attributes['Id'] = 'RegistryKeys'
34
+ component.attributes['Directory'] = 'INSTALLDIR'
35
+ else
36
+ puts "component: #{registry_keys_component.to_s}"
37
+ end
38
+
39
+ registry_key_element = component.add_element 'RegistryKey', { 'Root' => registry_key[:root], 'Key' => registry_key[:key] }
40
+ value_element = registry_key_element.add_element 'RegistryValue', { 'Action' => 'write', 'Name' => key_value[:name], 'Value' => key_value[:value], 'Type' => key_value[:type] }
41
+ end
42
+ end
data/lib/wixgem.rb CHANGED
@@ -6,6 +6,7 @@ require 'SecureRandom'
6
6
  require_relative 'file.rb'
7
7
  require_relative 'shortcut.rb'
8
8
  require_relative 'custom_action.rb'
9
+ require_relative 'registry_key.rb'
9
10
  require_relative 'temp_directory.rb'
10
11
  require_relative 'associate_extension.rb'
11
12
  require_relative 'service.rb'
@@ -134,13 +135,22 @@ class Wix
134
135
 
135
136
  def self.manage_custom_actions(xml_doc, input)
136
137
  custom_actions = CustomAction.new(xml_doc, input)
137
- return xml_doc if(input[:custom_actions].nil?)
138
+ return xml_doc if(input[:custom_actions].nil?)
138
139
 
139
- input[:custom_actions].each { |ca| custom_actions.add(ca) } if(input.key?(:custom_actions))
140
+ input[:custom_actions].each { |ca| custom_actions.add(ca) }
140
141
 
141
- return xml_doc
142
+ return xml_doc
142
143
  end
143
-
144
+
145
+ def self.manage_registry_keys(xml_doc, input)
146
+ return xml_doc if(input[:set_registry_keys].nil?)
147
+
148
+ registry_keys = RegistryKey.new(xml_doc, input)
149
+ input[:set_registry_keys].each { |rk| registry_keys.add(rk) }
150
+
151
+ return xml_doc
152
+ end
153
+
144
154
  def self.manage_associate_extensions(xml_doc, input)
145
155
  return xml_doc unless(input.key?(:extensions))
146
156
 
@@ -270,7 +280,7 @@ class Wix
270
280
  files = input
271
281
  files = input[:files] if(input.kind_of?(Hash))
272
282
 
273
- return files
283
+ return files
274
284
  end
275
285
 
276
286
  def self.ignore_files(input)
@@ -410,7 +420,7 @@ class Wix
410
420
 
411
421
  filename = wxs_file
412
422
  if(install_files.index(file) == 0)
413
- execute_heat(input, "file \"#{windows_path}\" -v #{template_option} -cg InstallionFiles -gg -nologo -srd -o \"#{filename}\"")
423
+ execute_heat(input, "file \"#{windows_path}\" -v #{template_option} -cg InstallationFiles -gg -nologo -srd -o \"#{filename}\"")
414
424
  else
415
425
  filename = File.basename(wxs_file).gsub('.wxs', "-#{wxs_files.length}.wxs")
416
426
  execute_heat(input, "file \"#{windows_path}\" -v -template fragment -gg -nologo -srd -o \"#{filename}\"")
@@ -461,7 +471,7 @@ class Wix
461
471
  end
462
472
 
463
473
  def self.execute_heat_dir(wxs_file, input, template_option)
464
- execute_heat(input,"dir . #{template_option} -cg InstallionFiles -gg -nologo -srd -o \"#{wxs_file}\"")
474
+ execute_heat(input,"dir . #{template_option} -cg InstallationFiles -gg -nologo -srd -o \"#{wxs_file}\"")
465
475
  end
466
476
 
467
477
  def self.create_wxs_file(wxs_file, input, ext)
@@ -527,6 +537,7 @@ class Wix
527
537
  xml_doc = manage_win10_crt(xml_doc, input)
528
538
  #xml_doc = manage_ui(xml_doc, input)
529
539
  xml_doc = manage_custom_actions(xml_doc, input)
540
+ xml_doc = manage_registry_keys(xml_doc, input)
530
541
  xml_doc = manage_upgrade(xml_doc,input)
531
542
  xml_doc = manage_msm_files(xml_doc)
532
543
  xml_doc = manage_read_only_files(xml_doc,input)
@@ -553,7 +564,6 @@ class Wix
553
564
  wix_bin_dir = "#{wix_install_path}/tools" unless(Dir.exists?(wix_bin_dir))
554
565
  raise "Unable to locate candle.exe. Expecting to have a sub directory bin or tools in the wix installtion directory: #{wix_install_path}" unless(Dir.exists?(wix_bin_dir))
555
566
 
556
-
557
567
  ext_args = "-ext WixUtilExtension -ext WixNetfxExtension -ext WixUIExtension"
558
568
  candle_cmd = Execute.new("\"#{wix_bin_dir}/candle.exe\" #{ext_args} -out \"#{wixobj_file}\" \"#{wxs_file}\"", { quiet: true })
559
569
  candle_cmd.execute
@@ -604,6 +614,7 @@ class Wix
604
614
  rescue Exception => e
605
615
  raise e
606
616
  ensure
617
+ puts "debug path: #{output_absolute_path}" if(@debug)
607
618
  FileUtils.cp("#{dir}/#{wxs_file}", "#{output_absolute_path}.wxs") if(File.exists?("#{dir}/#{wxs_file}") && @debug)
608
619
  File.open("#{output_absolute_path}.log", 'w') { |f| f.puts(@logger) } if(@debug &!@logger.nil?)
609
620
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wixgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.108.0
4
+ version: 0.111.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Marshall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-24 00:00:00.000000000 Z
11
+ date: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execute
@@ -140,6 +140,7 @@ files:
140
140
  - lib/associate_extension.rb
141
141
  - lib/custom_action.rb
142
142
  - lib/file.rb
143
+ - lib/registry_key.rb
143
144
  - lib/service.rb
144
145
  - lib/shortcut.rb
145
146
  - lib/temp_directory.rb
@@ -163,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
164
  - !ruby/object:Gem::Version
164
165
  version: '0'
165
166
  requirements: []
166
- rubygems_version: 3.2.3
167
+ rubygems_version: 3.2.15
167
168
  signing_key:
168
169
  specification_version: 4
169
170
  summary: Simple Ruby interface to facilitate working with Wix Toolset