require "securerandom" module Makit # 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 Wix def self.setup if (Makit::Environment.is_windows?) # test if dotnet is installed if !Makit::DotNet::is_installed? # !File.exist?(Makit::Environment.which("dotnet")) puts "dotnet does not appear to be installed" else # test if wix is already installed if !`dotnet tool list --global`.include?("wix") "dotnet tool install --global wix".run end puts " Wix version " + "#{Wix::version}".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) end else puts "Wix is not supported on non-Windows platforms" end end def self.version `wix --version`.strip.split("+").first end 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 "" f.puts "" end # create the Package.wxs file File.open("#{path}/Package.wxs", "w") do |f| f.puts "" f.puts " " #f.puts " " f.puts " " #f.puts " " #f.puts " " #f.puts " " f.puts " " f.puts "" end end end # class Wix end # module Makit # Package.wxs with File harvesting # # # # # # # # # # # # # # # # Components.wxs # # # # # # # # # # # #