wixgem 0.103.0 → 0.108.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/example.msi +0 -0
- data/example/example.msm +0 -0
- data/lib/service.rb +26 -2
- data/lib/wixgem.rb +38 -51
- metadata +8 -9
- data/lib/user.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80493efcc975680f41a21d0196dedde83e90a2447b1bdf6eebf1ffdb1de1b49d
|
4
|
+
data.tar.gz: 7e1508dcaad2346044f97601ea8b754e043fb02fd9e350ad607289063e7660eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 399c34135782d39b0cb839c308e4acef986d7126701a57d2d1bc02d7118733dc1e7fa5ee98845e0b863856e711a7f9d56e2d16b6866e49fea2df3ab1e2ea18d7
|
7
|
+
data.tar.gz: 4644152e7d05ce0919685405043838caedc3f978e985ebcff47e25d739ccbf5197e818fdbbcb0a31b8dd96ef5543e5c35ef59ccf753b137a3ba0e25ab49b4f92
|
data/example/example.msi
CHANGED
Binary file
|
data/example/example.msm
CHANGED
Binary file
|
data/lib/service.rb
CHANGED
@@ -22,19 +22,43 @@ class Service
|
|
22
22
|
service_exe_element = file_elements[0]
|
23
23
|
service_exe_element.attributes['KeyPath']='yes'
|
24
24
|
|
25
|
-
create_service_element(service_exe_element)
|
25
|
+
create_service_element(xml_doc, service_exe_element)
|
26
26
|
|
27
27
|
return xml_doc
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
31
|
-
def create_service_element(service_exe_element)
|
31
|
+
def create_service_element(xml_doc, service_exe_element)
|
32
32
|
parent_element = service_exe_element.parent
|
33
33
|
|
34
34
|
service = @hash[:service]
|
35
35
|
service_control = {}
|
36
36
|
service_control = @hash[:service_control] if(@hash.has_key?(:service))
|
37
37
|
|
38
|
+
if(service.key?(:logonasservice))
|
39
|
+
raise ':logonasservice requires an :account element' unless(service.key?(:account))
|
40
|
+
|
41
|
+
wix = REXML::XPath.match(xml_doc, "/Wix")[0]
|
42
|
+
wix.add_attribute('xmlns:Util', 'http://schemas.microsoft.com/wix/UtilExtension')
|
43
|
+
|
44
|
+
user_element = parent_element.add_element 'Util:User'
|
45
|
+
|
46
|
+
account = service[:account].gsub(/\\/, '/')
|
47
|
+
if(account.include?('/'))
|
48
|
+
words = account.split('/')
|
49
|
+
user_element.add_attribute('Domain', words[0])
|
50
|
+
|
51
|
+
account = words[1]
|
52
|
+
end
|
53
|
+
|
54
|
+
user_element.attributes['Id'] = "logon_as_service_#{SecureRandom.uuid.gsub(/-/,'')}"
|
55
|
+
user_element.add_attribute('Name', account)
|
56
|
+
user_element.add_attribute('LogonAsService', service[:logonasservice])
|
57
|
+
user_element.add_attribute('CreateUser', 'no')
|
58
|
+
user_element.add_attribute('UpdateIfExists', 'yes')
|
59
|
+
|
60
|
+
service.delete(:logonasservice)
|
61
|
+
end
|
38
62
|
service_element = parent_element.add_element('ServiceInstall')
|
39
63
|
|
40
64
|
service_element.attributes['Id'] = "Service_#{SecureRandom.uuid.gsub(/-/,'')}"
|
data/lib/wixgem.rb
CHANGED
@@ -9,7 +9,6 @@ require_relative 'custom_action.rb'
|
|
9
9
|
require_relative 'temp_directory.rb'
|
10
10
|
require_relative 'associate_extension.rb'
|
11
11
|
require_relative 'service.rb'
|
12
|
-
require_relative 'user.rb'
|
13
12
|
|
14
13
|
# Editor for wix Files WixEdit: http://http://wixedit.sourceforge.net/
|
15
14
|
# Full list of Wix editors : http://robmensching.com/blog/posts/2007/11/20/wix-editors/
|
@@ -223,17 +222,6 @@ class Wix
|
|
223
222
|
return xml_doc
|
224
223
|
end
|
225
224
|
|
226
|
-
def self.manage_users(xml_doc,input)
|
227
|
-
return xml_doc unless(input.has_key?(:users))
|
228
|
-
|
229
|
-
input[:users].each do |username, user_hash|
|
230
|
-
user = User.new(username, user_hash)
|
231
|
-
xml_doc = user.create(xml_doc)
|
232
|
-
end
|
233
|
-
|
234
|
-
return xml_doc
|
235
|
-
end
|
236
|
-
|
237
225
|
def self.manage_services(xml_doc,input)
|
238
226
|
return xml_doc unless(input.has_key?(:services))
|
239
227
|
|
@@ -293,43 +281,43 @@ class Wix
|
|
293
281
|
end
|
294
282
|
|
295
283
|
def self.copy_install_files(directory, input)
|
296
|
-
|
284
|
+
files = files(input)
|
297
285
|
|
298
|
-
|
299
|
-
|
300
|
-
|
286
|
+
missing_files = []
|
287
|
+
files.each do |file|
|
288
|
+
if(File.exists?(file))
|
301
289
|
install_path = file
|
302
290
|
if(input.has_key?(:modify_file_paths))
|
303
291
|
input[:modify_file_paths].each { |regex, replacement_string| install_path = install_path.gsub(regex, replacement_string) }
|
304
292
|
end
|
305
|
-
|
293
|
+
raise "Invalid relative installation path: #{install_path}" if(install_path.include?(':'))
|
306
294
|
|
307
295
|
install_path = "#{directory}/#{install_path}"
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
end
|
296
|
+
FileUtils.mkpath(File.dirname(install_path)) unless(Dir.exists?(File.dirname(install_path)))
|
297
|
+
FileUtils.cp(file, install_path, preserve: true)
|
298
|
+
elsif(!File.exists?(file))
|
299
|
+
missing_files.insert(missing_files.length, file)
|
313
300
|
end
|
301
|
+
end
|
314
302
|
|
315
303
|
if(@debug)
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
304
|
+
if(files.length > 0)
|
305
|
+
max_path = files.max { |a, b| a.length <=> b.length }
|
306
|
+
columen_size = max_path.length + 10
|
307
|
+
end
|
320
308
|
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
309
|
+
ingore_files = self.ignore_files(input)
|
310
|
+
if(input.has_key?(:ignore_files))
|
311
|
+
@logger << "------------------------------------ ignoring files -----------------------------------" unless(@logger.nil?)
|
312
|
+
input[:ignore_files].each { |file| @logger << file }
|
313
|
+
end
|
326
314
|
|
327
|
-
|
328
|
-
|
329
|
-
|
315
|
+
@logger << "------------------------------------ Installation Paths -----------------------------------" unless(@logger.nil?)
|
316
|
+
@logger << "%-#{columen_size}s %s\n" % ['File path', 'Installation Path'] unless(@logger.nil?)
|
317
|
+
files.reject! { |f| ingore_files.include?(f) }
|
330
318
|
|
331
|
-
|
332
|
-
|
319
|
+
files.each do |file|
|
320
|
+
if(File.exists?(file))
|
333
321
|
install_path = file
|
334
322
|
if(input.has_key?(:modify_file_paths))
|
335
323
|
input[:modify_file_paths].each { |regex, replacement_string| install_path = install_path.gsub(regex, replacement_string) }
|
@@ -337,22 +325,22 @@ class Wix
|
|
337
325
|
@logger << "%-#{columen_size}s %s\n" % [file, install_path] unless(@logger.nil?)
|
338
326
|
end
|
339
327
|
end
|
340
|
-
|
341
|
-
|
328
|
+
@logger << "-------------------------------------------------------------------------------------------" unless(@logger.nil?)
|
329
|
+
end
|
342
330
|
|
343
|
-
|
331
|
+
raise 'No files were given to wixgem' if(files.length == 0)
|
344
332
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
333
|
+
if(missing_files.length > 0)
|
334
|
+
missing_files_str = ''
|
335
|
+
missing_files.each { |f|
|
336
|
+
if(missing_files_str.empty?)
|
337
|
+
missing_files_str = f
|
338
|
+
else
|
339
|
+
missing_files_str = "#{missing_files_str}, #{f}"
|
340
|
+
end
|
341
|
+
}
|
342
|
+
raise "Wixgem missing files: #{missing_files_str}"
|
343
|
+
end
|
356
344
|
end
|
357
345
|
|
358
346
|
def self.modify_binary_files(input)
|
@@ -547,7 +535,6 @@ class Wix
|
|
547
535
|
xml_doc = manage_binary_table(xml_doc, input)
|
548
536
|
xml_doc = manage_associate_extensions(xml_doc, input)
|
549
537
|
xml_doc = manage_services(xml_doc, input)
|
550
|
-
xml_doc = manage_users(xml_doc, input)
|
551
538
|
|
552
539
|
formatter = REXML::Formatters::Pretty.new(2)
|
553
540
|
formatter.compact = true
|
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.108.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Marshall
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execute
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: raykit
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
@@ -124,7 +124,7 @@ dependencies:
|
|
124
124
|
version: '0'
|
125
125
|
description: Simple Ruby interface to facilitate creating and compiling windows installation
|
126
126
|
files with the Wix Toolset.
|
127
|
-
email:
|
127
|
+
email:
|
128
128
|
executables: []
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
@@ -143,13 +143,12 @@ files:
|
|
143
143
|
- lib/service.rb
|
144
144
|
- lib/shortcut.rb
|
145
145
|
- lib/temp_directory.rb
|
146
|
-
- lib/user.rb
|
147
146
|
- lib/wixgem.rb
|
148
147
|
homepage: http://rubygems.org/gems/wixgem
|
149
148
|
licenses:
|
150
149
|
- Apache 2.0
|
151
150
|
metadata: {}
|
152
|
-
post_install_message:
|
151
|
+
post_install_message:
|
153
152
|
rdoc_options: []
|
154
153
|
require_paths:
|
155
154
|
- lib
|
@@ -164,8 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
163
|
- !ruby/object:Gem::Version
|
165
164
|
version: '0'
|
166
165
|
requirements: []
|
167
|
-
rubygems_version: 3.
|
168
|
-
signing_key:
|
166
|
+
rubygems_version: 3.2.3
|
167
|
+
signing_key:
|
169
168
|
specification_version: 4
|
170
169
|
summary: Simple Ruby interface to facilitate working with Wix Toolset
|
171
170
|
test_files: []
|
data/lib/user.rb
DELETED
@@ -1,32 +0,0 @@
|
|
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
|