wixgem 0.30.0 → 0.31.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/lib/wixgem.rb +25 -3
- data/spec/COM_spec.rb +42 -0
- data/spec/installation_spec.rb +4 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d95c67cdf3018e6d670322ef4727ac4a7ad674b6
|
4
|
+
data.tar.gz: 81f6738e0e8dc13046af6f0b13f62175db6141ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54cdfbe55af0819b300199229c8b9ef7b06cafd5f32af441ea9bb3e886443f2103bdf4e8a7d56ae1332c4cd745cf09b4536e7ddcd14057d8190918ccd405d28b
|
7
|
+
data.tar.gz: 0b0d4f67df788faec251883cf34bae74dde0d289c4254bc751b43f4af2f2d844c5fbb73b0bc71ff26e2387aa0dedb2f0dc69382a3598e854cc52c75c40519f3d
|
data/lib/wixgem.rb
CHANGED
@@ -58,6 +58,24 @@ class Wix
|
|
58
58
|
return xml_doc
|
59
59
|
end
|
60
60
|
|
61
|
+
def self.manage_com_files(xml_doc)
|
62
|
+
component_groups = REXML::XPath.match(xml_doc, '//Wix/Fragment/ComponentGroup')
|
63
|
+
return xml_doc if(component_groups.nil?)
|
64
|
+
|
65
|
+
com_dlls = {}
|
66
|
+
component_groups.each do |component_group|
|
67
|
+
component_group.each_element do |component|
|
68
|
+
classes = component.get_elements('Class')
|
69
|
+
if((classes.length == 1) && (classes[0].attributes["Context"] == 'InprocServer32'))
|
70
|
+
files = component.get_elements('File')
|
71
|
+
files[0].add_attribute('Assembly','.net')
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
return xml_doc
|
77
|
+
end
|
78
|
+
|
61
79
|
def self.manage_custom_actions(xml_doc, input)
|
62
80
|
manufacturer = 'Not Set'
|
63
81
|
manufacturer = input[:manufacturer] if(input.kind_of?(Hash) && input.has_key?(:manufacturer))
|
@@ -68,11 +86,13 @@ class Wix
|
|
68
86
|
product = REXML::XPath.match(xml_doc, '//Wix/Product')
|
69
87
|
return xml_doc if(product.length == 0)
|
70
88
|
|
71
|
-
product[0].add_element 'CustomAction', { 'Id' => 'SetTARGETDIR', '
|
89
|
+
product[0].add_element 'CustomAction', { 'Id' => 'SetTARGETDIR', 'Property' => 'TARGETDIR', 'Value' => "#{install_path}", 'Return' => 'check'}
|
72
90
|
|
73
91
|
install_execute_sequence = product[0].add_element 'InstallExecuteSequence'
|
74
|
-
custom_action = install_execute_sequence.add_element 'Custom', { 'Action' => 'SetTARGETDIR', '
|
92
|
+
custom_action = install_execute_sequence.add_element 'Custom', { 'Action' => 'SetTARGETDIR', 'Before'=>'CostFinalize' }
|
75
93
|
|
94
|
+
admin_execute_sequence = product[0].add_element 'AdminExecuteSequence'
|
95
|
+
custom_action = admin_execute_sequence.add_element 'Custom', { 'Action' => 'SetTARGETDIR', 'Before'=>'CostFinalize' }
|
76
96
|
return xml_doc
|
77
97
|
end
|
78
98
|
|
@@ -159,9 +179,10 @@ class Wix
|
|
159
179
|
|
160
180
|
wix_cmd = "\"#{install_path}/bin/heat.exe\" dir . #{template_option} -cg InstallionFiles -gg -nologo -srd -o \"#{wxs_file}\""
|
161
181
|
wix_cmd = wix_cmd.gsub(/-srd/, '-svb6 -srd') if(input.kind_of?(Hash) && input.has_key?(:has_vb6_files))
|
162
|
-
File.open("#{File.basename(wxs_file,'.wxs')}.wix_cmds.txt", 'w') { |f| f.puts wix_cmd } if(@debug)
|
163
182
|
|
164
183
|
stdout = %x[#{wix_cmd}]
|
184
|
+
|
185
|
+
File.open("#{File.basename(wxs_file,'.wxs')}.wix_cmds.txt", 'w') { |f| f.puts wix_cmd } if(@debug)
|
165
186
|
raise "#{stdout}\nFailed to generate .wxs file" unless(File.exists?(wxs_file))
|
166
187
|
|
167
188
|
product_name = File.basename(wxs_file, '.wxs')
|
@@ -194,6 +215,7 @@ class Wix
|
|
194
215
|
xml_doc = REXML::Document.new(wxs_text)
|
195
216
|
xml_doc = manage_custom_actions(xml_doc, input)
|
196
217
|
xml_doc = manage_upgrade(xml_doc,input)
|
218
|
+
xml_doc = manage_com_files(xml_doc)
|
197
219
|
xml_doc = manage_msm_files(xml_doc)
|
198
220
|
|
199
221
|
File.open(wxs_file, 'w') { |f| f.puts(xml_doc.to_s) }
|
data/spec/COM_spec.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require './lib/wixgem.rb'
|
3
|
+
require './spec/wixpath.rb'
|
4
|
+
require './WindowsInstaller.rb'
|
5
|
+
require 'win32ole'
|
6
|
+
|
7
|
+
describe 'Wixgem' do
|
8
|
+
describe 'Installation of a COM object' do
|
9
|
+
it 'should not be able to instance a COM object' do
|
10
|
+
expect { WIN32OLE.new('COMObject.ComClassExample') }.to raise_error
|
11
|
+
end
|
12
|
+
|
13
|
+
installation_file = 'test/wixgem_com_test.msi'
|
14
|
+
while(WindowsInstaller.installed?(installation_file))
|
15
|
+
WindowsInstaller.uninstall(installation_file)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should create an installation file using: #{installation_file}" do
|
19
|
+
Wix.make_installation(installation_file, { debug: true, files: ['COMObject/bin/Release/COMObject.dll']})
|
20
|
+
expect(File.exists?(installation_file)).to be(true)
|
21
|
+
end
|
22
|
+
|
23
|
+
WindowsInstaller.install(installation_file)
|
24
|
+
|
25
|
+
it 'should be able to instance a COM object with a GUID' do
|
26
|
+
#object = WIN32OLE.new('{863AEADA-EE73-4f4a-ABC0-3FB384CB41AA}')
|
27
|
+
#expect(object.nil?).to eq(false)
|
28
|
+
#puts "Text: #{object.GetText}"
|
29
|
+
#expect(object.GetText).to eq('Hello World')
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should be able to instance a COM object with a Program Id' do
|
33
|
+
|
34
|
+
#object = WIN32OLE.new('COMObject.ComClassExample')
|
35
|
+
#expect(object.nil?).to eq(false)
|
36
|
+
#puts "Text: #{object.GetText}"
|
37
|
+
#expect(object.GetText).to eq('Hello World')
|
38
|
+
end
|
39
|
+
|
40
|
+
WindowsInstaller.uninstall(installation_file) if(WindowsInstaller.installed?(installation_file))
|
41
|
+
end
|
42
|
+
end
|
data/spec/installation_spec.rb
CHANGED
@@ -3,12 +3,12 @@ require './lib/wixgem.rb'
|
|
3
3
|
require './spec/wixpath.rb'
|
4
4
|
require './spec/test_install.rb'
|
5
5
|
require './spec/test_files_exist.rb'
|
6
|
-
require 'json'
|
7
6
|
|
8
7
|
describe 'Wixgem' do
|
9
8
|
#Wix.debug = true
|
10
9
|
describe 'Installation' do
|
11
10
|
test_arguments = {
|
11
|
+
test0: ['wixgem_install_test1.msi', ['rakefile.rb']],
|
12
12
|
test1: ['test/wixgem_install_test1.msi', ['rakefile.rb']],
|
13
13
|
test2: ['test/wixgem_install_test2.msi', {manufacturer: 'musco', files: ['Gemfile']}],
|
14
14
|
test3: ['test/wixgem_install_test3.msi', ['rakefile.rb', 'Gemfile']],
|
@@ -18,7 +18,7 @@ describe 'Wixgem' do
|
|
18
18
|
test7: ['test/wixgem_install_test7.msi', {product_name: 'test_productname', files: ['Gemfile']}],
|
19
19
|
test8: ['test/wixgem_install_test8.msi', {modify_file_paths: {/\Atest_files\// => ''}, files: Dir.glob("test_files/**/*")}]
|
20
20
|
}
|
21
|
-
|
21
|
+
|
22
22
|
test_arguments.each { |key, value|
|
23
23
|
it "should create an installation file using: #{value[0]}" do
|
24
24
|
Wix.make_installation(value[0], value[1])
|
@@ -48,7 +48,7 @@ describe 'Wixgem' do
|
|
48
48
|
end
|
49
49
|
}
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
describe 'including vb6 files' do
|
53
53
|
it "the wix's heat command should contain the -svb6 flag" do
|
54
54
|
Wix.make_installation('test/wixgem_install_vb6_files.msi', {manufacturer: 'musco', has_vb6_files: true, files: ['rakefile.rb'], debug: true})
|
@@ -56,4 +56,5 @@ describe 'Wixgem' do
|
|
56
56
|
expect(wix_cmd_text.include?('-svb6')).to eq(true)
|
57
57
|
end
|
58
58
|
end
|
59
|
+
|
59
60
|
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.31.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: 2015-01-
|
11
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- README.md
|
84
84
|
- example/rakefile.rb
|
85
85
|
- lib/wixgem.rb
|
86
|
+
- spec/COM_spec.rb
|
86
87
|
- spec/execute.rb
|
87
88
|
- spec/installation_spec.rb
|
88
89
|
- spec/mergemodule_spec.rb
|