wixgem 0.99.0 → 0.100.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad604c669315ebac1c9b8b70a76ee956e65b8b3aeec95e92ad952f3b8e185bb7
4
- data.tar.gz: 111ab3b46b72aee343a638918dbfce3e6498e5309fe6ceeaa46551f2e1560c5c
3
+ metadata.gz: f49e74125e346acac818843bed5bdadc06b61d52ef2becf206e879d945c46663
4
+ data.tar.gz: bfe2da0d978b3c1e13600f6bf5569ded3331b632a9ddcfb8bb4a7def4174a271
5
5
  SHA512:
6
- metadata.gz: 0b74e4e894a2087ed6f89f8d0ee0b9b5dc03a95f124c7ac9535f40e9847ff7b3cb19cb22deb31329c4e3c68978aa63c94f114f5349cdd9a1e7e2531e0a289a28
7
- data.tar.gz: 9da8e9369d947d367d2a704a6aac16ab7f37a96bf790927ef80c77805cff74ff48acf56c682b3b9807f11f142bb9949148ad57d3cddcd3a51ae3da55c8837742
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
- 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)
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
- wixobj_file = "#{File.basename(wxs_file,'.wxs')}.wixobj"
534
+ wixobj_file = "#{File.basename(wxs_file,'.wxs')}.wixobj"
535
535
 
536
- candle_cmd = Execute.new("\"#{install_path.gsub(/\\/,'/')}/bin/candle.exe\" -out \"#{wixobj_file}\" \"#{wxs_file}\"", { quiet: true })
537
- candle_cmd.execute
538
- log_wix_output(candle_cmd)
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
- cmd_args = "-nologo -out \"#{output}\" \"#{wixobj_file}\""
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
- light_cmd = Execute.new("\"#{install_path.gsub(/\\/,'/')}/bin/light.exe\" #{cmd_args}", { quiet: true })
543
- light_cmd.execute
544
- log_wix_output(light_cmd)
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
- input[:files].reject! { |f| File.directory?(f) }
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
- input = { files: input } unless(input.kind_of?(Hash))
556
- verify_input_keys(input)
560
+ input = { files: input } unless(input.kind_of?(Hash))
561
+ verify_input_keys(input)
557
562
 
558
- @debug = input[:debug] if(!@debug && input.has_key?(:debug))
559
- start_logger if(@debug)
563
+ @debug = input[:debug] if(!@debug && input.has_key?(:debug))
564
+ start_logger if(@debug)
560
565
 
561
- FileUtils.mkpath(File.dirname(output)) unless(Dir.exists?(File.dirname(output)))
566
+ FileUtils.mkpath(File.dirname(output)) unless(Dir.exists?(File.dirname(output)))
562
567
 
563
- ext = File.extname(output)
568
+ ext = File.extname(output)
564
569
  basename = File.basename(output, ext)
565
- FileUtils.rm(output) if(File.exists?(output))
570
+ FileUtils.rm(output) if(File.exists?(output))
566
571
 
567
- output_absolute_path = File.absolute_path(output)
568
- input[:original_pwd] = Dir.pwd
569
- input[:msi?] = output.include?('.msi')
572
+ output_absolute_path = File.absolute_path(output)
573
+ input[:original_pwd] = Dir.pwd
574
+ input[:msi?] = output.include?('.msi')
570
575
 
571
- modify_binary_files(input)
576
+ modify_binary_files(input)
572
577
 
573
- temp_directory do |dir|
574
- wxs_file = "#{basename}.wxs"
575
- begin
576
- copy_install_files(dir, input)
578
+ temp_directory do |dir|
579
+ wxs_file = "#{basename}.wxs"
580
+ begin
581
+ copy_install_files(dir, input)
577
582
 
578
- Dir.chdir(dir) do |current_dir|
579
- create_wxs_file(wxs_file, input, ext)
580
- create_output(wxs_file, input, output_absolute_path)
581
- end
582
- rescue Exception => e
583
- raise e
584
- ensure
585
- FileUtils.cp("#{dir}/#{wxs_file}", "#{output_absolute_path}.wxs") if(File.exists?("#{dir}/#{wxs_file}") && @debug)
586
- File.open("#{output_absolute_path}.log", 'w') { |f| f.puts(@logger) } if(@debug &!@logger.nil?)
587
- end
588
- end
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
- pdb_file = output_absolute_path.gsub(ext,'.wixpdb')
591
- FileUtils.rm(pdb_file) if(File.exists?(pdb_file))
595
+ pdb_file = output_absolute_path.gsub(ext,'.wixpdb')
596
+ FileUtils.rm(pdb_file) if(File.exists?(pdb_file))
592
597
 
593
- end_logger if(@debug)
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.99.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-05-23 00:00:00.000000000 Z
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