diff options
author | Rob Mensching <rob@firegiant.com> | 2019-05-12 14:41:26 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2019-05-12 23:25:04 -0700 |
commit | c9c347bfb659878ce43c60daadac490e230ee17a (patch) | |
tree | 6fafc3f635bdbe474d6f9988e2c3d4fa802f5228 | |
parent | 32b691d23c76fbe12790808d65b0b615640ebebe (diff) | |
download | wix-c9c347bfb659878ce43c60daadac490e230ee17a.tar.gz wix-c9c347bfb659878ce43c60daadac490e230ee17a.tar.bz2 wix-c9c347bfb659878ce43c60daadac490e230ee17a.zip |
Fix inscript CA bit handling
7 files changed, 88 insertions, 3 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index 1b29fc9c..4b02b3aa 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs | |||
@@ -250,10 +250,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
250 | private void AddCustomActionTuple(CustomActionTuple tuple, Output output) | 250 | private void AddCustomActionTuple(CustomActionTuple tuple, Output output) |
251 | { | 251 | { |
252 | var type = tuple.Win64 ? WindowsInstallerConstants.MsidbCustomActionType64BitScript : 0; | 252 | var type = tuple.Win64 ? WindowsInstallerConstants.MsidbCustomActionType64BitScript : 0; |
253 | type |= tuple.TSAware ? WindowsInstallerConstants.MsidbCustomActionTypeTSAware : 0; | ||
254 | type |= tuple.Impersonate ? 0 : WindowsInstallerConstants.MsidbCustomActionTypeNoImpersonate; | ||
255 | type |= tuple.IgnoreResult ? WindowsInstallerConstants.MsidbCustomActionTypeContinue : 0; | 253 | type |= tuple.IgnoreResult ? WindowsInstallerConstants.MsidbCustomActionTypeContinue : 0; |
256 | type |= tuple.Hidden ? 0 : WindowsInstallerConstants.MsidbCustomActionTypeHideTarget; | 254 | type |= tuple.Hidden ? WindowsInstallerConstants.MsidbCustomActionTypeHideTarget : 0; |
257 | type |= tuple.Async ? WindowsInstallerConstants.MsidbCustomActionTypeAsync : 0; | 255 | type |= tuple.Async ? WindowsInstallerConstants.MsidbCustomActionTypeAsync : 0; |
258 | type |= CustomActionExecutionType.FirstSequence == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeFirstSequence : 0; | 256 | type |= CustomActionExecutionType.FirstSequence == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeFirstSequence : 0; |
259 | type |= CustomActionExecutionType.OncePerProcess == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeOncePerProcess : 0; | 257 | type |= CustomActionExecutionType.OncePerProcess == tuple.ExecutionType ? WindowsInstallerConstants.MsidbCustomActionTypeOncePerProcess : 0; |
@@ -270,6 +268,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
270 | type |= CustomActionTargetType.JScript == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeJScript : 0; | 268 | type |= CustomActionTargetType.JScript == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeJScript : 0; |
271 | type |= CustomActionTargetType.VBScript == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeVBScript : 0; | 269 | type |= CustomActionTargetType.VBScript == tuple.TargetType ? WindowsInstallerConstants.MsidbCustomActionTypeVBScript : 0; |
272 | 270 | ||
271 | if (WindowsInstallerConstants.MsidbCustomActionTypeInScript == (type & WindowsInstallerConstants.MsidbCustomActionTypeInScript)) | ||
272 | { | ||
273 | type |= tuple.Impersonate ? 0 : WindowsInstallerConstants.MsidbCustomActionTypeNoImpersonate; | ||
274 | type |= tuple.TSAware ? WindowsInstallerConstants.MsidbCustomActionTypeTSAware : 0; | ||
275 | } | ||
276 | |||
273 | var table = output.EnsureTable(this.TableDefinitions["CustomAction"]); | 277 | var table = output.EnsureTable(this.TableDefinitions["CustomAction"]); |
274 | var row = table.CreateRow(tuple.SourceLineNumbers); | 278 | var row = table.CreateRow(tuple.SourceLineNumbers); |
275 | row[0] = tuple.Id.Id; | 279 | row[0] = tuple.Id.Id; |
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs index f8f9180f..3e66ad0a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiFixture.cs | |||
@@ -539,6 +539,38 @@ namespace WixToolsetTest.CoreIntegration | |||
539 | } | 539 | } |
540 | } | 540 | } |
541 | 541 | ||
542 | [Fact] | ||
543 | public void CanBuildSetProperty() | ||
544 | { | ||
545 | var folder = TestData.Get(@"TestData\SetProperty"); | ||
546 | |||
547 | using (var fs = new DisposableFileSystem()) | ||
548 | { | ||
549 | var baseFolder = fs.GetFolder(); | ||
550 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
551 | |||
552 | var result = WixRunner.Execute(new[] | ||
553 | { | ||
554 | "build", | ||
555 | Path.Combine(folder, "Package.wxs"), | ||
556 | Path.Combine(folder, "PackageComponents.wxs"), | ||
557 | "-loc", Path.Combine(folder, "Package.en-us.wxl"), | ||
558 | "-bindpath", Path.Combine(folder, "data"), | ||
559 | "-intermediateFolder", intermediateFolder, | ||
560 | "-o", Path.Combine(baseFolder, @"bin\test.msi") | ||
561 | }); | ||
562 | |||
563 | result.AssertSuccess(); | ||
564 | |||
565 | var pdb = Pdb.Load(Path.Combine(baseFolder, @"bin\test.wixpdb"), false); | ||
566 | var caRows = pdb.Output.Tables["CustomAction"].Rows.Single(); | ||
567 | Assert.Equal("SetINSTALLLOCATION", caRows.FieldAsString(0)); | ||
568 | Assert.Equal("51", caRows.FieldAsString(1)); | ||
569 | Assert.Equal("INSTALLLOCATION", caRows.FieldAsString(2)); | ||
570 | Assert.Equal("[INSTALLFOLDER]", caRows.FieldAsString(3)); | ||
571 | } | ||
572 | } | ||
573 | |||
542 | [Fact(Skip = "Test demonstrates failure")] | 574 | [Fact(Skip = "Test demonstrates failure")] |
543 | public void CanBuildVersionIndependentProgId() | 575 | public void CanBuildVersionIndependentProgId() |
544 | { | 576 | { |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/Package.en-us.wxl b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/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/SetProperty/Package.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/Package.wxs new file mode 100644 index 00000000..eb907569 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/Package.wxs | |||
@@ -0,0 +1,23 @@ | |||
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 | |||
13 | <SetProperty Id="INSTALLLOCATION" Value="[INSTALLFOLDER]" After="CostFinalize" /> | ||
14 | </Product> | ||
15 | |||
16 | <Fragment> | ||
17 | <Directory Id="TARGETDIR" Name="SourceDir"> | ||
18 | <Directory Id="ProgramFilesFolder"> | ||
19 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
20 | </Directory> | ||
21 | </Directory> | ||
22 | </Fragment> | ||
23 | </Wix> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/PackageComponents.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/PackageComponents.wxs new file mode 100644 index 00000000..e26c4509 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/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/SetProperty/data/test.txt b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/data/test.txt new file mode 100644 index 00000000..cd0db0e1 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SetProperty/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 4ea650f9..03f67b19 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -48,6 +48,10 @@ | |||
48 | <Content Include="TestData\ComplexExampleExtension\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 48 | <Content Include="TestData\ComplexExampleExtension\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
49 | <Content Include="TestData\ComplexExampleExtension\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 49 | <Content Include="TestData\ComplexExampleExtension\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |
50 | <Content Include="TestData\ComplexExampleExtension\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | 50 | <Content Include="TestData\ComplexExampleExtension\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> |
51 | <Content Include="TestData\SetProperty\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | ||
52 | <Content Include="TestData\SetProperty\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | ||
53 | <Content Include="TestData\SetProperty\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
54 | <Content Include="TestData\SetProperty\PackageComponents.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
51 | <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 55 | <Content Include="TestData\SingleFile\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
52 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> | 56 | <Content Include="TestData\SingleFile\Package.en-us.wxl" CopyToOutputDirectory="PreserveNewest" /> |
53 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> | 57 | <Content Include="TestData\SingleFile\Package.wxs" CopyToOutputDirectory="PreserveNewest" /> |