wixgem 0.101.0 → 0.102.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/user.rb +32 -0
- data/lib/wixgem.rb +30 -5
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08dc56c8d621b528b1cb1ff5c18eec7471636058aef6b6c8f724bb21c1fb0bd7'
|
4
|
+
data.tar.gz: 0ad8339d5922e4cc649e201d8e8e8373b3f4944b9a460159645bc00c95e3dfb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bd086a6983076b63f6dea5335eaa9b6c59fb98445e152c257d15cd2c795ef5dba8044726577654aa6ff00c2cfc67aa036e3398b8b6c24691535db64a40c5453
|
7
|
+
data.tar.gz: 4167b78356007490925eb09e1a08f9218837c575866c1ca68586806762debd9a390e124faf109589895295b40a8654cc949fca386cf0515917c62b7f0aa13157
|
data/example/example.msi
CHANGED
Binary file
|
data/example/example.msm
CHANGED
Binary file
|
data/lib/user.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rexml/document'
|
2
|
+
require 'SecureRandom'
|
3
|
+
|
4
|
+
module Wixgem
|
5
|
+
|
6
|
+
class User
|
7
|
+
def initialize(name, user_hash)
|
8
|
+
@user_name = name
|
9
|
+
@user_hash = user_hash
|
10
|
+
end
|
11
|
+
def create(xml_doc)
|
12
|
+
wix = REXML::XPath.match(xml_doc, "/Wix")[0]
|
13
|
+
wix.add_attribute('xmlns:Util', 'http://schemas.microsoft.com/wix/UtilExtension')
|
14
|
+
|
15
|
+
match = REXML::XPath.match(xml_doc, "/Wix")
|
16
|
+
|
17
|
+
fragment = match[0].add_element 'Fragment'
|
18
|
+
component_group = fragment.add_element 'ComponentGroup'
|
19
|
+
component_group.add_attribute('Id', "cg_#{SecureRandom.uuid.gsub(/-/,'')}")
|
20
|
+
component = component_group.add_element 'Component'
|
21
|
+
component.add_attribute('Id', "c_#{SecureRandom.uuid.gsub(/-/,'')}")
|
22
|
+
component.add_attribute('Directory', 'INSTALLDIR')
|
23
|
+
|
24
|
+
user_element = component.add_element 'Util:User'
|
25
|
+
user_element.add_attribute('Id', "user_#{SecureRandom.uuid.gsub(/-/,'')}")
|
26
|
+
user_element.add_attribute('Name', @user_name)
|
27
|
+
@user_hash.each { |attrib, value| user_element.add_attribute(attrib.to_s, value) }
|
28
|
+
|
29
|
+
return xml_doc
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/wixgem.rb
CHANGED
@@ -79,7 +79,7 @@ class Wix
|
|
79
79
|
def self.manage_netframework(xml_doc, input)
|
80
80
|
if(input.key?(:requires_netframework))
|
81
81
|
wix = REXML::XPath.match(xml_doc, "/Wix")[0]
|
82
|
-
wix.attributes['xmlns:
|
82
|
+
wix.attributes['xmlns:NetFX'] = 'https://schemas.microsoft.com/wix/NetFxExtension'
|
83
83
|
|
84
84
|
product = REXML::XPath.match(xml_doc, "/Wix/Product")[0]
|
85
85
|
product.add_element 'PropertyRef', { 'Id' => input[:requires_netframework] }
|
@@ -221,7 +221,29 @@ class Wix
|
|
221
221
|
|
222
222
|
return xml_doc
|
223
223
|
end
|
224
|
+
|
225
|
+
def self.manage_users(xml_doc,input)
|
226
|
+
return xml_doc unless(input.has_key?(:users))
|
227
|
+
|
228
|
+
input[:users].each do |username, user_hash|
|
229
|
+
user = User.new(username, user_hash)
|
230
|
+
xml_doc = user.create(xml_doc)
|
231
|
+
end
|
232
|
+
|
233
|
+
return xml_doc
|
234
|
+
end
|
224
235
|
|
236
|
+
def self.manage_services(xml_doc,input)
|
237
|
+
return xml_doc unless(input.has_key?(:services))
|
238
|
+
|
239
|
+
input[:services].each do |service_hash|
|
240
|
+
service = Service.new(service_hash)
|
241
|
+
xml_doc = service.create(xml_doc)
|
242
|
+
end
|
243
|
+
|
244
|
+
return xml_doc
|
245
|
+
end
|
246
|
+
|
225
247
|
def self.manage_self_register(xml_doc, input)
|
226
248
|
return xml_doc unless(input.has_key?(:com_self_register))
|
227
249
|
input[:com_self_register].each do |file|
|
@@ -522,8 +544,9 @@ class Wix
|
|
522
544
|
xml_doc = manage_shortcuts(xml_doc, input)
|
523
545
|
xml_doc = manage_self_register(xml_doc, input)
|
524
546
|
xml_doc = manage_binary_table(xml_doc, input)
|
525
|
-
|
526
|
-
|
547
|
+
xml_doc = manage_associate_extensions(xml_doc, input)
|
548
|
+
xml_doc = manage_services(xml_doc, input)
|
549
|
+
xml_doc = manage_users(xml_doc, input)
|
527
550
|
|
528
551
|
formatter = REXML::Formatters::Pretty.new(2)
|
529
552
|
formatter.compact = true
|
@@ -542,12 +565,14 @@ class Wix
|
|
542
565
|
wix_bin_dir = "#{wix_install_path}/tools" unless(Dir.exists?(wix_bin_dir))
|
543
566
|
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))
|
544
567
|
|
545
|
-
|
568
|
+
|
569
|
+
ext_args = "-ext WixUtilExtension -ext WixNetfxExtension -ext WixUIExtension"
|
570
|
+
candle_cmd = Execute.new("\"#{wix_bin_dir}/candle.exe\" #{ext_args} -out \"#{wixobj_file}\" \"#{wxs_file}\"", { quiet: true })
|
546
571
|
candle_cmd.execute
|
547
572
|
log_wix_output(candle_cmd)
|
548
573
|
|
549
574
|
cmd_args = "-nologo -out \"#{output}\" \"#{wixobj_file}\""
|
550
|
-
cmd_args = "
|
575
|
+
cmd_args = "#{ext_args} -cultures:en-us #{cmd_args}"
|
551
576
|
light_cmd = Execute.new("\"#{wix_bin_dir}/light.exe\" #{cmd_args}", { quiet: true })
|
552
577
|
light_cmd.execute
|
553
578
|
log_wix_output(light_cmd)
|
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.102.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: 2019-07-
|
11
|
+
date: 2019-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execute
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- lib/service.rb
|
144
144
|
- lib/shortcut.rb
|
145
145
|
- lib/temp_directory.rb
|
146
|
+
- lib/user.rb
|
146
147
|
- lib/wixgem.rb
|
147
148
|
homepage: http://rubygems.org/gems/wixgem
|
148
149
|
licenses:
|