diff options
Diffstat (limited to 'src')
6 files changed, 90 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs index 1ce445e8..1b7a18cf 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs | |||
| @@ -209,6 +209,42 @@ namespace WixToolsetTest.CoreIntegration | |||
| 209 | } | 209 | } |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | [Fact] | ||
| 213 | public void CanBuildManualUpgrade() | ||
| 214 | { | ||
| 215 | var folder = TestData.Get(@"TestData\ManualUpgrade"); | ||
| 216 | |||
| 217 | using (var fs = new DisposableFileSystem()) | ||
| 218 | { | ||
| 219 | var intermediateFolder = fs.GetFolder(); | ||
| 220 | |||
| 221 | var program = new Program(); | ||
| 222 | var result = program.Run(new WixToolsetServiceProvider(), new[] | ||
| 223 | { | ||
| 224 | "build", | ||
| 225 | Path.Combine(folder, "Package.wxs"), | ||
| 226 | Path.Combine(folder, "PackageComponents.wxs"), | ||
| 227 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
| 228 | "-bindpath", Path.Combine(folder, "data"), | ||
| 229 | "-intermediateFolder", intermediateFolder, | ||
| 230 | "-o", Path.Combine(intermediateFolder, @"bin\test.msi") | ||
| 231 | }); | ||
| 232 | |||
| 233 | Assert.Equal(0, result); | ||
| 234 | |||
| 235 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.msi"))); | ||
| 236 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\test.wixpdb"))); | ||
| 237 | Assert.True(File.Exists(Path.Combine(intermediateFolder, @"bin\MsiPackage\test.txt"))); | ||
| 238 | |||
| 239 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"bin\test.wir")); | ||
| 240 | var section = intermediate.Sections.Single(); | ||
| 241 | |||
| 242 | var wixFile = section.Tuples.OfType<WixFileTuple>().Single(); | ||
| 243 | Assert.Equal(Path.Combine(folder, @"data\test.txt"), wixFile[WixFileTupleFields.Source].AsPath().Path); | ||
| 244 | Assert.Equal(@"test.txt", wixFile[WixFileTupleFields.Source].PreviousValue.AsPath().Path); | ||
| 245 | } | ||
| 246 | } | ||
| 247 | |||
| 212 | [Fact(Skip = "Not implemented yet.")] | 248 | [Fact(Skip = "Not implemented yet.")] |
| 213 | public void CanBuildInstanceTransform() | 249 | public void CanBuildInstanceTransform() |
| 214 | { | 250 | { |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/Package.en-us.wxl | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <!-- | ||
| 4 | This file contains the declaration of all the localizable strings. | ||
| 5 | --> | ||
| 6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
| 7 | |||
| 8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
| 9 | <String Id="FeatureTitle">MsiPackage</String> | ||
| 10 | |||
| 11 | </WixLocalization> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/Package.wxs new file mode 100644 index 00000000..d674eb59 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/Package.wxs | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Product Id="*" Name="MsiPackage" 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 | <Upgrade Id="01120000-00E0-0000-0000-0000000FF1CE"> | ||
| 7 | <UpgradeVersion ExcludeLanguages="no" IgnoreRemoveFailure="yes" IncludeMaximum="no" IncludeMinimum="yes" Maximum="13.0.0" Minimum="12.0.0" OnlyDetect="no" Property="BLAHBLAHBLAH" /> | ||
| 8 | </Upgrade> | ||
| 9 | |||
| 10 | <InstallExecuteSequence> | ||
| 11 | <RemoveExistingProducts After="InstallValidate" /> | ||
| 12 | </InstallExecuteSequence> | ||
| 13 | |||
| 14 | <MediaTemplate /> | ||
| 15 | |||
| 16 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 17 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 18 | </Feature> | ||
| 19 | </Product> | ||
| 20 | |||
| 21 | <Fragment> | ||
| 22 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
| 23 | <Directory Id="ProgramFilesFolder"> | ||
| 24 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 25 | </Directory> | ||
| 26 | </Directory> | ||
| 27 | </Fragment> | ||
| 28 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/PackageComponents.wxs | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 3 | <Fragment> | ||
| 4 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 5 | <Component> | ||
| 6 | <File Source="test.txt" /> | ||
| 7 | </Component> | ||
| 8 | </ComponentGroup> | ||
| 9 | </Fragment> | ||
| 10 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/ManualUpgrade/data/test.txt | |||
| @@ -0,0 +1 @@ | |||
| This is test.txt. \ No newline at end of file | |||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index d33589a2..e4c2713c 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
| @@ -31,6 +31,10 @@ | |||
| 31 | <Content Include="TestData\MultiFileCompressed\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 31 | <Content Include="TestData\MultiFileCompressed\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
| 32 | <Content Include="TestData\MultiFileCompressed\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 32 | <Content Include="TestData\MultiFileCompressed\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 33 | <Content Include="TestData\MultiFileCompressed\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 33 | <Content Include="TestData\MultiFileCompressed\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
| 34 | <Content Include="TestData\ManualUpgrade\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
| 35 | <Content Include="TestData\ManualUpgrade\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
| 36 | <Content Include="TestData\ManualUpgrade\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 37 | <Content Include="TestData\ManualUpgrade\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
| 34 | </ItemGroup> | 38 | </ItemGroup> |
| 35 | 39 | ||
| 36 | <ItemGroup> | 40 | <ItemGroup> |
