diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Utilities/TestBA/TestBA.cs | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/Utilities/TestBA/TestBA.cs b/src/Utilities/TestBA/TestBA.cs index 2a4bd581..c68c2b61 100644 --- a/src/Utilities/TestBA/TestBA.cs +++ b/src/Utilities/TestBA/TestBA.cs | |||
| @@ -25,6 +25,7 @@ namespace WixToolset.Test.BA | |||
| 25 | 25 | ||
| 26 | private string updateBundlePath; | 26 | private string updateBundlePath; |
| 27 | 27 | ||
| 28 | private int redetectCount; | ||
| 28 | private int sleepDuringCache; | 29 | private int sleepDuringCache; |
| 29 | private int cancelCacheAtProgress; | 30 | private int cancelCacheAtProgress; |
| 30 | private int sleepDuringExecute; | 31 | private int sleepDuringExecute; |
| @@ -105,18 +106,14 @@ namespace WixToolset.Test.BA | |||
| 105 | this.dummyWindow.CreateControl(); | 106 | this.dummyWindow.CreateControl(); |
| 106 | this.appContext = new ApplicationContext(); | 107 | this.appContext = new ApplicationContext(); |
| 107 | 108 | ||
| 108 | int redetectCount = 0; | 109 | this.redetectCount = 0; |
| 109 | string redetect = this.ReadPackageAction(null, "RedetectCount"); | 110 | string redetect = this.ReadPackageAction(null, "RedetectCount"); |
| 110 | if (String.IsNullOrEmpty(redetect) || !Int32.TryParse(redetect, out redetectCount)) | 111 | if (String.IsNullOrEmpty(redetect) || !Int32.TryParse(redetect, out this.redetectCount)) |
| 111 | { | 112 | { |
| 112 | redetectCount = 0; | 113 | this.redetectCount = 0; |
| 113 | } | 114 | } |
| 114 | 115 | ||
| 115 | do | 116 | this.Engine.Detect(); |
| 116 | { | ||
| 117 | this.Engine.Detect(); | ||
| 118 | this.Log("Completed detection phase: {0} re-runs remaining", redetectCount); | ||
| 119 | } while (0 < redetectCount--); | ||
| 120 | 117 | ||
| 121 | Application.Run(this.appContext); | 118 | Application.Run(this.appContext); |
| 122 | this.Engine.Quit(this.result & 0xFFFF); // return plain old Win32 error, not HRESULT. | 119 | this.Engine.Quit(this.result & 0xFFFF); // return plain old Win32 error, not HRESULT. |
| @@ -125,7 +122,7 @@ namespace WixToolset.Test.BA | |||
| 125 | protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) | 122 | protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) |
| 126 | { | 123 | { |
| 127 | this.Log("OnDetectUpdateBegin"); | 124 | this.Log("OnDetectUpdateBegin"); |
| 128 | if ((LaunchAction.UpdateReplaceEmbedded == this.action)|(LaunchAction.UpdateReplace == this.action)) | 125 | if (LaunchAction.UpdateReplaceEmbedded == this.action || LaunchAction.UpdateReplace == this.action) |
| 129 | { | 126 | { |
| 130 | args.Skip = false; | 127 | args.Skip = false; |
| 131 | } | 128 | } |
| @@ -167,9 +164,18 @@ namespace WixToolset.Test.BA | |||
| 167 | { | 164 | { |
| 168 | this.result = args.Status; | 165 | this.result = args.Status; |
| 169 | 166 | ||
| 170 | if (Hresult.Succeeded(this.result) && (this.UpdateAvailable | (!((LaunchAction.UpdateReplaceEmbedded == this.action) | (LaunchAction.UpdateReplace == this.action))))) | 167 | if (Hresult.Succeeded(this.result) && |
| 171 | { | 168 | (this.UpdateAvailable || LaunchAction.UpdateReplaceEmbedded != this.action && LaunchAction.UpdateReplace != this.action)) |
| 172 | this.Engine.Plan(this.action); | 169 | { |
| 170 | if (this.redetectCount > 0) | ||
| 171 | { | ||
| 172 | this.Log("Completed detection phase: {0} re-runs remaining", this.redetectCount--); | ||
| 173 | this.Engine.Detect(); | ||
| 174 | } | ||
| 175 | else | ||
| 176 | { | ||
| 177 | this.Engine.Plan(this.action); | ||
| 178 | } | ||
| 173 | } | 179 | } |
| 174 | else | 180 | else |
| 175 | { | 181 | { |
