-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new more comfortable and intuitive types to WiXHelper, flagged old
ones obsolete and added example page
- Loading branch information
Florian Kroenert
authored and
Florian Kroenert
committed
Dec 15, 2015
1 parent
25ca241
commit b68aa9a
Showing
3 changed files
with
600 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Create WiX Setup | ||
|
||
If you often ship software to customers, it might be comfortable for you to install it using setups rather than manually deploying. | ||
FAKE provides you with support for creating MSI setups using the WiX Toolset (http://wixtoolset.org/). | ||
|
||
## Minimal working example | ||
|
||
Target "BuildWiXSetup" (fun _ -> | ||
// This defines, which files should be collected when running bulkComponentCreation | ||
let fileFilter = fun (file : FileInfo) -> | ||
if file.Extension = ".dll" || file.Extension = ".exe" || file.Extension = ".config" then | ||
true | ||
else | ||
false | ||
// Collect Files which should be shipped. Pass directory with your deployment output for deployDir | ||
let components = bulkComponentCreation fileFilter (DirectoryInfo deployDir) | ||
// Collect component references for usage in features | ||
let componentRefs = components |> Seq.map(fun comp -> comp.ToComponentRef()) | ||
|
||
let completeFeature = generateFeatureElement (fun f -> | ||
{f with | ||
Id = "Complete" | ||
Title = "Complete Feature" | ||
Level = 1 | ||
Description = "Installs all features" | ||
Components = componentRefs | ||
Display = Expand | ||
}) | ||
|
||
// Generates a predefined WiX template with placeholders which will be replaced in "FillInWiXScript" | ||
generateWiXScript "SetupTemplate.wxs" | ||
|
||
let WiXUIMondo = generateUIRef (fun f -> | ||
{f with | ||
Id = "WixUI_Mondo" | ||
}) | ||
|
||
let WiXUIError = generateUIRef (fun f -> | ||
{f with | ||
Id = "WixUI_ErrorProgressText" | ||
}) | ||
|
||
let MajorUpgrade = generateMajorUpgradeVersion( | ||
fun f -> | ||
{f with | ||
Schedule = MajorUpgradeSchedule.AfterInstallExecute | ||
DowngradeErrorMessage = "A later version is already installed, exiting." | ||
}) | ||
|
||
FillInWiXTemplate "" (fun f -> | ||
{f with | ||
// Guid which should be generated on every build | ||
ProductCode = Guid.NewGuid() | ||
ProductName = "Test Setup" | ||
Description = "Description of Test Setup" | ||
ProductLanguage = 1033 | ||
ProductVersion = "1.0.0" | ||
ProductPublisher = "YouOrYourCompany" | ||
// Set fixed upgrade guid, this should never change for this project! | ||
UpgradeGuid = WixProductUpgradeGuid | ||
MajorUpgrade = [MajorUpgrade] | ||
UIRefs = [WiXUIMondo; WiXUIError] | ||
ProgramFilesFolder = ProgramFiles32 | ||
Components = components | ||
BuildNumber = "Build number" | ||
Features = [completeFeature] | ||
}) | ||
|
||
// run the WiX tools | ||
WiX (fun p -> {p with ToolDirectory = WiXPath}) | ||
setupFileName | ||
@".\SetupTemplate.wxs" | ||
) | ||
|
||
## Further possibilities | ||
Besides just plainly shipping those files as setup you can also use the custom action and custom action execution elements to execute various commands before or after certain events during the installation. | ||
This gives you the possibility to for example install, uninstall, start or stop certain services when you need to. |
Oops, something went wrong.