oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.12k stars 175 forks source link

Another unselected feature with empty folder is installed when MSI is run #1548

Closed abskulkarni closed 3 months ago

abskulkarni commented 5 months ago

Hi @oleg-shilo When I run MSI, one feature with empty folder gets created even if I don't select that feature. "Database" feature was not selected but got installed with empty folder. Can you please guide me where should I look in script or debug it to find its root cause?

image

Torchok19081986 commented 5 months ago

Hallo, which wixsharp version do you use ? AFAIK if feature doesnt marked to install, msi doesnt install it. Look in example of wixsharp latest release, there is example of add faetures to msi. Your install behaviour somehow thinks to create folder even if feature was not selected. If you use ManagedUI try to output on FeatureDialog all features that should be installed. MessageBox.Show after next click in FeatureDialog. there is also method that get all msi feature to be installed in Dialog. Something like Features[]. You can also examinate your output wxs file. Try oleg samples with featuredialog and yours. Maybe here you can find differences. best regads, torchok.

abskulkarni commented 5 months ago

Hi I am using Wix# v3 (My project is Wix# Managed Setup Wix3)

My UI is standard feature tree like below: project.UI = WUI.WixUI_FeatureTree;

So I am not able to get Feature[] at the time of installing. Or am I wrong ?

By the way, I am adding a feature directory using below Dir constructor, where "feature" is Wix Feature class instance.

new Dir(targetDirectoryPath, new Files(feature, $@"{sourceDir}*.exe"), new Files(feature, $@"{sourceDir}*.dll"), new Files(feature, $@"{sourceDir}*.config"), new Files(feature, $@"{sourceDir}*.xml"));

oleg-shilo commented 5 months ago

I am using Wix# v3 (My project is Wix# Managed Setup Wix3) My UI is standard feature tree like below: project.UI = WUI.WixUI_FeatureTree;

It means that you are using WiX/MSI own UI that manages features the same way as in any other msi. Thus there is either something wrong with the feature definition (wxs file) or the runtime behaviour is unexpected but valid.

YOu can check wxs very easily. It is generated in the project wix subfolder.

abskulkarni commented 5 months ago

Hi @oleg-shilo

I am attaching wxs file (as text file) here. Problematic folder is "IDRDatabaseScripts" which contain two sub-folders only & they contain actual files. This folder gets created as empty even if its associated feature is not selected.

Please refer entry for in wxs file attached.

I am not sure if anything is wrong in WXS, or can you please help me out in identifying root cause of this problem?

Wxs.txt

oleg-shilo commented 5 months ago

Sorry, I do not have the capacity to troubleshoot the 11,000 lines of wxs. And TBH I am not that efficient in WiX. This is the reason why I created WixSharp :)

I can only guide you. It's clear that the problem you are experiencing is not caused by UI (you are using standard, not custom UI). So it is either normal behaviour of MSI or abnormal behaviour caused by the way features are defined in wxs.

You may want to troubleshoot it in a smaller project with only a few files and features. Dealing with 11K files setup is not easy.