Giter Site home page Giter Site logo

Comments (13)

oleg-shilo avatar oleg-shilo commented on July 26, 2024 1

Is there possiblity wix5 hosting ba out of process

I don't know. It's really a question to the WiX team about the product roadmap.

MS Installshield Wizard

Not sure I follow. Maybe it is a typo here.

I will try your suggestion with workaround and see what outcome is.

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"
    });

from wixsharp.

Torchok19081986 avatar Torchok19081986 commented on July 26, 2024 1

hm, ok, thanks again. Just tried, your example in samples works. ok, i will look at it some time later.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on July 26, 2024 1

Done. Will be available in the very next release.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on July 26, 2024

If you are talking about MSI UI that it displayed from the bootstrapper exe then you need to set DisplayInternalUI = true.

var bundle = new Bundle("My Product Bundle",
                 new MsiPackage(productMsi)
                 {
                     Id = "MyProductPackageId",
                     DisplayInternalUI = true
                 });

from wixsharp.

Torchok19081986 avatar Torchok19081986 commented on July 26, 2024

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.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on July 26, 2024

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?
or
Are you trying to create a boostrapper with the custom (non-stock) UI that is installing an MSI that has custom/stock UI?

from wixsharp.

Torchok19081986 avatar Torchok19081986 commented on July 26, 2024

sorry, i dont write clearly. my mistake.

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? or Are you trying to create a boostrapper with the custom (non-stock) UI that is installing an MSI that has custom/stock UI?

I try second part.
I am trying to create a boostrapper with the custom (non-stock) UI that is installing an MSI that has custom/stock UI.

i try to add my project. Pls, look at it, if you had some time.

InstallWizardDemo.zip

from wixsharp.

oleg-shilo avatar oleg-shilo commented on July 26, 2024

Unfortunatelly, you have no good way achieving this.

WiX4 does not provide simple unified way of controllong MSI internal UI. Thus DisplayInternalUI does not work from custom BA and you need to use another WiX4 mechanism - PlanMsiPackage.

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.
TBH my misinterpretation is quite possible as wix3 just did not show the UI at all so when UI popped I could just take it as WixSharp own UI (msi custom UI).

I suggest you test this work around (PlanMsiPackage) as there is a small chance that what I am observing right now is caused by my environment. I hope so.

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.
image

Bootstrapper Custom BA (WiX4).zip

from wixsharp.

oleg-shilo avatar oleg-shilo commented on July 26, 2024

Now NSIS looks more and more attractive :)

from wixsharp.

Torchok19081986 avatar Torchok19081986 commented on July 26, 2024

morning, thanks again @oleg-shilo for explanation. I did not much with NSIS Bootstrapper and WixToolset / WixSharp.
for wix5 : Is there possiblity wix5 hosting ba out of process, can in future, cover such scneario or it is something another way ? I thought , i can chage one of your example to do this way. Example that i refer is ExternalUI/WpfSetup. This were my startpoint. This is exactly scenario i would like to use, BUT here i need to change UI and add wizard-like UI. MSI "embded" in UI and reflects only progress on UI. I seem many ba installer with custom UI where only 3 or 4 dialogs. Welcome, Installdir, Progress und Exit Dialogs thats it. Not all of them use MS Installshield Wizard and ~50% use wixtoolset, because log show wix toolset.
I will try your suggestion with workaround and see what outcome is.

from wixsharp.

Torchok19081986 avatar Torchok19081986 commented on July 26, 2024

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.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on July 26, 2024

This is what is working:
340057642-f532045d-8665-4bb2-8fc1-daad03a79826

I am not sure what exactly you are testing so cannot comment. But keep in mind that new ExePackage("product.msi.exe") is a pseudo-code. I do not have yet the solution for building such msi-hosted exe. In the sample I mention I built the exe by hands.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on July 26, 2024

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

from wixsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.