Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:07:37+00:00 2026-06-17T09:07:37+00:00

I need to include Microsoft .NET 4.5 as a prerequisite with my installation bundle,

  • 0

I need to include Microsoft .NET 4.5 as a prerequisite with my installation bundle, and I want it as automatic as possible. However, .NET should not be removed when unistalling. I think I have read just about everything on how to use DetectCondition and/or InstallCondition, but I’m still not getting it right; it is either always running the .NET installation, or never running it.

Here’s my latest setup:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:netfx='http://schemas.microsoft.com/wix/NetFxExtension'>

  <!-- Define minimum .NET Framework version -->
  <?define NetFx45MinRelease = 377811?>
  ...
    <Chain>
      <PackageGroupRef Id="Netfx45FullPackage"/>
      ...
    </Chain>

    <PackageGroup Id="Netfx45FullPackage">
      <ExePackage Id="Netfx45Full" Cache="no" Compressed="yes" PerMachine="yes" Permanent="yes" Vital="yes"
                  SourceFile="..\..\..\..\Environment\InstallerResources\Prerequisites\dotnetfx45_full_x86_x64.exe"
                  InstallCommand="/passive /norestart"
                  DetectCondition="NETFRAMEWORK45 &gt;= $(var.NetFx45MinRelease)"
                  InstallCondition="NOT REMOVE AND (NETFRAMEWORK45 &lt; $(var.NetFx45MinRelease))" />
    </PackageGroup>

(For some reason, I had to define NetFx45MinRelease myself even though it should have been included with WixNetFxExtension.)

How can I get the settings correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:07:38+00:00Added an answer on June 17, 2026 at 9:07 am

    I’m not quite sure why you’re having problems, but I just had the same task, and it (now 😉 works as intended. That is, it installs .NET 4.5 only if required, and won’t do a .NET uninstall when uninstalling the bootstrapper as a whole.

    However, .NET 4.5 can be uninstalled individually, which I think is good.

    This is what I used (most probably derived from other Stack Overflow posts):

    <PackageGroup Id="Netfx45Xxx">
        <ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes" InstallCommand="/q"
            SourceFile="C:\wixtest\dotnetfx45_full_x86_x64.exe"
            DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))"
            InstallCondition="(VersionNT >= v6.0 OR VersionNT64 >= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))"/>
    </PackageGroup>
    

    The strange thing is that you already have Permanent=”yes”, which indeed is key to keeping .NET on uninstall.

    One difference is that I have no explicit “NOT REMOVE” in the InstallCondition, maybe that is more confusing than helpful to Windows Installer…?

    I am using WiX 3.7.1224.0, which currently is the latest.


    One comment to TheESJ’s answer: even with the predefined PackageGroupRef, you can supply a local file to avoid downloading. Simply place it in a “redist” folder below your bootstrapper EXE file, and it will be taken from there if present without downloading. I found this behaviour yesterday via the log file after a faulty install.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to include the full .NET 3.5 sp1 installer into my installer, which
I need to include a html file inside a php file, I tried using
I need to include some kind of notifications in a sidebar gadget, preferably systray
I need to include a dashboard in a JavaScript application I am building. The
I have a prototype model where I need to include the following extension methods
I'm packaging an ejb and I need to include some .classes from a dependency
I've got to modify a C program and I need to include a set
Programaticly, I need to include a google Maps map to automaticly generated pdf files.
I developed a Java desktop application in eclipse IDE.I need to include web view
Good day, I have a requirement which i need to include a layout (actually

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.