Wix Burn 3.11-> 4 rc4 Burn Bootstrapper Application how to use Engine.Apply #7300
-
|
Due to lack of any documentation so far I came across this problem: Up until now I added a OnPlanComplete just like this: private void AfterPlanComplete(object sender, PlanCompleteEventArgs ea)
{
if (ea.Status >= 0)
{
Engine.Apply(IntPtr.Zero);
}
else
{
ReturnValue = BootstrapperReturnValue.PlanError;
Engine.Log(LogLevel.Error, $"Error during planning stage, error code {ea.Status}");
}
}which now gives me an error Ok, now I can get the UI Window handle somehow . But I only have a window handle when I am started with Full UI or with /Passive - due to no documentation so far, after looking at externalengine.cpp: HRESULT ExternalEngineApply(
__in BOOTSTRAPPER_ENGINE_CONTEXT* pEngineContext,
__in_opt const HWND hwndParent
)
{
HRESULT hr = S_OK;
BOOTSTRAPPER_ENGINE_ACTION* pAction = NULL;
ExitOnNull(hwndParent, hr, E_INVALIDARG, "BA passed NULL hwndParent to Apply.");
if (!::IsWindow(hwndParent))
{
ExitOnRootFailure(hr = E_INVALIDARG, "BA passed invalid hwndParent to Apply.");
}
pAction = (BOOTSTRAPPER_ENGINE_ACTION*)MemAlloc(sizeof(BOOTSTRAPPER_ENGINE_ACTION), TRUE);
ExitOnNull(pAction, hr, E_OUTOFMEMORY, "Failed to alloc BOOTSTRAPPER_ENGINE_ACTION");
pAction->dwMessage = WM_BURN_APPLY;
pAction->apply.hwndParent = hwndParent;
hr = EnqueueAction(pEngineContext, &pAction);
ExitOnFailure(hr, "Failed to enqueue apply action.");
LExit:
ReleaseMem(pAction);
return hr;
}what am I supposed to call Apply with in case of a silent installation? All the old examples that I found for wix3 used the IntPtr.Zero all the time. the TestBA.cs: protected override void Run()
{
this.dummyWindow = new Form();
this.windowHandle = this.dummyWindow.Handle;
this.Log("Running TestBA application");
this.wait.Set();
Application.Run();
}in the Wix4 just creates a new Form to get a dummy handle, is this how it is supposed to be handled in case of a silent installation? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
The documentation is at https://wixtoolset.org/docs/fourthree/faqs/ |
Beta Was this translation helpful? Give feedback.
The documentation is at https://wixtoolset.org/docs/fourthree/faqs/