Silent .NET Framework on WiX - wix

I have a WiX installer and, as part of the installation process, I'm installing the offline .NET Framework installer.
<ExePackage Id = "DotNetFramework.Setup" SourceFile="..\DotNetFramework\NDP461-KB3102436-x86-x64-AllOS-ENU.exe" />
Is there any way to install it in silent mode?
Every solution I find tell to launch msiexec specifying the parameters, for example:
msiexec /i product.msi APPLICATIONFOLDER="C:\Program Files\Company\Product\"
but my ExePackage just asks for the SourceFile, not a proper command

ExePackage element has an InstallCommand attribute, where you can specify the silent flag. For example:
<ExePackage
Id="SomeId"
InstallCommand="/norestart /q"
SourceFile="SomeFile.exe" />
For more information about .Net Framework Installation flags, see https://learn.microsoft.com/en-us/dotnet/framework/deployment/deployment-guide-for-developers

Related

How to uninstall inno setup application from Wix bundle

My Wix bundle is installing a few 3rd party EXE packages that are packaged with Inno setup. As you know, Inno Setup uninstaller is a separate executable. Basically, when you install AThirdParty.EXE - it creates an unin000.exe within its deployed folder ( e.g. C:\Program Files (x86)\AThirdPartyApp\unins000.exe ), and that's what I need to execute during my bundle uninstall.. Anyone know how to it with Wix Bootstrapper?
Below is an example of my ExePackage:
<PackageGroup Id="MyThirdPartyPackages">
<ExePackage Id="AThirdPartyExe"
DisplayName="A Third Party Exe"
Cache="yes"
Compressed="yes"
PerMachine="yes"
Permanent="no"
Protocol="none"
Vital="yes"
SourceFile=".\AThirdPartyExe.exe"
DetectCondition="AThirdPartyExeExists"
InstallCommand="/VERYSILENT /SUPPRESSMSGBOXES"
UninstallCommand="[ThirtdPartyEXEPath]\unins000.exe" <!-- Can I use uninstallcommand for this?? -->
/>
</PackageGroup>
Assuming Inno Setup doesn't support an /uninstall flag (no idea but if so yet another reason to only use MSI ) and you don't want to repackage the installer into an MSI the quickest solution I can think of is a man in the middle EXE.
InstallShield used to (may still) have a Helper.exe for some of it's setup prerequisites. You would code it to accept a /INSTALL and /UNINSTALL argument and have WiX call that instead. It would in turn call the actual install and uninstall as you described above.

Uninstall WiX bootstrapper after I uninstall my msi

I have one WiX setup project which produces my application's msi installer and I have also setup the uninstall shortcut feature for the application. In addition, I have a WiX bootstrapper project which detects and install .NET and VC++ during installation on the user's computer.
The bootstrapper works fine and can detect and install .net and vc++, and also install my application.
However, the issue I am facing is that when I uninstall my application using the shortcut in the Program Menu folder, it can successfully uninstall my application but there still is an entry of the bootstrapper in the "Add and Remove Programs(ARP)". I have to manually uninstall it by going on to the ARP.
My question is: How do I uninstall the bootstrapper exe without having to go to the ARP everytime? My msi uninstalls fine from the shortcut but I do not know how I can uninstall the exe with a shortcut.
This is how my bootstrapper bundle looks like:
<Chain>
<!-- NetFx46Web: Checks whether .NET 4.6 is installed in user comp. If not, install it via a web installer -->
<PackageGroupRef Id="NetFx46Web"/>
<!-- VC++ 2013 install -->
<PackageGroupRef Id="vcredist2013_x86"/>
<!-- Reference the setup msi installer -->
<MsiPackage Id="my_msi" SourceFile="$(var.InstallProj.TargetPath)" DisplayInternalUI="yes" />
</Chain>

WiX Bootstrapper - Minor Upgrade

I have a bootstrapper which is built using Burn and installs a package which i have setup to allow for minor upgrades when i run the msi packages using REINSTALL=ALL REINSTALLMODE=vomus from the command prompt (as per this article in the WiX docs).
However currently trying to upgrade with the setup.exe returns the message "Another version of this product is already installed..."
How do i get the boosttrapper to upgrade it's packages?
According to this question from 2009 burn "will be able" do the work of starting the MSI in the appropriate mode can it do it now?
I have tried using the MsiProperty element like this:
<MsiPackage Id="PackageId" SourceFile="path\to\my.msi">
<MsiProperty Name="REINSTALL" Value="ALL"/>
<MsiProperty Name="REINSTALLMODE" Value="vomus"/>
</MsiPackage>
But that doesn't seem to do it. What have i Missed?
If you are doing a minor upgrade Burn will automatically detect that and
pass the right switches for you. If you are trying to force it Burn does not support that.

