Skip to content
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

Installer crashes when using custom UIs with Features #1464

Closed
benjveil opened this issue Mar 1, 2024 · 3 comments
Closed

Installer crashes when using custom UIs with Features #1464

benjveil opened this issue Mar 1, 2024 · 3 comments

Comments

@benjveil
Copy link

benjveil commented Mar 1, 2024

Hi,

I created a small setup from the sample wixsharp\Source\src\WixSharp.Samples\Wix# Samples\MergeModules\Consuming MergeModule\setup.cs, and it works great out of the box.

When I switch the UI to ManagedUI and add the Features dialog, the setup crash when it gets to that dialog with this exception
in the log:

...

SFXCA: Binding to CLR version v4.0.30319
Managed Dialog unhandled Exception: WixToolset.Dtf.WindowsInstaller.BadQuerySyntaxException: SQL query syntax invalid or unsupported.
   at WixToolset.Dtf.WindowsInstaller.Database.OpenView(String sqlFormat, Object args)
   at WixSharp.Extensions.OpenView(Session session, String sqlText)
   at WixSharp.UI.Forms.FeatureItem..ctor(Session session, String name)
   at WixSharp.MsiSessionAdapter.<get_Features>b__8_1(String name)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   
   ...

Any ideas?

Here is the full code:

using WixSharp;
using WixSharp.Forms;

class Script
{
    static public void Main()
    {
        var featureA = new Feature("Feature A", "Feature A description");
        var featureB = new Feature("Feature B", "Feature B description");
        var complete = new Feature("Complete");

        complete.Add(featureA)
                .Add(featureB);

        var project =
                new ManagedProject("MyMergeModuleSetup", // Switched to ManagedProject
                    new MediaTemplate { CompressionLevel = CompressionLevel.none, EmbedCab = false },
                    new Dir(@"%ProgramFiles%\My Company",
                        new Merge(featureB, @"Files\MyMergeModule.msm"),
                        new Merge(featureB, @"Files\MyMergeModule1.msm")),
                    new EnvironmentVariable("foo", "bar"));

        project.Media.Clear();
        project.DefaultFeature = complete;
        
        
        // Changed this:
        //project.UI = WUI.WixUI_FeatureTree;

        // to this:
        project.ManagedUI = new ManagedUI();
        project.ManagedUI.InstallDialogs
                .Add(Dialogs.Welcome)
                .Add(Dialogs.Features)
                .Add(Dialogs.Progress)
                .Add(Dialogs.Exit);


        project.InstallerVersion = 200;

        project.BuildMsi();
    }
}

Thank you!

@benjveil benjveil changed the title Installer Crash when using custom UI with Features Installer crashes when using custom UIs with Features Mar 1, 2024
@oleg-shilo
Copy link
Owner

It's an unfortunate defect in the implementation of FeatureItem.
It's fixed now. I will release it asap

oleg-shilo added a commit that referenced this issue Mar 3, 2024
- #1464: Installer crashes when using custom UIs with Features
- #1460: Add -sw1026 to default Wix4 argument options?
- #1459: ShortCut Icon Tooltip
- #1406: Multi-language improvement
- Added `ManagedAction` for CA implemented as native DLLs (e.g. AOT assemblies). Triggered by proposal #1456
@oleg-shilo
Copy link
Owner

It's fixed in the latest v1.25.2.0 release. Please pull the latest nuget package with the fix.

oleg-shilo added a commit that referenced this issue Mar 4, 2024
* NetCore: added integration of the NET-Core setup project with NET-Fx UI projectVS infrastructure.
* Issue #1464: Installer crashes when using custom UIs with Features
* Issue #1460: Add -sw1026 to default Wix4 argument options?
* Added `Compiler.SuppressAotWarnings` property
* Issue #1459: ShortCut Icon Tooltip
@benjveil
Copy link
Author

benjveil commented Mar 4, 2024

Wow, thanks a lot for the quick fix! It works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants