-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom Wizard-like Installer to Bundle / Burn Installer #1554
Comments
If you are talking about MSI UI that it displayed from the bootstrapper exe then you need to set var bundle = new Bundle("My Product Bundle",
new MsiPackage(productMsi)
{
Id = "MyProductPackageId",
DisplayInternalUI = true
}); |
hiho Oleg, unfortunatelly not. I have to use custom Bootstrapper UI for MSI , case from bundle UI to msi package where in UI only reflected installer progress , similar to one of your example UI for Bundle. I just , at moment, cant figure out, how to tell bundle use my custom ui. MSI has publc property , that can only be started from exe. BUT all my efforts to add my custom UI , are failed, misserably. Bundle doesnt want use it. In MSI i can add assembly to use theme or UI, but not in bundle. |
I think I might be missing something. Are you trying to create a boostrapper with the stock UI that is installing an MSI that has custom (non-stock) UI? |
sorry, i dont write clearly. my mistake.
I try second part. i try to add my project. Pls, look at it, if you had some time. |
Unfortunatelly, you have no good way achieving this. WiX4 does not provide simple unified way of controllong MSI internal UI. Thus public ManagedBA(mba.IEngine engine, mba.IBootstrapperCommand command) : base(engine)
{
this.Command = command;
this.PlanMsiPackage += (s, e) =>
{
if (e.PackageId == "MyProductPackageId")
{
e.UiLevel = (e.Action == ActionState.Uninstall) ?
INSTALLUILEVEL.ProgressOnly :
INSTALLUILEVEL.Full;
}
};
} The guidance is captured here. I have attached the sample too. Though in case of "MSI custom UI", to my disbelieve, the BA is shows the msi UI but the stock one instead of the custom one. Even though executing msi alone shows the correct custom UI. Meaning that the technique that I learned from WiX team with such difficulties works only partially (for msi stock UI only). I tested your scenario before the first release of WixSharp wix4 stream and I was under impression that it worked. But I have to accept that it is can only be explained by the recent changes in wix4 or by me mistakenly interpreting msi stock UI as custom one, meaning that wix4 never worked in the first place. I suggest you test this work around ( If indeed it is a problem with WiX or the way we are using it, the chances of fixing it are very low. It's very unlikely asking WiX team for explanations will help. At least if I ask :) As a plan be you can have a look at the work around that achieves the desired result reliably but it is rather unorthodox. |
Now NSIS looks more and more attractive :) |
morning, thanks again @oleg-shilo for explanation. I did not much with NSIS Bootstrapper and WixToolset / WixSharp. |
I don't know. It's really a question to the WiX team about the product roadmap.
Not sure I follow. Maybe it is a typo here.
Absolutely. You do not risk anything by suggesting it. . . . After some further consideration I have decided to implement WixSharp own msi pseudo-package that would overcome WiX limitation. It will be based on the ExePackage sample that I shared with you. It will help devs to face the same challenges as you do. The intended syntax will be somewhat similar to this: var bootstrapper = new Bundle("My Product",
new MsiExePackage("product.msi")
{
DisplayInternalUI = true
});
. . . This would yield the same wxs/msi as currently this code would do: var msi_upgrade_code = new MsiParser.GetProductCode("product.msi");
var bootstrapper = new Bundle("My Product",
new ExePackage("product.msi.exe") // WixSharp own msi launcher with product.msi embedded as a resource
{
Name = new MsiParser.GetProductName("product.msi"),
InstallArguments = "/i",
UninstallArguments = "/x",
RepairArguments = "/fa",
DetectCondition = "ProductInstalled",
Compressed = true
});
. . .
bootstrapper.AddWixFragment("Wix/Bundle",
new UtilRegistrySearch
{
Root = RegistryHive.LocalMachine,
Key = $@"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\{msi_upgrade_code}",
Value = "DisplayName",
Result = SearchResult.exists,
Variable = "ProductInstalled"
}); |
morning, i just tried your code. Many thanks for sharing it. Somehow it produced nullref exeception with code System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
1> bei WixSharp.Bootstrapper.Bundle.ToXml()
1> bei WixSharp.Compiler.BuildWxs(Bundle project)
1> bei WixSharp.Compiler.Build(Bundle project, String path)
1> bei WixSharp.Compiler.Build(Bundle project)
1> bei WixSharp.Bootstrapper.Bundle.Build(String path)
1> bei Bootstrapper_Custom_BA__WiX4_.Program.Main() Msi is building compelte and also msi file exists, but bundle not. Added wixextension for util and bal , doesnt do anything better. |
hm, ok, thanks again. Just tried, your example in samples works. ok, i will look at it some time later. |
Done. Will be available in the very next release. |
Your scenario sample: https://github.com/oleg-shilo/wixsharp/blob/9c9b0444c60f129f28c9c66dfd1a0ae8470b1443/Source/src/ static public void Build(string msi)
{
// This sample does what ManualBuild does but in a single step. This is because there is no need to build
// self-hosted msi as it is automatically built in MsiExePackage constructor.
Console.WriteLine("Building Bootstrapper ...");
var bootstrapper =
new Bundle("Managed Product Bundle",
new MsiExePackage(msi)
{
Name = "ManagedProduct",
});
bootstrapper.Version = new Version("1.0.0.0");
bootstrapper.UpgradeCode = new Guid("6f330b47-2577-43ad-9095-1861bb25889a");
bootstrapper.Build("my_app.exe");
} WixSharp.Samples/Wix%23%20Samples/Bootstrapper/WixBootstrapper_EmbeddedUI/setup.cs#L27 |
- The whole round trip implementation for the elevated events (#1565, #1567). Not integrated to the API yet - added `restart elevated` routine for custom BA sample - Issue #1554: Add custom Wizard-like Installer to Bundle / Burn Installer - Implemented `MsiExePackage`. Triggered by #1554 Dedicates sample `WixBootstrapper_MsiEmbeddedUI` shows how to use it ```C# var bootstrapper = new Bundle("Managed Product Bundle", new MsiExePackage(msi) { Name = "ManagedProduct", }); ``` - Issue #1557: Error when specifying Package Platform as ARM64 - WiX4: added `WixProject.WixBuildCommandGenerated` even. Triggered by #1557 - Added `CommonTasks.MapAsDeferredProperty` extension method: ```C# project.MapAsDeferredProperty("MYPROPERTY"); // instead of project.DefaultDeferredProperties += ",MYPROPERTY"; ``` - Added `string.CompleSelfHostedMsi` extension for building self executable msi files: ```C# msi.CompleSelfHostedMsi(msi + ".exe"); ``` - added calling `dotnet tool restore` when using wix as a local tool. Triggered by #1546
- Implemented `MsiExePackage`. Triggered by #1554 The dedicated sample `WixBootstrapper_MsiEmbeddedUI` shows how to use it ```C# var bootstrapper = new Bundle("Managed Product Bundle", new MsiExePackage(msi) { Name = "ManagedProduct", }); ``` - Issue #1557: Error when specifying Package Platform as ARM64 - Added `restart elevated` routine for custom BA sample - Added `WixProject.WixBuildCommandGenerated` event. Can be used to manipulate `wix.exe` command line arguments. Triggered by #1557 - Added `CommonTasks.MapAsDeferredProperty` extension method: ```C# project.MapAsDeferredProperty("MYPROPERTY"); // instead of project.DefaultDeferredProperties += ",MYPROPERTY"; ``` - Added `string.CompleSelfHostedMsi` extension for building self executable msi files: ```C# msi.CompleSelfHostedMsi(msi + ".exe"); ``` - added calling `dotnet tool restore` when using wix as a local tool. Triggered by #1546
morning, i created custom UI for Installer Wizard-like as Demo. Now i struggle to add it to Bundle. I tried to add it , but burn ignores my installer. I need some help to get it in right direction. Is there some guidline how to implement custom UI to bundle for v4 or better for v5 ? Standard WPF Template cant be modified for my purpose, unfortunatelly.
i want to create UI with custom Dialogs like FeatureTree etc. Purpose for this is create UI that i can use for Installers same UI for multiple project . I found out, how to show all files that will be "copy" / installed on target system.
The text was updated successfully, but these errors were encountered: