Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
232 views
in Technique[技术] by (71.8m points)

wix3.6 - A complete WiX 3.6 bundle example bootstrapping a .NET 4 Client Profile

I tried to construct a working example of a WiX 3.6 installation script. We currently use WiX 3.5 and now we would like to begin installing the .NET 4 Client Profile framework as a pre-requisite for our MSI file that our product.wxs script creates. WiX 3.6 seems like the best way forward.

Is there a functional example of how to do this with WiX 3.6?

Here is our 3.5 script we use today:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

    <!-- Version change handling -->
    <?define UpgradeCode="###############################"?>
    <?ifdef env.BUILD_NUMBER ?>
    <?define ProductVersion="2.6.$(env.BUILD_NUMBER).0"?>
    <?else ?>
    <?define ProductVersion="2.6.0.0"?>
    <?endif ?>

    <Product Id="*" Name="###############################" Language="1033" Version="$(var.ProductVersion)" Manufacturer="###############################" UpgradeCode="$(var.UpgradeCode)">
        <Package InstallerVersion="200" Compressed="yes" />

        <!-- Custom actions for this installer -->
        <Binary Id="###############################.dll" SourceFile="....Libraries###############################.CA.dll" />

        <!-- Kill ##### before installation begins -->
        <CustomAction Id="Kill#####ActionId" BinaryKey="###############################.dll" DllEntry="Kill#####Action" Execute="immediate" Impersonate="yes" Return="check" />
        <InstallExecuteSequence>
            <Custom Action="Kill#####ActionId" Before="InstallInitialize" />
        </InstallExecuteSequence>

        <!-- ADD/REMOVE Programs icon -->
        <Icon Id="##############.ico" SourceFile="D:##############Input_WIXNonHeat##############.exe" />
        <Property Id="ARPPRODUCTICON" Value="##############.ico" />
        <Property Id="ARPHELPLINK" Value="http://##############" />

        <!-- EULA agreement -->
        <WixVariable Id="WixUILicenseRtf" Value="D:##############Input_WIXHeatLicense.rtf" />

        <!-- Installer images -->
        <WixVariable Id="WixUIBannerBmp" Value="InstallerTopImage.rle" />
        <WixVariable Id="WixUIDialogBmp" Value="InstallerSideImage.rle" />
        <UIRef Id="WixUI_Minimal" />
        <Upgrade Id="$(var.UpgradeCode)">
            <UpgradeVersion Minimum="1.0.0.0" Maximum="99.0.0.0" Property="PREVIOUSVERSIONSINSTALLED" IncludeMinimum="yes" IncludeMaximum="no" />
        </Upgrade>

        <!-- Require ##### to be installed -->
        <Property Id="#####4.INSTALLPATH">
            <RegistrySearch Id="RegistryFoundInstallPath" Key="SOFTWAREMcNeel#####ceros4.0" Root="HKLM" Name="InstallPath" Type="directory" />
        </Property>
        <Property Id="#####4.RECENT">
            <RegistrySearch Id="RegistryFoundMostRecent" Key="SOFTWAREMcNeel#####ceros4.0" Root="HKLM" Name="MostRecent" Type="raw" />
        </Property>
        <Property Id="VRAYCOMMONDIR">
            <RegistrySearch Id="ReigstryVRayCommon" Key="SoftwareASGvis" Root="HKLM" Name="Common_dir" Type="raw" />
        </Property>
        <Condition Message="##### 4 required before install">
            #####4.RECENT
        </Condition>

        <!-- Require administrator priveleges -->
        <Condition Message="You need to be an administrator to install this product.">
            Privileged</Condition>

        <!-- Require .NET 3.5 SP1 to install -->
        <PropertyRef Id="NETFRAMEWORK35_SP_LEVEL" />
        <Condition Message='This setup requires the .NET Framework 3.5 with Service Pack 1 be installed.'>
            <![CDATA[Installed OR (NETFRAMEWORK35_SP_LEVEL AND NETFRAMEWORK35_SP_LEVEL = "#1")]]>
        </Condition>

        <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="#####4.INSTALLPATH">
                <Directory Id="#####4.SYSTEM" Name="System"></Directory>
            </Directory>

            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLLOCATION" Name="##############"></Directory>
                <Directory Id="DesktopFolder" Name="Desktop" />
                <Directory Id="ProgramMenuFolder">
                    <Directory Id="ProgramMenuDir" Name="##############" />
                </Directory>
            </Directory>

            <!-- Set FULL permissions to our shared folders -->
            <Directory Id="CommonAppDataFolder">
                <Directory Id="CommonApp##############" Name="##############">
                    <Directory Id="MODELLIBPATH" Name="##############">
                        <Component Id="##############UserPermissions" Guid="##############">
                            <CreateFolder>
                                <util:PermissionEx GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes" User="Users" Domain="[MachineName]" />
                            </CreateFolder>
                        </Component>
                    </Directory>
                    <Directory Id="APPDATAPATH" Name="#####">
                        <Component Id="##############UserPermissions" Guid="FC4BF85F-E7A4-45DE-B25C-8F9419E75307">
                            <CreateFolder>
                                <util:PermissionEx GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes" User="Users" Domain="[MachineName]" />
                            </CreateFolder>
                        </Component>
                    </Directory>
                </Directory>
            </Directory>

            <Directory Id="FontsFolder"></Directory>
            <Component Id="##############RegistryKeys" Guid="17A55BEA-605D-425a-AAEE-F35EC8C1061E" DiskId="1" KeyPath="yes">
                <RegistryValue Id="##############RegInstallDir" Root="HKLM" Key="Software############################" Name="InstallPath" Action="write" Type="string" Value="[INSTALLLOCATION]" />
                <RegistryValue Id="##############RegLibraryPath" Root="HKLM" Key="Software############################" Name="LibraryPath" Action="write" Type="string" Value="[INSTALLLOCATION]Library" />
                <RegistryValue Id="##############RegModelLibraryPath" Root="HKLM" Key="Software############################" Name="ModelLibraryPath" Action="write" Type="string" Value="[MODELLIBPATH]" />
                <RegistryKey Id="##############Reg#####PluginKey" Root="HKLM" Key="SoftwareMcNeel#####ceros4.0[#####4.RECENT]Plug-insFCAF502A-1572-42a9-A2C3-F25D7953B1A5PlugIn" Action="create" />
                <RegistryValue Id="##############RegName#####4" Root="HKLM" Key="SoftwareMcNeel#####ceros4.0[#####4.RECENT]Plug-insFCAF502A-1572-42a9-A2C3-F25D7953B1A5" Name="Name" Action="write" Type="string" Value="##############Server" />
                <RegistryValue Id="##############Reg#####4" Root="HKLM" Key="SoftwareMcNeel#####ceros4.0[#####4.RECENT]Plug-insFCAF502A-1572-42a9-A2C3-F25D7953B1A5" Name="FileName" Action="write" Type="string" Value="[INSTALLLOCATION]############################Server.rhp" />
                <RemoveRegistryKey Id="##############Skin" Root="HKLM" Key="SoftwareMcNeel#####ceros4.0Scheme: ##############" Action="removeOnInstall" />
            </Component>
            <Component Id="VRayKeys" Guid="{96E9EBAC-48B4-4517-9409-F921BE92B3AA}" DiskId="1" KeyPath="yes" NeverOverwrite="yes">
                <RegistryValue Id="VRayKey" Root="HKLM" Key="Software##############Data" Name="Data" Action="write" Type="string" Value="FFFAAA" />
            </Component>
            <Component Id="VRayRegistryKeys" Guid="{4D8815FA-85E2-421f-8BF9-F7F5A4133E96}" DiskId="1" KeyPath="yes" NeverOverwrite="yes" Permanent="yes">
                <Condition>
                    NOT VRAYCOMMONDIR
                </Condition>
                <RegistryValue Root="HKLM" Key="SoftwareASGvis" Name="common_dir" Action="write" Type="string" Value="[INSTALLLOCATION]VRayASGVIS" />
            </Component>
        </Directory>
        <Feature Id="##############Features" Title="#####" Level="1">
            <ComponentGroupRef Id="##############" />
            <ComponentRef Id="##############LibraryUserPermissions" />
            <ComponentRef Id="##############SharedUserPermissions" />
            <ComponentRef Id="##############RegistryKeys" />
            <ComponentRef Id="VRayRegistryKeys" />
            <ComponentRef Id="VRayKeys" />
            <ComponentRef Id="ProgramMenuShortcuts" />
            <ComponentRef Id="#####App" />
            <ComponentRef Id="WixShortCut" />
            <ComponentRef Id="##############ShortCut" />
            <ComponentRef Id="TroubleShortCut" />
            <ComponentRef Id="DesktopShortcut" />
            <ComponentRef Id="VRayAuth" />
            <ComponentRef Id="Fonts" />
        </Feature>
        <InstallExecuteSequence>
            <RemoveExistingProducts Before="InstallInitialize" />
        </InstallExecuteSequence>
        <UI />
    </Product>

    <Fragment>
        <Icon Id="ShortCutIcon" SourceFile="D:##############StageInput_WIXNonHeat##############.exe" />
        <Icon Id="TroubleShooterIcon" SourceFile="D:##############StageInput_WIXHeatTroubleShooterTroubleShooter.exe" />
        <Icon Id="TeamViewerIcon" SourceFile="D:##############StageInput_WIXHeatsupport.exe" />
        <DirectoryRef Id="ProgramFilesFolder">
            <Component Id="ProgramMenuShortcuts" Guid="881BD571-4FAF-4aa4-AB6E-15BB1629BE06">
                <CreateFolder Directory="ProgramMenuDir" />
                <RemoveFolder Id="RemoveMenuShortcuts" Directory="ProgramMenuDir" On="uninstall" />
                <RegistryValue Root="HKCU" Key="Software############################ShortCut" Name="InstalledStartMenuShortcuts" Type="integer" Value="1" />
            </Component>
        </DirectoryRef>
        <!-- This file is not Heat'ed, so we need this to install the executable -->
        <DirectoryRef Id="INSTALLLOCATION" FileSource="Files">
            <Component Id="##############App" Guid="FA41A015-7D80-4e50-A909-94BBA4D7546A">
                <File Id="#####_Executable" Vital="yes" Source="D:##############StageInput_WIXNonHeat##############.exe" />
            </Component>
        </DirectoryRef>
        <DirectoryRef Id="INSTALLLOCATION" FileSource="Files">
            <Component Id="WixShortCut" Guid="{8F2596B8-B7EC-4f40-AD64-DFC182A9353A}">
                <RegistryKey Root="HKCU" Key="Software############################ShortCut" Action="create">
                    <RegistryValue Name="ShortCut" Value="1" Type="integer" KeyPath="yes" />
                </RegistryKey>
                <Shortcut Id="ProgramMenuApplicationShortcut" Name="##############" T

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Heath Stewart's Introducing Managed Bootstrapper Applications provides a basic example in his blog.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...