aboutsummaryrefslogtreecommitdiff
path: root/src/test/burn/TestData/BAFunctionsTests
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/TestData/BAFunctionsTests')
-rw-r--r--src/test/burn/TestData/BAFunctionsTests/BafRelatedBundleVariableTesting/BafRelatedBundleVariableTesting.cpp35
-rw-r--r--src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wxs9
-rw-r--r--src/test/burn/TestData/BAFunctionsTests/BundleAv2/BundleAv2.wxs9
3 files changed, 23 insertions, 30 deletions
diff --git a/src/test/burn/TestData/BAFunctionsTests/BafRelatedBundleVariableTesting/BafRelatedBundleVariableTesting.cpp b/src/test/burn/TestData/BAFunctionsTests/BafRelatedBundleVariableTesting/BafRelatedBundleVariableTesting.cpp
index 01750b4b..ba559b05 100644
--- a/src/test/burn/TestData/BAFunctionsTests/BafRelatedBundleVariableTesting/BafRelatedBundleVariableTesting.cpp
+++ b/src/test/burn/TestData/BAFunctionsTests/BafRelatedBundleVariableTesting/BafRelatedBundleVariableTesting.cpp
@@ -29,37 +29,28 @@ public: //IBootstrapperApplication
29 29
30 hr = BalGetRelatedBundleVariable(wzBundleId, STRING_VARIABLE, &wzValue); 30 hr = BalGetRelatedBundleVariable(wzBundleId, STRING_VARIABLE, &wzValue);
31 31
32 ExitOnFailure(hr, "Failed to get related bundle string variable."); 32 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Retrieved related bundle variable with BAFunctions: AString = %ws, Error: 0x%x", wzValue, hr);
33
34 if (wzValue)
35 {
36 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Retrieved related bundle variable with BAFunctions: AString = %ws", wzValue);
37 }
38 33
39 hr = BalGetRelatedBundleVariable(wzBundleId, NUMBER_VARIABLE, &wzValue); 34 hr = BalGetRelatedBundleVariable(wzBundleId, NUMBER_VARIABLE, &wzValue);
40 35
41 if (wzValue) 36 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Retrieved related bundle variable with BAFunctions: ANumber = %ws, Error: 0x%x", wzValue, hr);
42 {
43 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Retrieved related bundle variable with BAFunctions: ANumber = %ws", wzValue);
44 }
45 37
46 hr = __super::OnDetectRelatedBundle(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, pfCancel); 38 hr = __super::OnDetectRelatedBundle(wzBundleId, relationType, wzBundleTag, fPerMachine, wzVersion, fMissingFromCache, pfCancel);
47 LExit: 39
48 ReleaseStr(wzValue); 40 ReleaseStr(wzValue);
49 return hr; 41 return hr;
50 } 42 }
43
51private: 44private:
52 45
53 46
54public: 47public:
55 // 48 //
56 // Constructor - initialize member variables. 49 // Constructor - initialize member variables.
57 // 50 //
58 CBafRelatedBundleVariableTesting( 51 CBafRelatedBundleVariableTesting(
59 __in HMODULE hModule, 52 __in HMODULE hModule
60 __in IBootstrapperEngine* pEngine, 53 ) : CBalBaseBAFunctions(hModule)
61 __in const BA_FUNCTIONS_CREATE_ARGS* pArgs
62 ) : CBalBaseBAFunctions(hModule, pEngine, pArgs)
63 { 54 {
64 } 55 }
65 56
@@ -82,21 +73,21 @@ HRESULT WINAPI CreateBAFunctions(
82{ 73{
83 HRESULT hr = S_OK; 74 HRESULT hr = S_OK;
84 CBafRelatedBundleVariableTesting* pBAFunctions = NULL; 75 CBafRelatedBundleVariableTesting* pBAFunctions = NULL;
85 IBootstrapperEngine* pEngine = NULL;
86 76
87 hr = BalInitializeFromCreateArgs(pArgs->pBootstrapperCreateArgs, &pEngine); 77 BalInitialize(pArgs->pEngine);
88 ExitOnFailure(hr, "Failed to initialize Bal.");
89 78
90 pBAFunctions = new CBafRelatedBundleVariableTesting(hModule, pEngine, pArgs); 79 pBAFunctions = new CBafRelatedBundleVariableTesting(hModule);
91 ExitOnNull(pBAFunctions, hr, E_OUTOFMEMORY, "Failed to create new CBafRelatedBundleVariableTesting object."); 80 ExitOnNull(pBAFunctions, hr, E_OUTOFMEMORY, "Failed to create new CBafRelatedBundleVariableTesting object.");
92 81
82 hr = pBAFunctions->OnCreate(pArgs->pEngine, pArgs->pCommand);
83 ExitOnFailure(hr, "Failed to create BA function");
84
93 pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc; 85 pResults->pfnBAFunctionsProc = BalBaseBAFunctionsProc;
94 pResults->pvBAFunctionsProcContext = pBAFunctions; 86 pResults->pvBAFunctionsProcContext = pBAFunctions;
95 pBAFunctions = NULL; 87 pBAFunctions = NULL;
96 88
97LExit: 89LExit:
98 ReleaseObject(pBAFunctions); 90 ReleaseObject(pBAFunctions);
99 ReleaseObject(pEngine);
100 91
101 return hr; 92 return hr;
102} 93}
diff --git a/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wxs b/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wxs
index 4aba7a2f..431ef3d1 100644
--- a/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wxs
+++ b/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wxs
@@ -1,15 +1,16 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> 3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
5 <Fragment> 4 <Fragment>
6 <BootstrapperApplication> 5 <PayloadGroup Id="override ExtraPayloads">
7 <Payload SourceFile="$(var.BafRelatedBundleVariableTesting.TargetPath)" bal:BAFunctions="yes" /> 6 <Payload SourceFile="$(var.BafRelatedBundleVariableTesting.TargetPath)" bal:BAFunctions="yes" />
8 </BootstrapperApplication> 7 </PayloadGroup>
8
9 <PackageGroup Id="BundlePackages"> 9 <PackageGroup Id="BundlePackages">
10 <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" /> 10 <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv1.TargetPath)" />
11 </PackageGroup> 11 </PackageGroup>
12
12 <Variable Name="ANumber" bal:Overridable="yes" Value="42" Persisted="yes" /> 13 <Variable Name="ANumber" bal:Overridable="yes" Value="42" Persisted="yes" />
13 <Variable Name="AString" bal:Overridable="yes" Value="This is a test" Persisted="yes" /> 14 <Variable Name="AString" bal:Overridable="yes" Value="This is a test" Persisted="yes" />
14 </Fragment> 15 </Fragment>
15</Wix> 16</Wix>
diff --git a/src/test/burn/TestData/BAFunctionsTests/BundleAv2/BundleAv2.wxs b/src/test/burn/TestData/BAFunctionsTests/BundleAv2/BundleAv2.wxs
index 8608512c..9c512899 100644
--- a/src/test/burn/TestData/BAFunctionsTests/BundleAv2/BundleAv2.wxs
+++ b/src/test/burn/TestData/BAFunctionsTests/BundleAv2/BundleAv2.wxs
@@ -1,15 +1,16 @@
1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> 1<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
2 2
3
4<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> 3<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
5 <Fragment> 4 <Fragment>
6 <BootstrapperApplication> 5 <PayloadGroup Id="override ExtraPayloads">
7 <Payload SourceFile="$(var.BafRelatedBundleVariableTesting.TargetPath)" bal:BAFunctions="yes" /> 6 <Payload SourceFile="$(var.BafRelatedBundleVariableTesting.TargetPath)" bal:BAFunctions="yes" />
8 </BootstrapperApplication> 7 </PayloadGroup>
8
9 <PackageGroup Id="BundlePackages"> 9 <PackageGroup Id="BundlePackages">
10 <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv2.TargetPath)" /> 10 <MsiPackage Id="PackageA" SourceFile="$(var.PackageAv2.TargetPath)" />
11 </PackageGroup> 11 </PackageGroup>
12
12 <Variable Name="ANumber" bal:Overridable="yes" Value="4242" Persisted="yes" /> 13 <Variable Name="ANumber" bal:Overridable="yes" Value="4242" Persisted="yes" />
13 <Variable Name="AString" bal:Overridable="yes" Value="This is a test v2" Persisted="yes" /> 14 <Variable Name="AString" bal:Overridable="yes" Value="This is a test v2" Persisted="yes" />
14 </Fragment> 15 </Fragment>
15</Wix> 16</Wix>