How do I install drivers using Burn and DPInst after MSI installation?

I have a setup MSI for our application, and I also have signed FTDI drivers that need to be installed as well. I'd like for them to be installed with Burn rather than the WiX MSI to keep CustomActions out of the MSI (however, I've tried the CA route as well).
I've tried putting the instruction in an ExePackage, but the SourceFile attribute asks for the file location during build, not runtime (e.g. <ExePackage Id="InstallDrivers" DisplayName="Installing Drivers" SourceFile="[InstallFolder]Drivers\DPInst.exe" InstallCommand="/SA /SW" PerMachine="yes" After="MyMSISetup" Description="Installing the FTDI drivers needed for device communication." /> doesn't build).
Is there a way to tell Burn to execute DPInst using the file location of where the drivers will be after installation of the MSI? Currently the MSI copies the driver files and DPInst into a Drivers folder in the install directory. After looking online and here on Stack Overflow, I doesn't seem like anyone else is doing this.
I've also tried using the CustomAction route in the MSI, but the CustomAction fails to execute. I'd like the drivers to be installed with Burn, but if they work with the MSI I'd settle for that. Currently the MSI copies the files to the Drivers folder, and the CustomAction looks like this:
<InstallExecuteSequence>
<Custom Action="Install_Signed_Driver" After="InstallFiles">NOT INSTALLED</Custom>
</InstallExecuteSequence>
<Fragment>
<CustomAction Id=Install_Signed_Driver" Execute="deferred" Directory="Drivers" ExeCommand="[Drivers]DPInst.exe" /SW /SA" Return="ignore" />
</Fragment>
As near as I can tell, the custom action never runs. I've even taken off the /SW and /SA switches to see if anything loads, and nothing.
Per StackOverflow's suggestion, I'm posting what I found here. I was never able to get Burn to run DPInst for the driver installation, but was able to get the CustomAction to work using Can't seem to get Wix to install driver.

Prompt a Reboot message after installation WIX Bootstrapper

I have a WIX Project and a Bootstrapper of WIX.
I am using Reboot property of WIX to prompt for reboot machine after setup complete its installation.
But when i run my msi using Bootstrapper then it did not prompt a message for reboot machine.
below is my code that i am using in Product.wxs file in WIX:-
<Property Id="REBOOT" Value="Force"/>
Now i am using chain of msi in Bootstrapper project below:-
<Chain>
<MsiPackage SourceFile=".\Bonjour.msi" Compressed="yes" />
<MsiPackage SourceFile=".\Security_IDTools.msi" Compressed="yes" />
<MsiPackage SourceFile ="$(var.BiodentifySetUp.TargetPath)" Compressed ="yes" DisplayInternalUI="yes" />
</Chain>
But when my last msi run it did not prompt reboot message?
The REBOOT property does not force a reboot, and in the context you're using it is a Windows Installer property not a WiX property. The REBOOT property tells Windows what behavior should occur when a reboot occurs. You need a ScheduleReboot action in your MSI file if you want a reboot at the end of an MSI install and want to ask for it, or a ForceReboot if you want to just do it, as Nimish says.
There is also the question of why you want to force a reboot in the first place. Windows will reboot if something happens that requires one - there's no need for you to assume that a reboot is required just because an install has finished.
A Reboot may be necessary due to the stupid behavior of events and security in Windows 8 (and even in windows 7). That is the "easiest" way to make sure all of your services have been started correctly. I would expect that as already mentioned would be the best choice so that there is no abort of the bootstrapper in the middle.
Priyanka if you have any plans to continue your installation after reboot then do not use the MSI's reboot prompt with a bootstrapper.
That's because it would effectively abort the bootstrapper and won't give it a chance to resume on reboot if necessary.use <ExitCode Behavior="forceReboot" /> after MsiPackage you want it to restart. After a force reboot, Burn will automatically resume after the reboot and rest of your MSI/Exe would be installed.
But if you dont have any such plans you can go with ScheduleReboot Action in your MSI.
<InstallExecuteSequence>
<ScheduleReboot After="InstallFinalize"/>
</InstallExecuteSequence>
This will tell the MSI package to reboot after successful install.
And make sure to check log for any error.