[wix-users] Some questions

William Fisher wfisher at summa.com
Fri Jul 14 08:00:07 PDT 2017


I appreciate any responses.  Will using the NetFx Extension force me to use
the .NET installer UI?  That doesn't match our requirements.  Here are the
problems I'm currently experiencing:

Context:  I have to install .NET 4.6.2, SQL Server Express 2014 (may
change, not particularly relevant), the client product application, and
then run a DB script.  The target systems are Windows 7 SP 1 (minimum
possible for .NET 4.6.2) through Windows 10.  32-bit and 64-bit (I have
solved any issues with this, unless that causes any of the below issues).
We cannot assume the end-user system is connected to the internet.  My
default assumption is that they have NOT done Windows Update (as they're
not connected to the internet), so Win 7 SP 1 with no updates is my
possible minimum.

1> Windows 7 has .NET 3.5, whereas Windows 10 has 4.x. The installer works
on Windows 10 (caveat the icon and some UI stuff I have to finish), but
Windows 7, it does not.  I couldn't figure out how to use NetFx extension
NetFx462Redist version with the included redistributable.  In addition, I
would like the UI for .NET installer to be my UI, not the stock .NET
installer UI.

2>  Windows 7 does not report (or WIX doesn't log, see item 3) WindowsNT,
WindowsBuild, or ServicePackValue value in Windows 7 (it works in Windows
10):
                            var versionNT =
BootstrapperApplication.Engine.NumericVariables.Contains("VersionNT")
                            ?
BootstrapperApplication.Engine.NumericVariables["VersionNT"]
                            : 1000; // Arbitrary value > 601

2.5>
https://blogs.msdn.microsoft.com/vsnetsetup/2016/03/28/a-certificate-chain-could-not-be-built-to-a-trusted-root-authority-2/
-
I need to detect if it's Windows 7 SP1 to install this certificate for
systems that are not connected to the internet (which is a possibility at
end-user locations).

3>  When logging data using
BootstrapperApplication.Engine.Log(LogLevel.Verbose, "LOG TEXT GOES HERE");
I see results in Windows 10, but nothing in Windows 7.

(Example logging from #2 and #3 combined:
[3394:32BC][2017-07-13T16:43:28]i000: ***** Windows Version:
2814749767106560.10000.10 // The first number is what WindowsNT returns for
Win10.  The 10000.10 are arbitrary values I assigned if the variable
doesn't exist.
[3394:32BC][2017-07-13T16:43:28]i000: ***** Is 64Bit OS: True
[3394:32BC][2017-07-13T16:43:28]i000: ***** Is after reboot: False
)

4>  The icon for the built installer is the stock installer icon, instead
of the icon I want it to be (which is     <Icon Id="shield.ico"
SourceFile="Resources\client_logo.ico"/> )

If anyone can get me going with #1 and #2, I'm less concerned about #3, and
#4 is definitely a "nice-to-have" to start.

NetFx DLL is referenced in the project that contains my wxs file
Relative to the project file (i.e. not in bin/Debug, just in the root of
the project), I have redist\NDP462-KB3151800-x86-x64-AllOS-ENU.exe
All the other packages successfully install when running on Windows 10.

BootstrapperCore.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="wix.bootstrapper"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup,
BootstrapperCore">
      <section name="host"
type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection,
BootstrapperCore" />
    </sectionGroup>
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
<!-- I've tried adding version="v2.0.whatever the numbers for 3.5 are", and
version ="v3.5" -->
    <supportedRuntime version="v4.0" />
  </startup>
  <wix.bootstrapper>
    <host assemblyName="ApplicationBootstrapper">
<!-- I've tried adding version="v2.0.whatever the numbers for 3.5 are", and
version ="v3.5" -->
      <supportedFramework version="v4\Client" />
    </host>
  </wix.bootstrapper>
</configuration>

Bundle.wxs:

<?xml version="1.0" encoding="UTF-8"?>
<?include Includes/ApplicationVariables.wxi ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Bundle
    Name="$(var.ProductName)"
    Version="$(var.VersionNumber)"
    Manufacturer="$(var.ManufacturerName)"
    UpgradeCode="64857b79-4f2d-48ef-ae8a-08bab1d77294"
    Compressed="yes">
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <PayloadGroupRef Id="InstallerPayload" />
    </BootstrapperApplicationRef>
 <util:User Id="SQLsa"
            Name="[sa]"
            Password="[Password1!]" />
<Chain>
<PackageGroupRef Id="CertificatePackage"/>
      <PackageGroupRef Id="NetFx462" After="CertificatePackage"/>
      <PackageGroupRef Id="SQLServerExpress2014_64Bit"/>
 <PackageGroupRef Id="SQLServerExpress2014_32Bit"/>
      <PackageGroupRef Id="Application64Bit"/>
      <PackageGroupRef Id="Application32Bit"/>
      <PackageGroupRef Id="Client.Application.Database.Installer"/>
</Chain>
</Bundle>
  <Fragment>
    <util:RegistrySearch
      Id="NETFRAMEWORK462"
      Variable="NETFRAMEWORK462"
      Root="HKLM"
      Key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
      Value="Install"
      Result="value"/>
    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx462Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="
https://msdn.microsoft.com/en-us/library/ms994405.aspx" Overridable="yes" />
    <PackageGroup Id="NetFx462">
      <ExePackage Id="NetFx462"
                  Cache="no"
                  Compressed="yes"
                  PerMachine="yes"
                  Permanent="yes"
                  Vital="yes"
                  Name="NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
                  SourceFile="redist\NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
                  DetectCondition="NETFRAMEWORK462"
                  InstallCommand="/q /norestart"/>
    </PackageGroup>
  </Fragment>
  <Fragment>
    <PayloadGroup Id="InstallerPayload">
      <!-- TODO: determine relative sources to prevent errors when moving
the solution -->
      <Payload SourceFile="C:\\Users\\310284944\\Documents\\Visual Studio
2015\\Projects\\Client.Application.Setup\\ApplicationBootstrapper\\bin\\Debug\\ApplicationBootstrapper.dll"/>
      <Payload SourceFile="C:\\Users\\310284944\\Documents\\Visual Studio
2015\\Projects\\Client.Application.Setup\\ApplicationBootstrapper\\BootstrapperCore.config"/>
      <Payload SourceFile="C:\\Users\\310284944\\Documents\\Visual Studio
2015\\Projects\\Client.Application.Setup\\ApplicationBootstrapper\\bin\\Debug\\Microsoft.Deployment.WindowsInstaller.dll"/>
      <Payload SourceFile="C:\\Users\\310284944\\Documents\\Visual Studio
2015\\Projects\\Client.Application.Setup\\Client.Application.Installer.UserInterface\\bin\\Debug\\Client.Application.Installer.UserInterface.exe"/>
      <Payload Name="redist\\NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
               SourceFile="C:\\Users\\310284944\\documents\\visual studio
2015\\Projects\\Client.Application.Setup\\Client.Application.Setup\\redist\\NDP462-KB3151800-x86-x64-AllOS-ENU.exe"/>
    </PayloadGroup>
  </Fragment>
  <Fragment>
     <!-- This package is a fix for
https://blogs.msdn.microsoft.com/vsnetsetup/2016/03/28/a-certificate-chain-could-not-be-built-to-a-trusted-root-authority-2/
on
Windows 7 - assuming I can detect Windows 7, which isn't working -->
    <PackageGroup Id="CertificatePackage">
      <MsiPackage Id="CertificatePackage"
                  Name="Client.Application.Certificate.Installer"
                  Compressed="yes"
                  Visible="no"
                  SourceFile="C:\\Users\\310284944\\Documents\\Visual
Studio
2015\\Projects\\Client.Application.Setup\\Client.Application.Certificate.Installer\\bin\\Release\\Client.Application.Certificate.Installer.msi"/>
    </PackageGroup>
  </Fragment>
  <Fragment>
    <util:RegistrySearch
      Id='SearchForSQLServerExpress64'
      Variable="ISSQLSERVER64INSTALLED"
      Result="exists"
      Root="HKLM"
      Key="SOFTWARE\Microsoft\Microsoft SQL
Server\MSSQL12.$(var.InstanceName)"
      Win64="yes" />
    <PackageGroup Id="SQLServerExpress2014_64Bit">
      <ExePackage Compressed="yes"
                  PerMachine="yes"
                  Cache="yes"
                  Vital="yes"
                  Permanent="no"
                  InstallCommand='/ACTION=Install /Q
/IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQLEngine
/INSTANCENAME=$(var.InstanceName)
/SQLSYSADMINACCOUNTS=BUILTIN\Administrators /SECURITYMODE=SQL
/SAPWD="Password1!" /SkipRules=RebootRequiredCheck'
                  UninstallCommand='/ACTION=Uninstall /Q
/FEATURES=SQLEngine /INSTANCENAME=$(var.InstanceName)'
                  SourceFile='redist\SQLEXPR_x64_ENU.exe'
                  Name="redist\SQLEXPR_x64_ENU.exe"
                  DetectCondition="Installed OR ISSQLSERVER64INSTALLED"
                  InstallCondition="VersionNT64">
        <ExitCode Behavior="forceReboot"/>
      </ExePackage>
    </PackageGroup>
  </Fragment>
  <Fragment>
    <util:RegistrySearch
      Id='SearchForSQLServerExpress32'
      Variable="ISSQLSERVER32INSTALLED"
      Result="exists"
      Root="HKLM"
      Key="SOFTWARE\Microsoft\Microsoft SQL
Server\MSSQL12.$(var.InstanceName)"
      Win64="no" />
    <PackageGroup Id="SQLServerExpress2014_32Bit">
      <ExePackage Compressed="yes"
                  PerMachine="yes"
                  Cache="yes"
                  Vital="yes"
                  Permanent="no"
                  InstallCommand='/ACTION=Install /Q
/IACCEPTSQLSERVERLICENSETERMS /FEATURES=SQLEngine
/INSTANCENAME=$(var.InstanceName)
/SQLSYSADMINACCOUNTS=BUILTIN\Administrators /SECURITYMODE=SQL
/SAPWD="Password1!" /SkipRules=RebootRequiredCheck'
                  UninstallCommand='/ACTION=Uninstall /Q
/FEATURES=SQLEngine /INSTANCENAME=$(var.InstanceName)'
                  SourceFile='redist\SQLEXPR_x86_ENU.exe'
                  Name="redist\SQLEXPR_x86_ENU.exe"
                  DetectCondition="Installed OR ISSQLSERVER32INSTALLED"
                  InstallCondition="NOT VersionNT64">
        <ExitCode Behavior="forceReboot"/>
      </ExePackage>
    </PackageGroup>
  </Fragment>
  <Fragment>
    <PackageGroup Id="Application64Bit">
      <MsiPackage
        Name="Client.Application.Installer64"
        Compressed="yes"
        SourceFile="C:\Users\310284944\Documents\Visual Studio
2015\Projects\Client.Application.Setup\Client.Application.Installer64\bin\Debug\en-US\Client.Application.Installer64.msi"
        InstallCondition="VersionNT64" />
    </PackageGroup>
  </Fragment>
  <Fragment>
    <PackageGroup Id="Application32Bit">
      <MsiPackage
        Name="Client.Application.Installer32"
        Compressed="yes"
        SourceFile="C:\Users\310284944\Documents\Visual Studio
2015\Projects\Client.Application.Setup\Client.Application.Installer32\bin\Debug\en-US\Client.Application.Installer32.msi"
        InstallCondition="NOT VersionNT64" />
    </PackageGroup>
  </Fragment>
  <Fragment>
    <!-- Placed here as this fragment is guaranteed to be included.  The
Icon and Property can
         be placed anywhere in the WIX project. -->
    <Icon Id="shield.ico" SourceFile="Resources\client_logo.ico"/>
    <Property Id="ARPPRODUCTICON" Value="shield.ico"/>
    <PackageGroup Id="Client.Application.Database.Installer">
      <MsiPackage
        Name="Client.Application.Database.Installer"
        Compressed="yes"
        SourceFile="C:\Users\310284944\Documents\Visual Studio
2015\Projects\Client.Application.Setup\Client.Application.Database.Installer\bin\Debug\en-us\Client.Application.Database.Installer.msi"/>
    </PackageGroup>
  </Fragment>
</Wix>

On Thu, Jul 13, 2017 at 6:33 PM Joel Budreau <joel.budreau at gmail.com> wrote:

> I think the recommendation is to use the NetFxExtension. Maybe you could
> get better help if you post the issues that you're running into with that
> extension?
>
> On Thu, Jul 13, 2017 at 2:06 PM, William Fisher <wfisher at summa.com> wrote:
>
> > I'm writing a custom bootstrapper application, and I'm having a few
> > issues.  Hopefully someone can help with them:
> >
> > 1>
> > https://stackoverflow.com/questions/45089379/wix-
> > installer-net-3-5-and-net-4-x
> >
> > 2>  On Windows 10, the logging statements I included to find out some
> data
> > log correctly.  On Windows 7, they do not.  Is this a known issue?
> >
> > Thanks for any input.
> > --
> > Bill Fisher   |  Technical Consultant
> > [ *m* ] 412.427.9804 <(412)%20427-9804>
> > wfisher at summa.com
> > [image: [ l ]] billfishersumma   <
> https://linkedin.com/in/billfishersumma>
> > 611 William Penn Place
> > Pittsburgh, PA 15219
> > summa.com <http://www.summa.com/> [image: Summa] <http://www.summa.com/>
> >
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
-- 
Bill Fisher   |  Technical Consultant
[ *m* ] 412.427.9804
wfisher at summa.com
[image: [ l ]] billfishersumma   <https://linkedin.com/in/billfishersumma>
611 William Penn Place
Pittsburgh, PA 15219
summa.com <http://www.summa.com/> [image: Summa] <http://www.summa.com/>



More information about the wix-users mailing list