wixgem 0.110.0 → 0.112.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 +4 -4
- data/example/example.msi +0 -0
- data/example/example.msm +0 -0
- data/lib/custom_action.rb +2 -2
- data/lib/file.rb +1 -1
- data/lib/registry_key.rb +32 -71
- data/lib/service.rb +1 -1
- data/lib/shortcut.rb +1 -1
- data/lib/wixgem.rb +29 -17
- metadata +3 -4
- data/lib/registry_entries.rb +0 -68
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4723f8b26548ee609b1bfaee5351907307088a980711b19f303de6d022e2492
|
4
|
+
data.tar.gz: 71863140ca3dccf4e34edc6c19ce262cd2c3d20f1ed5076f9c3fc07c9f5281d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6b4f238ed0b62c2548f4bf8b8e91510aa5dd940c15555f516026a5b0f48fdf9da89ae67a3749cca041b922f872fdcb9295454ef3a65dd69c1cafde1c2d44f9a
|
7
|
+
data.tar.gz: 6799fa78437b6ff969bef1685045984884ba1564ca5f056c798cd92eee595e75c31cec3674dd96571611ca4e1f7316e18d5a8e4706cfe8ce4ac88dcefeda7138
|
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
|
-
|
52
|
-
|
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))
|
data/lib/file.rb
CHANGED
@@ -2,7 +2,7 @@ require 'win32ole'
|
|
2
2
|
|
3
3
|
class File
|
4
4
|
def self.read_only?(path)
|
5
|
-
raise "'#{path}' does not exist" unless(File.
|
5
|
+
raise "'#{path}' does not exist" unless(File.exist?(path))
|
6
6
|
|
7
7
|
fso = WIN32OLE.new('Scripting.FileSystemObject')
|
8
8
|
raise 'Failed to create Scripting.FileSystemObject' if(fso.nil?)
|
data/lib/registry_key.rb
CHANGED
@@ -1,81 +1,42 @@
|
|
1
|
-
require 'rexml/document'
|
2
|
-
require 'SecureRandom'
|
1
|
+
##require 'rexml/document'
|
2
|
+
#require 'SecureRandom'
|
3
3
|
|
4
|
-
module Wixgem
|
4
|
+
#module Wixgem
|
5
5
|
|
6
|
-
|
6
|
+
# https://support.firegiant.com/hc/en-us/articles/230912127-RegistryKey-and-RegistryValue-elements
|
7
|
+
class RegistryKey
|
7
8
|
def initialize(xml_doc, input)
|
8
9
|
@xml_doc = xml_doc
|
9
10
|
@input = input
|
10
11
|
end
|
11
|
-
def add(
|
12
|
-
unless(
|
13
|
-
raise '
|
14
|
-
|
15
|
-
|
16
|
-
file_key=nil
|
17
|
-
if(custom_action.key?(:file))
|
18
|
-
install_path = ".\\#{custom_action[:file].gsub(/\//,'\\')}"
|
19
|
-
file_elements = REXML::XPath.match(@xml_doc, "//File[@Source='#{install_path}']")
|
20
|
-
raise "Unable to locate installation file '#{custom_action[:file]} for custom action'" if(file_elements.nil? || (file_elements.size == 0))
|
21
|
-
|
22
|
-
file_key = file_elements[0].attributes['Id']
|
23
|
-
end
|
24
|
-
|
25
|
-
id = "ca_#{SecureRandom.uuid.gsub(/-/,'')}"
|
26
|
-
id = custom_action[:id] if(custom_action.key?(:id))
|
27
|
-
|
28
|
-
impersonate = 'yes'
|
29
|
-
impersonate = custom_action[:impersonate] if(custom_action.key?(:impersonate))
|
30
|
-
|
31
|
-
condition='NOT Installed AND NOT REMOVE'
|
32
|
-
condition='1' if(custom_action.key?(:binary_key))
|
33
|
-
condition = custom_action[:condition] if(custom_action.key?(:condition))
|
34
|
-
|
35
|
-
execute='deferred'
|
36
|
-
execute = custom_action[:execute] if(custom_action.key?(:execute))
|
37
|
-
|
38
|
-
ret='check'
|
39
|
-
ret = custom_action[:return] if(custom_action.key?(:return))
|
40
|
-
|
41
|
-
wix_element = REXML::XPath.match(@xml_doc, "/Wix")[0]
|
42
|
-
fragment = wix_element.add_element 'Fragment'
|
43
|
-
|
44
|
-
action = fragment.add_element 'CustomAction', { 'Id' => id, 'Impersonate' => impersonate, 'Return' => ret, 'HideTarget' => 'no', 'Execute' => execute }
|
45
|
-
if(custom_action.key?(:binary_key))
|
46
|
-
action.attributes['BinaryKey'] = custom_action[:binary_key]
|
47
|
-
else
|
48
|
-
action.attributes['FileKey'] = file_key
|
49
|
-
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
|
50
16
|
|
51
|
-
|
52
|
-
|
53
|
-
|
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
|
54
21
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
install_execute_sequence = fragment.add_element 'InstallExecuteSequence'
|
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(/-/,'')}"
|
64
28
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
elements[0].add_element 'CustomActionRef', { 'Id' => id }
|
79
|
-
end
|
80
|
-
end
|
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
|
81
42
|
end
|
data/lib/service.rb
CHANGED
@@ -14,7 +14,7 @@ class Service
|
|
14
14
|
raise "Service hash is required to have a :name key" unless(@hash[:service].has_key?(:name))
|
15
15
|
|
16
16
|
service_exe = @hash[:service_exe]
|
17
|
-
raise "Service #{file} does not exist" unless(File.
|
17
|
+
raise "Service #{file} does not exist" unless(File.exist?(service_exe))
|
18
18
|
|
19
19
|
file_elements = REXML::XPath.match(xml_doc, "//File[@Source='.\\#{service_exe.gsub(/\//,'\\')}']")
|
20
20
|
raise "Service #{@file} does not match a 'File' element with a 'Source' attribute in the wix generated wix file" if(file_elements.length == 0)
|
data/lib/shortcut.rb
CHANGED
@@ -11,7 +11,7 @@ class Shortcut
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def create(xml_doc)
|
14
|
-
raise "Shortcut #{@file} does not exist" unless(File.
|
14
|
+
raise "Shortcut #{@file} does not exist" unless(File.exist?(@file))
|
15
15
|
|
16
16
|
file_elements = REXML::XPath.match(xml_doc, "//File[@Source='.\\#{@file.gsub(/\//,'\\')}']")
|
17
17
|
raise "Shortcut #{@file} does not match a 'File' element with a 'Source' attribute in the wix generated wix file" if(file_elements.length == 0)
|
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
|
-
|
138
|
+
return xml_doc if(input[:custom_actions].nil?)
|
138
139
|
|
139
|
-
|
140
|
+
input[:custom_actions].each { |ca| custom_actions.add(ca) }
|
140
141
|
|
141
|
-
|
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
|
|
@@ -187,7 +197,7 @@ class Wix
|
|
187
197
|
|
188
198
|
install_files.each do |file|
|
189
199
|
absolute_path = file
|
190
|
-
absolute_path = "#{input[:original_pwd]}/#{file}" unless(File.
|
200
|
+
absolute_path = "#{input[:original_pwd]}/#{file}" unless(File.exist?(file))
|
191
201
|
|
192
202
|
if(File.read_only?(absolute_path))
|
193
203
|
install_path = ".\\#{self.modify_file_path(input, file).gsub(/\//,'\\')}"
|
@@ -270,7 +280,7 @@ class Wix
|
|
270
280
|
files = input
|
271
281
|
files = input[:files] if(input.kind_of?(Hash))
|
272
282
|
|
273
|
-
|
283
|
+
return files
|
274
284
|
end
|
275
285
|
|
276
286
|
def self.ignore_files(input)
|
@@ -285,7 +295,7 @@ class Wix
|
|
285
295
|
|
286
296
|
missing_files = []
|
287
297
|
files.each do |file|
|
288
|
-
if(File.
|
298
|
+
if(File.exist?(file))
|
289
299
|
install_path = file
|
290
300
|
if(input.has_key?(:modify_file_paths))
|
291
301
|
input[:modify_file_paths].each { |regex, replacement_string| install_path = install_path.gsub(regex, replacement_string) }
|
@@ -293,9 +303,9 @@ class Wix
|
|
293
303
|
raise "Invalid relative installation path: #{install_path}" if(install_path.include?(':'))
|
294
304
|
|
295
305
|
install_path = "#{directory}/#{install_path}"
|
296
|
-
FileUtils.mkpath(File.dirname(install_path)) unless(Dir.
|
306
|
+
FileUtils.mkpath(File.dirname(install_path)) unless(Dir.exist?(File.dirname(install_path)))
|
297
307
|
FileUtils.cp(file, install_path, preserve: true)
|
298
|
-
elsif(!File.
|
308
|
+
elsif(!File.exist?(file))
|
299
309
|
missing_files.insert(missing_files.length, file)
|
300
310
|
end
|
301
311
|
end
|
@@ -317,7 +327,7 @@ class Wix
|
|
317
327
|
files.reject! { |f| ingore_files.include?(f) }
|
318
328
|
|
319
329
|
files.each do |file|
|
320
|
-
if(File.
|
330
|
+
if(File.exist?(file))
|
321
331
|
install_path = file
|
322
332
|
if(input.has_key?(:modify_file_paths))
|
323
333
|
input[:modify_file_paths].each { |regex, replacement_string| install_path = install_path.gsub(regex, replacement_string) }
|
@@ -380,7 +390,7 @@ class Wix
|
|
380
390
|
def self.execute_heat(input, cmd_line_options)
|
381
391
|
wix_install_path=install_path.gsub(/\\/,'/');
|
382
392
|
wix_bin_dir = "#{wix_install_path}/bin"
|
383
|
-
wix_bin_dir = "#{wix_install_path}/tools" unless(Dir.
|
393
|
+
wix_bin_dir = "#{wix_install_path}/tools" unless(Dir.exist?(wix_bin_dir))
|
384
394
|
|
385
395
|
heat_cmd = Execute.new("\"#{wix_bin_dir}/heat.exe\" #{modify_heat_commandline(input, cmd_line_options)}", { quiet: true })
|
386
396
|
heat_cmd.execute
|
@@ -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)
|
@@ -550,8 +561,8 @@ class Wix
|
|
550
561
|
|
551
562
|
wix_install_path=install_path.gsub(/\\/,'/');
|
552
563
|
wix_bin_dir = "#{wix_install_path}/bin"
|
553
|
-
wix_bin_dir = "#{wix_install_path}/tools" unless(Dir.
|
554
|
-
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.
|
564
|
+
wix_bin_dir = "#{wix_install_path}/tools" unless(Dir.exist?(wix_bin_dir))
|
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.exist?(wix_bin_dir))
|
555
566
|
|
556
567
|
ext_args = "-ext WixUtilExtension -ext WixNetfxExtension -ext WixUIExtension"
|
557
568
|
candle_cmd = Execute.new("\"#{wix_bin_dir}/candle.exe\" #{ext_args} -out \"#{wixobj_file}\" \"#{wxs_file}\"", { quiet: true })
|
@@ -579,11 +590,11 @@ class Wix
|
|
579
590
|
@debug = input[:debug] if(!@debug && input.has_key?(:debug))
|
580
591
|
start_logger if(@debug)
|
581
592
|
|
582
|
-
FileUtils.mkpath(File.dirname(output)) unless(Dir.
|
593
|
+
FileUtils.mkpath(File.dirname(output)) unless(Dir.exist?(File.dirname(output)))
|
583
594
|
|
584
595
|
ext = File.extname(output)
|
585
596
|
basename = File.basename(output, ext)
|
586
|
-
FileUtils.rm(output) if(File.
|
597
|
+
FileUtils.rm(output) if(File.exist?(output))
|
587
598
|
|
588
599
|
output_absolute_path = File.absolute_path(output)
|
589
600
|
input[:original_pwd] = Dir.pwd
|
@@ -603,13 +614,14 @@ class Wix
|
|
603
614
|
rescue Exception => e
|
604
615
|
raise e
|
605
616
|
ensure
|
606
|
-
|
617
|
+
puts "debug path: #{output_absolute_path}" if(@debug)
|
618
|
+
FileUtils.cp("#{dir}/#{wxs_file}", "#{output_absolute_path}.wxs") if(File.exist?("#{dir}/#{wxs_file}") && @debug)
|
607
619
|
File.open("#{output_absolute_path}.log", 'w') { |f| f.puts(@logger) } if(@debug &!@logger.nil?)
|
608
620
|
end
|
609
621
|
end
|
610
622
|
|
611
623
|
pdb_file = output_absolute_path.gsub(ext,'.wixpdb')
|
612
|
-
FileUtils.rm(pdb_file) if(File.
|
624
|
+
FileUtils.rm(pdb_file) if(File.exist?(pdb_file))
|
613
625
|
|
614
626
|
end_logger if(@debug)
|
615
627
|
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.
|
4
|
+
version: 0.112.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: 2023-
|
11
|
+
date: 2023-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execute
|
@@ -140,7 +140,6 @@ files:
|
|
140
140
|
- lib/associate_extension.rb
|
141
141
|
- lib/custom_action.rb
|
142
142
|
- lib/file.rb
|
143
|
-
- lib/registry_entries.rb
|
144
143
|
- lib/registry_key.rb
|
145
144
|
- lib/service.rb
|
146
145
|
- lib/shortcut.rb
|
@@ -148,7 +147,7 @@ files:
|
|
148
147
|
- lib/wixgem.rb
|
149
148
|
homepage: http://rubygems.org/gems/wixgem
|
150
149
|
licenses:
|
151
|
-
-
|
150
|
+
- MIT
|
152
151
|
metadata: {}
|
153
152
|
post_install_message:
|
154
153
|
rdoc_options: []
|
data/lib/registry_entries.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
class RegistryEntries
|
2
|
-
def initialize(hash)
|
3
|
-
@hash = hash
|
4
|
-
end
|
5
|
-
|
6
|
-
def create_key(xml_doc)
|
7
|
-
raise "RegistryEntry hash is required to have a :root key" unless(@hash.has_key?(:root))
|
8
|
-
raise "RegistryEntry hash is required to have a :path key" unless(@hash.has_key?(:path))
|
9
|
-
raise "RegistryEntry hash is required to have a :key key" unless(@hash.has_key?(:key))
|
10
|
-
raise "Key hash is required to have a :name key" unless(@hash[:key].has_key?(:name))
|
11
|
-
raise "Key hash is required to have a :value key" unless(@hash[:value].has_key?(:name))
|
12
|
-
raise "Key hash is required to have a :value key" unless(@hash[:value_type].has_key?(:name))
|
13
|
-
|
14
|
-
service_exe = @hash[:service_exe]
|
15
|
-
raise "Service #{file} does not exist" unless(File.exists?(service_exe))
|
16
|
-
|
17
|
-
file_elements = REXML::XPath.match(xml_doc, "//File[@Source='.\\#{service_exe.gsub(/\//,'\\')}']")
|
18
|
-
raise "Service #{@file} does not match a 'File' element with a 'Source' attribute in the wix generated wix file" if(file_elements.length == 0)
|
19
|
-
|
20
|
-
service_exe_element = file_elements[0]
|
21
|
-
service_exe_element.attributes['KeyPath']='yes'
|
22
|
-
|
23
|
-
create_service_element(xml_doc, service_exe_element)
|
24
|
-
|
25
|
-
return xml_doc
|
26
|
-
end
|
27
|
-
|
28
|
-
def set(xml_doc, input)
|
29
|
-
file = file.gsub(/\//,'\\')
|
30
|
-
file_elements = REXML::XPath.match(@xml_doc, "//File[@Source='.\\#{file}']")
|
31
|
-
raise "Unable to find file '#{file}' to associate with extension '#{extension}'" if(file_elements.nil? || file_elements.size != 1)
|
32
|
-
|
33
|
-
file_parent = file_elements[0].parent
|
34
|
-
|
35
|
-
app=File.basename(file)
|
36
|
-
# App Paths to support Start,Run -> "myapp"
|
37
|
-
#<RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MyApp.exe" Value="[!MyApp.exe]" Type="string" />
|
38
|
-
file_parent.add_element 'RegistryValue', { 'Root' => 'HKLM', 'Key' => "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\#{app}",
|
39
|
-
'Value' => "[INSTALLDIR]#{file}", 'Type' => 'string' }
|
40
|
-
#<RegistryValue Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MyApp.exe" Name="Path" Value="[APPLICATIONFOLDER]" Type="string" />
|
41
|
-
file_parent.add_element 'RegistryValue', { 'Root' => 'HKLM', 'Key' => "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\#{app}",
|
42
|
-
'Name' => 'Path', 'Value' => '[INSTALLDIR]', 'Type' => 'string' }
|
43
|
-
|
44
|
-
# Extend to the "open with" list + Win7 jump menu pinning
|
45
|
-
#<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\MyApp.exe\SupportedTypes" Name=".xyz" Value="" Type="string" />
|
46
|
-
file_parent.add_element 'RegistryValue', { 'Root' => 'HKLM', 'Key' => "SOFTWARE\\Classes\\Applications\\#{app}\\SupportedTypes",
|
47
|
-
'Name' => extension, 'Value' => '', 'Type' => 'string' }
|
48
|
-
#<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\Applications\MyApp.exe\shell\open" Name="FriendlyAppName" Value="!(loc.ApplicationName)" Type="string" />
|
49
|
-
file_parent.add_element 'RegistryValue', { 'Root' => 'HKLM', 'Key' => "SOFTWARE\\Classes\\Applications\\#{app}\\shell\\open\\command",
|
50
|
-
'Value' => "[INSTALLDIR]#{file} \"%1\"", 'Type' => 'string' }
|
51
|
-
|
52
|
-
# MyApp.Document ProgID
|
53
|
-
#<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\MyApp.Document" Name="FriendlyTypeName" Value="!(loc.DescXYZ)" Type="string" />
|
54
|
-
file_parent.add_element 'RegistryValue', { 'Root' => 'HKLM', 'Key' => "SOFTWARE\\Classes\\#{File.basename(app, '.exe')}.Document",
|
55
|
-
'Name' => 'Aim Project File', 'Value' => "[INSTALLDIR]#{app} \"%1\"", 'Type' => 'string' }
|
56
|
-
|
57
|
-
#<ProgId Id="MyApp.Document" Description="!(loc.DescXYZ)" Icon="filetype.ico" Advertise="yes">
|
58
|
-
# <Extension Id="xyz">
|
59
|
-
# <Verb Id="open" Command="!(loc.ExplorerMenuOpenXYZ)" Argument=""%1"" />
|
60
|
-
# <MIME Advertise="yes" ContentType="application/xyz" Default="yes" />
|
61
|
-
# </Extension>
|
62
|
-
#</ProgId>
|
63
|
-
prog_id = file_parent.add_element 'ProgId', { 'Id' => "#{File.basename(app, '.exe')}.Document", 'Description' => "Aim project file",
|
64
|
-
'Advertise' => 'yes'}
|
65
|
-
ext = prog_id.add_element 'Extension', { 'Id' => extension.gsub(/\./, '') }
|
66
|
-
ext.add_element 'Verb', { 'Id' => 'open', 'Command' => "[INSTALLDIR]#{app}", 'Argument' => "\"%1\"" }
|
67
|
-
end
|
68
|
-
end
|