Skip to content

Commit

Permalink
Changed the Start property in WiXServiceControl back from optional to…
Browse files Browse the repository at this point in the history
… avoid breaking changes. Added a new Option "Never" to type InstallUninstall instead and handled the new option in WiXServiceControl for Start, Stop and Remove
  • Loading branch information
Stefan Lux committed Feb 3, 2016
1 parent 6de410e commit 2d46154
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/app/FakeLib/WiXHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ type InstallUninstall =
| Install
| Uninstall
| Both
| Never
override w.ToString() =
match w with
| Install -> "install"
| Uninstall -> "uninstall"
| Both -> "both"
| Never -> null

/// These are used in many methods for generating WiX nodes, regard them as booleans
type YesOrNo =
Expand All @@ -100,7 +102,7 @@ type WiXServiceControl =
Id : string
Name: string
Remove : InstallUninstall
Start : InstallUninstall option
Start : InstallUninstall
Stop : InstallUninstall
Wait : YesOrNo
}
Expand All @@ -109,9 +111,15 @@ type WiXServiceControl =
{
yield ("Id", w.Id)
yield ("Name", w.Name)
yield ("Remove", w.Remove.ToString())
if w.Start.IsSome then yield ("Start", w.Start.Value.ToString())
yield ("Stop", w.Stop.ToString())
match w.Remove with
| Never -> ()
| _ -> yield ("Remove", w.Remove.ToString())
match w.Start with
| Never -> ()
| _ -> yield ("Start", w.Start.ToString())
match w.Stop with
| Never -> ()
| _ -> yield ("Stop", w.Stop.ToString())
yield ("Wait", w.Wait.ToString())
}
override w.ToString() =
Expand All @@ -124,7 +132,7 @@ let WiXServiceControlDefaults =
Id = "ServiceControl"
Name = "Service"
Remove = Both
Start = Some(Both)
Start = Install
Stop = Both
Wait = Yes
}
Expand Down

0 comments on commit 2d46154

Please sign in to comment.