FAKE - F# Make


WiXHelper

Contains tasks to create msi installers using the WiX toolset

Nested types and modules

TypeDescription
WiXParams

WiX parameter type

Functions and values

Function or valueDescription
Candle parameters wixScript
Signature: parameters:WiXParams -> wixScript:string -> string

Runs the Candle tool on the given WiX script with the given parameters

compName comp
Signature: comp:string -> string
compRefName compRef
Signature: compRef:string -> string
dirName dir
Signature: dir:string -> string
getFilesAsWiXString files
Signature: files:seq<string> -> string

Creates WiX File tags from the given files

Light parameters outputFile wixObj
Signature: parameters:WiXParams -> outputFile:string -> wixObj:string -> unit

Runs the Light tool on the given WiX script with the given parameters

WiX setParams outputFile wixScript
Signature: setParams:(WiXParams -> WiXParams) -> outputFile:string -> wixScript:string -> unit

Uses the WiX tools Candle and Light to create an msi.

Parameters

  • setParams - Function used to manipulate the WiX default parameters.
  • outputFile - The msi output file path (given to Light).
  • wixScript - The path to a WiX script that will be used with Candle.

Sample

Target "BuildSetup" (fun _ ->
    // Copy all important files to the deploy directory
    !! (buildDir + "/**/*.dll")
      ++ (buildDir + "/**/*.exe")
      ++ (buildDir + "/**/*.config")
      |> Copy deployPrepDir 

    // replace tags in a template file in order to generate a WiX script
    let ALLFILES = fun _ -> true

    let replacements = [
        "@build.number@",if not isLocalBuild then buildVersion else "0.1.0.0"
        "@product.productcode@",System.Guid.NewGuid().ToString()
        "@HelpFiles@",getFilesAsWiXString helpFiles
        "@ScriptFiles@",getFilesAsWiXString scriptFiles
        "@icons@",wixDir ALLFILES true (directoryInfo(bundledDir @@ "icons"))]

    processTemplates replacements setupFiles

    // run the WiX tools
    WiX (fun p -> {p with ToolDirectory = WiXPath}) 
        setupFileName
        (setupBuildDir + "Setup.wxs.template")
)
wixComponentRefs directoryInfo
Signature: directoryInfo:DirectoryInfo -> string

Creates WiX ComponentRef tags from the given DirectoryInfo

WiXDefaults
Signature: WiXParams

Contains the WiX default parameters

wixDir fileFilter asSubDir directoryInfo
Signature: fileFilter:(FileInfo -> bool) -> asSubDir:bool -> directoryInfo:DirectoryInfo -> string

Creates recursive WiX directory and file tags from the given DirectoryInfo

wixFile fileInfo
Signature: fileInfo:FileInfo -> string

Creates a WiX File tag from the given FileInfo

Fork me on GitHub