diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-07 11:20:36 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-07 20:23:00 +1000 |
commit | 7c04bfdb54ccf5b4b67995c9715a3f7f9e454206 (patch) | |
tree | a40349dc7eb7ef1a56b1c30e742530821e1bf4e1 /src/test | |
parent | 59ffa86b7d62ddc52ec813fb65c47f812aeded66 (diff) | |
download | wix-7c04bfdb54ccf5b4b67995c9715a3f7f9e454206.tar.gz wix-7c04bfdb54ccf5b4b67995c9715a3f7f9e454206.tar.bz2 wix-7c04bfdb54ccf5b4b67995c9715a3f7f9e454206.zip |
Fix bugs when compiling UI.wixext
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | 41 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | 82 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/Package.wxs | 21 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs | 10 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/data/test.txt | 1 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/TextStyle/SizeLocalized.en-us.wxl (renamed from src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/Package.en-us.wxl) | 0 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/TestData/TextStyle/SizeLocalized.wxs | 12 | ||||
-rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | 5 |
8 files changed, 103 insertions, 69 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index ad24f346..64b3fa93 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
@@ -214,47 +214,6 @@ namespace WixToolsetTest.CoreIntegration | |||
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||
217 | [Fact(Skip = "Currently fails")] | ||
218 | public void CanBuildDialogsInInstallUISequence() | ||
219 | { | ||
220 | var folder = TestData.Get(@"TestData\DialogsInInstallUISequence"); | ||
221 | |||
222 | using (var fs = new DisposableFileSystem()) | ||
223 | { | ||
224 | var baseFolder = fs.GetFolder(); | ||
225 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
226 | |||
227 | var result = WixRunner.Execute(new[] | ||
228 | { | ||
229 | "build", | ||
230 | Path.Combine(folder, "Package.wxs"), | ||
231 | Path.Combine(folder, "PackageComponents.wxs"), | ||
232 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
233 | "-bindpath", Path.Combine(folder, "data"), | ||
234 | "-intermediateFolder", intermediateFolder, | ||
235 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
236 | }); | ||
237 | |||
238 | result.AssertSuccess(); | ||
239 | |||
240 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.msi"))); | ||
241 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\test.wixpdb"))); | ||
242 | Assert.True(File.Exists(Path.Combine(baseFolder, @"bin\MsiPackage\test.txt"))); | ||
243 | |||
244 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | ||
245 | var section = intermediate.Sections.Single(); | ||
246 | |||
247 | var textStyle = section.Tuples.OfType<TextStyleTuple>().Single(); | ||
248 | Assert.Equal("Tahoma", textStyle.FaceName); | ||
249 | Assert.Equal(8, textStyle.Size); | ||
250 | |||
251 | var installUIActions = section.Tuples.OfType<WixActionTuple>() | ||
252 | .Where(t => t.SequenceTable == SequenceTable.InstallUISequence) | ||
253 | .ToList(); | ||
254 | Assert.Equal(10, installUIActions.Count); | ||
255 | } | ||
256 | } | ||
257 | |||
258 | [Fact] | 217 | [Fact] |
259 | public void CanBuildWithErrorTable() | 218 | public void CanBuildWithErrorTable() |
260 | { | 219 | { |
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 9462c4ff..bb44395f 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
@@ -255,6 +255,54 @@ namespace WixToolsetTest.CoreIntegration | |||
255 | } | 255 | } |
256 | 256 | ||
257 | [Fact] | 257 | [Fact] |
258 | public void PopulatesControlTables() | ||
259 | { | ||
260 | var folder = TestData.Get(@"TestData"); | ||
261 | |||
262 | using (var fs = new DisposableFileSystem()) | ||
263 | { | ||
264 | var baseFolder = fs.GetFolder(); | ||
265 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
266 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
267 | |||
268 | var result = WixRunner.Execute(new[] | ||
269 | { | ||
270 | "build", | ||
271 | Path.Combine(folder, "DialogsInInstallUISequence", "PackageComponents.wxs"), | ||
272 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
273 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
274 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
275 | "-intermediateFolder", intermediateFolder, | ||
276 | "-o", msiPath, | ||
277 | }); | ||
278 | |||
279 | result.AssertSuccess(); | ||
280 | |||
281 | Assert.True(File.Exists(msiPath)); | ||
282 | |||
283 | var results = Query.QueryDatabase(msiPath, new[] { "CheckBox", "Control", "InstallUISequence" }); | ||
284 | Assert.Equal(new[] | ||
285 | { | ||
286 | "CheckBox:WIXUI_EXITDIALOGOPTIONALCHECKBOX\t1", | ||
287 | "Control:FirstDialog\tHeader\tText\t0\t13\t90\t13\t3\tFirstDialogHeader\tTitle\t\t", | ||
288 | "Control:FirstDialog\tTitle\tText\t0\t0\t90\t13\t3\tFirstDialogTitle\tHeader\t\t", | ||
289 | "Control:SecondDialog\tOptionalCheckBox\tCheckBox\t0\t13\t100\t40\t2\t[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]\tTitle\t\t", | ||
290 | "Control:SecondDialog\tTitle\tText\t0\t0\t90\t13\t3\tSecondDialogTitle\tOptionalCheckBox\t\t", | ||
291 | "InstallUISequence:CostFinalize\t\t1000", | ||
292 | "InstallUISequence:CostInitialize\t\t800", | ||
293 | "InstallUISequence:ExecuteAction\t\t1300", | ||
294 | "InstallUISequence:FileCost\t\t900", | ||
295 | "InstallUISequence:FindRelatedProducts\t\t25", | ||
296 | "InstallUISequence:FirstDialog\tInstalled AND PATCH\t1298", | ||
297 | "InstallUISequence:LaunchConditions\t\t100", | ||
298 | "InstallUISequence:MigrateFeatureStates\t\t1200", | ||
299 | "InstallUISequence:SecondDialog\tNOT Installed\t1299", | ||
300 | "InstallUISequence:ValidateProductID\t\t700", | ||
301 | }, results); | ||
302 | } | ||
303 | } | ||
304 | |||
305 | [Fact] | ||
258 | public void PopulatesCreateFolderTableForNullKeypathComponents() | 306 | public void PopulatesCreateFolderTableForNullKeypathComponents() |
259 | { | 307 | { |
260 | var folder = TestData.Get(@"TestData\Components"); | 308 | var folder = TestData.Get(@"TestData\Components"); |
@@ -982,6 +1030,40 @@ namespace WixToolsetTest.CoreIntegration | |||
982 | } | 1030 | } |
983 | } | 1031 | } |
984 | 1032 | ||
1033 | [Fact(Skip = "Test demonstrates failure")] | ||
1034 | public void PopulatesTextStyleTableWhenSizeIsLocalized() | ||
1035 | { | ||
1036 | var folder = TestData.Get(@"TestData"); | ||
1037 | |||
1038 | using (var fs = new DisposableFileSystem()) | ||
1039 | { | ||
1040 | var baseFolder = fs.GetFolder(); | ||
1041 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
1042 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
1043 | |||
1044 | var result = WixRunner.Execute(new[] | ||
1045 | { | ||
1046 | "build", | ||
1047 | Path.Combine(folder, "TextStyle", "SizeLocalized.wxs"), | ||
1048 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
1049 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
1050 | "-loc", Path.Combine(folder, "TextStyle", "SizeLocalized.en-us.wxl"), | ||
1051 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
1052 | "-intermediateFolder", intermediateFolder, | ||
1053 | "-o", msiPath, | ||
1054 | }); | ||
1055 | |||
1056 | result.AssertSuccess(); | ||
1057 | |||
1058 | Assert.True(File.Exists(msiPath)); | ||
1059 | var results = Query.QueryDatabase(msiPath, new[] { "TextStyle" }); | ||
1060 | Assert.Equal(new[] | ||
1061 | { | ||
1062 | "TextStyle:CustomFont\tTahoma\t8\t\t", | ||
1063 | }, results); | ||
1064 | } | ||
1065 | } | ||
1066 | |||
985 | [Fact] | 1067 | [Fact] |
986 | public void PopulatesTypeLibTableWhenLanguageIsZero() | 1068 | public void PopulatesTypeLibTableWhenLanguageIsZero() |
987 | { | 1069 | { |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/Package.wxs deleted file mode 100644 index 6da3dcbe..00000000 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/Package.wxs +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Product Id="*" Name="MsiPackage" Codepage="1252" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
4 | <Package InstallerVersion="200" Compressed="no" InstallScope="perMachine" /> | ||
5 | |||
6 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
7 | <MediaTemplate /> | ||
8 | |||
9 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
10 | <ComponentGroupRef Id="ProductComponents" /> | ||
11 | </Feature> | ||
12 | </Product> | ||
13 | |||
14 | <Fragment> | ||
15 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
16 | <Directory Id="ProgramFilesFolder"> | ||
17 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
18 | </Directory> | ||
19 | </Directory> | ||
20 | </Fragment> | ||
21 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs index 724c46ed..1101d901 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/PackageComponents.wxs | |||
@@ -2,17 +2,21 @@ | |||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
3 | <Fragment> | 3 | <Fragment> |
4 | <UI Id="CustomDialog"> | 4 | <UI Id="CustomDialog"> |
5 | <!-- TODO: compiler can't handle loc strings for number fields --> | ||
6 | <TextStyle Id="CustomFont" FaceName="!(loc.CustomFontName)" Size="!(loc.CustomFontSize)" /> | ||
7 | <Dialog Id="FirstDialog" Width="100" Height="100"> | 5 | <Dialog Id="FirstDialog" Width="100" Height="100"> |
8 | <Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="FirstDialogTitle" /> | 6 | <Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="FirstDialogTitle" /> |
7 | <Control Id="Header" Type="Text" X="0" Y="13" Width="90" Height="13" TabSkip="no" Text="FirstDialogHeader"> | ||
8 | <Condition Action="hide">Installed</Condition> | ||
9 | <Condition Action="disable">Installed</Condition> | ||
10 | </Control> | ||
9 | </Dialog> | 11 | </Dialog> |
10 | <Dialog Id="SecondDialog" Width="100" Height="100"> | 12 | <Dialog Id="SecondDialog" Width="100" Height="100"> |
11 | <Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="SecondDialogTitle" /> | 13 | <Control Id="Title" Type="Text" X="0" Y="0" Width="90" Height="13" TabSkip="no" Text="SecondDialogTitle" /> |
14 | <Control Id="OptionalCheckBox" Type="CheckBox" X="0" Y="13" Width="100" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]"> | ||
15 | <Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed</Condition> | ||
16 | </Control> | ||
12 | </Dialog> | 17 | </Dialog> |
13 | 18 | ||
14 | <InstallUISequence> | 19 | <InstallUISequence> |
15 | <!-- TODO: overriding this currently causes a duplicate symbol error --> | ||
16 | <Show Dialog="SecondDialog" Before="FirstDialog" Overridable="yes">NOT Installed</Show> | 20 | <Show Dialog="SecondDialog" Before="FirstDialog" Overridable="yes">NOT Installed</Show> |
17 | </InstallUISequence> | 21 | </InstallUISequence> |
18 | </UI> | 22 | </UI> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/data/test.txt deleted file mode 100644 index cd0db0e1..00000000 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/data/test.txt +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | This is test.txt. \ No newline at end of file | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/TextStyle/SizeLocalized.en-us.wxl index 77d46861..77d46861 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/DialogsInInstallUISequence/Package.en-us.wxl +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/TextStyle/SizeLocalized.en-us.wxl | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/TextStyle/SizeLocalized.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/TextStyle/SizeLocalized.wxs new file mode 100644 index 00000000..a591fdd9 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/TextStyle/SizeLocalized.wxs | |||
@@ -0,0 +1,12 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
3 | <Fragment> | ||
4 | <ComponentGroup Id="ProductComponents"> | ||
5 | <ComponentGroupRef Id="MinimalComponentGroup"></ComponentGroupRef> | ||
6 | </ComponentGroup> | ||
7 | |||
8 | <UI Id="CustomUI"> | ||
9 | <TextStyle Id="CustomFont" FaceName="!(loc.CustomFontName)" Size="!(loc.CustomFontSize)" /> | ||
10 | </UI> | ||
11 | </Fragment> | ||
12 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index dbc9357c..13611770 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -34,9 +34,6 @@ | |||
34 | <Content Include="TestData\CustomAction\UnscheduledCustomAction.wxs" CopyToOutputDirectory="PreserveNewest" /> | 34 | <Content Include="TestData\CustomAction\UnscheduledCustomAction.wxs" CopyToOutputDirectory="PreserveNewest" /> |
35 | <Content Include="TestData\CustomTable\CustomTable.wxs" CopyToOutputDirectory="PreserveNewest" /> | 35 | <Content Include="TestData\CustomTable\CustomTable.wxs" CopyToOutputDirectory="PreserveNewest" /> |
36 | <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" /> | 36 | <Content Include="TestData\DefaultDir\DefaultDir.wxs" CopyToOutputDirectory="PreserveNewest" /> |
37 | <Content Include="TestData\DialogsInInstallUISequence\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
38 | <Content Include="TestData\DialogsInInstallUISequence\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
39 | <Content Include="TestData\DialogsInInstallUISequence\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
40 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 37 | <Content Include="TestData\DialogsInInstallUISequence\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
41 | <Content Include="TestData\EnsureTable\EnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" /> | 38 | <Content Include="TestData\EnsureTable\EnsureTable.wxs" CopyToOutputDirectory="PreserveNewest" /> |
42 | <Content Include="TestData\Environment\Environment.wxs" CopyToOutputDirectory="PreserveNewest" /> | 39 | <Content Include="TestData\Environment\Environment.wxs" CopyToOutputDirectory="PreserveNewest" /> |
@@ -157,6 +154,8 @@ | |||
157 | <Content Include="TestData\OverridableActions\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 154 | <Content Include="TestData\OverridableActions\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
158 | <Content Include="TestData\OverridableActions\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 155 | <Content Include="TestData\OverridableActions\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
159 | <Content Include="TestData\TextStyle\ColorNull.wxs" CopyToOutputDirectory="PreserveNewest" /> | 156 | <Content Include="TestData\TextStyle\ColorNull.wxs" CopyToOutputDirectory="PreserveNewest" /> |
157 | <Content Include="TestData\TextStyle\SizeLocalized.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
158 | <Content Include="TestData\TextStyle\SizeLocalized.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
160 | <Content Include="TestData\TypeLib\Language0.wxs" CopyToOutputDirectory="PreserveNewest" /> | 159 | <Content Include="TestData\TypeLib\Language0.wxs" CopyToOutputDirectory="PreserveNewest" /> |
161 | <Content Include="TestData\Wixipl\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 160 | <Content Include="TestData\Wixipl\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
162 | <Content Include="TestData\Wixipl\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 161 | <Content Include="TestData\Wixipl\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |