wixgem 0.99.0 → 0.100.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wixgem.rb +46 -41
- metadata +2 -4
- data/example/example.msi +0 -0
- data/example/example.msm +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f49e74125e346acac818843bed5bdadc06b61d52ef2becf206e879d945c46663
|
4
|
+
data.tar.gz: bfe2da0d978b3c1e13600f6bf5569ded3331b632a9ddcfb8bb4a7def4174a271
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1bc863cb16f90ed4fb4f6768b9487a225ae7b9fd190bd1295109534b6f6c037982524a4134d09cbce679637c5c4228b50576dbd3124dbdbe9b08abde5315f90
|
7
|
+
data.tar.gz: c241bd8ef6d4693d04b5b85ae111815abe328c5ee694d4f107140d67282c4bcf67bf8f201a5ce7382378cd913c6a87ea2a379055a66f31bb006d5555df92686f
|
data/lib/wixgem.rb
CHANGED
@@ -191,9 +191,9 @@ class Wix
|
|
191
191
|
|
192
192
|
if(File.read_only?(absolute_path))
|
193
193
|
install_path = ".\\#{self.modify_file_path(input, file).gsub(/\//,'\\')}"
|
194
|
-
|
195
|
-
|
196
|
-
|
194
|
+
install_path = install_path.gsub(/\.\\\\/,'.\\')
|
195
|
+
file_elements = REXML::XPath.match(xml_doc, "//File[@Source='#{install_path}']")
|
196
|
+
file_elements[0].attributes['ReadOnly'] = 'yes' if(file_elements.length == 1)
|
197
197
|
end
|
198
198
|
end
|
199
199
|
|
@@ -531,66 +531,71 @@ class Wix
|
|
531
531
|
end
|
532
532
|
|
533
533
|
def self.create_output(wxs_file, input, output)
|
534
|
-
|
534
|
+
wixobj_file = "#{File.basename(wxs_file,'.wxs')}.wixobj"
|
535
535
|
|
536
|
-
|
537
|
-
|
538
|
-
|
536
|
+
wix_install_path=install_path.gsub(/\\/,'/');
|
537
|
+
wix_bin_dir = "#{wix_install_path}/bin"
|
538
|
+
wix_bin_dir = "#{wix_install_path}/tools" unless(Dir.exists?(wix_bin_dir))
|
539
|
+
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))
|
539
540
|
|
540
|
-
|
541
|
+
candle_cmd = Execute.new("\"#{wix_bin_dir}/candle.exe\" -out \"#{wixobj_file}\" \"#{wxs_file}\"", { quiet: true })
|
542
|
+
candle_cmd.execute
|
543
|
+
log_wix_output(candle_cmd)
|
544
|
+
|
545
|
+
cmd_args = "-nologo -out \"#{output}\" \"#{wixobj_file}\""
|
541
546
|
cmd_args = "-ext WixNetfxExtension -ext WixUIExtension -ext WixUtilExtension -cultures:en-us #{cmd_args}"
|
542
|
-
|
543
|
-
|
544
|
-
|
547
|
+
light_cmd = Execute.new("\"#{wix_bin_dir}/light.exe\" #{cmd_args}", { quiet: true })
|
548
|
+
light_cmd.execute
|
549
|
+
log_wix_output(light_cmd)
|
545
550
|
end
|
546
551
|
|
547
552
|
def self.verify_input_keys(input)
|
548
|
-
|
553
|
+
input[:files].reject! { |f| File.directory?(f) }
|
549
554
|
|
550
555
|
[:files,:ignore_files].each { |key| raise "Hash key #{key} cannot be nil" if(input.has_key?(key) && input[key].nil?)}
|
551
556
|
end
|
552
557
|
|
553
558
|
def self.create_package(output, input)
|
554
559
|
raise 'WIX path is not set! Install Wixtoolset or assign with Wixgem::Wix.install_path = <path to wix toolset' if(self.install_path.nil?)
|
555
|
-
|
556
|
-
|
560
|
+
input = { files: input } unless(input.kind_of?(Hash))
|
561
|
+
verify_input_keys(input)
|
557
562
|
|
558
|
-
|
559
|
-
|
563
|
+
@debug = input[:debug] if(!@debug && input.has_key?(:debug))
|
564
|
+
start_logger if(@debug)
|
560
565
|
|
561
|
-
|
566
|
+
FileUtils.mkpath(File.dirname(output)) unless(Dir.exists?(File.dirname(output)))
|
562
567
|
|
563
|
-
|
568
|
+
ext = File.extname(output)
|
564
569
|
basename = File.basename(output, ext)
|
565
|
-
|
570
|
+
FileUtils.rm(output) if(File.exists?(output))
|
566
571
|
|
567
|
-
|
568
|
-
|
569
|
-
|
572
|
+
output_absolute_path = File.absolute_path(output)
|
573
|
+
input[:original_pwd] = Dir.pwd
|
574
|
+
input[:msi?] = output.include?('.msi')
|
570
575
|
|
571
|
-
|
576
|
+
modify_binary_files(input)
|
572
577
|
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
578
|
+
temp_directory do |dir|
|
579
|
+
wxs_file = "#{basename}.wxs"
|
580
|
+
begin
|
581
|
+
copy_install_files(dir, input)
|
577
582
|
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
583
|
+
Dir.chdir(dir) do |current_dir|
|
584
|
+
create_wxs_file(wxs_file, input, ext)
|
585
|
+
create_output(wxs_file, input, output_absolute_path)
|
586
|
+
end
|
587
|
+
rescue Exception => e
|
588
|
+
raise e
|
589
|
+
ensure
|
590
|
+
FileUtils.cp("#{dir}/#{wxs_file}", "#{output_absolute_path}.wxs") if(File.exists?("#{dir}/#{wxs_file}") && @debug)
|
591
|
+
File.open("#{output_absolute_path}.log", 'w') { |f| f.puts(@logger) } if(@debug &!@logger.nil?)
|
592
|
+
end
|
593
|
+
end
|
589
594
|
|
590
|
-
|
591
|
-
|
595
|
+
pdb_file = output_absolute_path.gsub(ext,'.wixpdb')
|
596
|
+
FileUtils.rm(pdb_file) if(File.exists?(pdb_file))
|
592
597
|
|
593
|
-
|
598
|
+
end_logger if(@debug)
|
594
599
|
end
|
595
600
|
end
|
596
601
|
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.100.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-
|
11
|
+
date: 2019-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execute
|
@@ -131,8 +131,6 @@ extra_rdoc_files: []
|
|
131
131
|
files:
|
132
132
|
- LICENSE
|
133
133
|
- README.md
|
134
|
-
- example/example.msi
|
135
|
-
- example/example.msm
|
136
134
|
- example/install_files/directory/file2.txt
|
137
135
|
- example/install_files/file1.txt
|
138
136
|
- example/rakefile.rb
|
data/example/example.msi
DELETED
Binary file
|
data/example/example.msm
DELETED
Binary file
|