Class: Makit::Wix
- Inherits:
-
Object
- Object
- Makit::Wix
- Defined in:
- lib/makit/wix.rb
Overview
This class provide methods for working with the Nuget package cache
Example:
Makit::Directory.cache("Google.Protobuf", "3.27.2")
dotnet nuget locals all –list dotnet nuget locals all –clear
Class Method Summary collapse
Class Method Details
.setup ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/makit/wix.rb', line 16 def self.setup if Makit::Environment.is_windows? # test if dotnet is installed if Makit::DotNet.is_installed? # test if wix is already installed "dotnet tool install --global wix".run unless `dotnet tool list --global`.include?("wix") puts " Wix version #{Wix.version.to_s.colorize(:green)}" # display the link to https://wixtoolset.org/ puts " https://wixtoolset.org/".colorize(:green) # display the link to https://marketplace.visualstudio.com/items?itemName=FireGiant.FireGiantHeatWaveDev17 puts " https://marketplace.visualstudio.com/items?itemName=FireGiant.FireGiantHeatWaveDev17".colorize(:green) else # !File.exist?(Makit::Environment.which("dotnet")) puts "dotnet does not appear to be installed" end else puts "Wix is not supported on non-Windows platforms" end end |
.setup_package(name, path, files) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/makit/wix.rb', line 39 def self.setup_package(name, path, files) # create the path if it does not exist FileUtils.mkdir_p(path) unless File.directory?(path) # create the #{name}.wixproj file File.open("#{path}/#{name}.wixproj", "w") do |f| f.puts "<Project Sdk=\"WixToolset.Sdk/#{Wix.version}\">" f.puts "</Project>" end # create the Package.wxs file File.open("#{path}/Package.wxs", "w") do |f| f.puts "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">" f.puts " <Package Name=\"#{name}\" Manufacturer=\"Acme\" Version=\"0.0.0.0\" UpgradeCode=\"#{SecureRandom.uuid}\">" # f.puts " <MajorUpgrade DowngradeErrorMessage=\"!(loc.DowngradeError)\" />" f.puts " <Files Include=\"#{files}\" />" # f.puts " <Feature Id=\"Main\">" # f.puts " <ComponentGroupRef Id=\"Components\" />" # f.puts " </Feature>" f.puts " </Package>" f.puts "</Wix>" end end |
.version ⇒ Object
35 36 37 |
# File 'lib/makit/wix.rb', line 35 def self.version `wix --version`.strip.split("+").first end |