如何使用Wix从Web安装程序安装.NET 4.5



第一次使用wix,如果我的问题出现愚蠢,对不起。我在这里浏览了我的答案,看来我需要使用一个捆绑包。

我有我的所有注册表,文件db的主WXS页面,但是如何在此文件中包含一个捆绑包?我有这个:

<?xml version="1.0" encoding="UTF-8"?>
<Wix 
  xmlns="http://schemas.microsoft.com/wix/2006/wi" 
  xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension"
  xmlns:ui="http://schemas.microsoft.com/wix/UIExtension" >
  <Bundle>
  </Bundle>
    <Product Id="*" Name="IMy Application Name" Language="1033" Version="2.0.0.0" Manufacturer="My Company Name" UpgradeCode="5d4e4839-11b8-403c-a440-796507b2f057">
   <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"  InstallPrivileges="elevated"   />
    <MajorUpgrade 
      AllowDowngrades="no"
      AllowSameVersionUpgrades="no"
      IgnoreRemoveFailure="no"
      DowngradeErrorMessage="loc.NewerVersionInstalled"
      Schedule="afterInstallInitialize"/>

ERRORS FROM HERE!
    <Bundle Name="Prog" Version="1.0.0.0" Manufacturer="my Corporation" UpgradeCode="*">
      <Chain>
        <PackageGroupRef Id="Netfx45FullPackage" />
      </Chain>
    </Bundle>
    <Fragment>
      <PackageGroup Id="Netfx45FullPackage">
        <ExePackage Id="Netfx45Xxx" Cache="no" Compressed="no" PerMachine="yes" Permanent="yes" Vital="no" InstallCommand="/q" SourceFile="..SetupProjectdotnetfx45_full_x86_x64.exe" DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))" InstallCondition="(VersionNT &gt;= v6.0 OR VersionNT64 &gt;= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))" />
TO HERE!
        <MsiPackage Id="MyProg" Cache="no" Compressed="no" DisplayInternalUI="yes" Vital="yes" SourceFile="$(var.installerPath)MyProgCore.msi" />
      </PackageGroup>
    </Fragment>**

    <InstallUISequence>
      <Custom Action='PreventDowngrading' After='FindRelatedProducts'>NEWPRODUCTFOUND</Custom>
    </InstallUISequence>
    <CustomAction Id='PreventDowngrading' Error='Newer version already installed' />
    <Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONROOTDIRECTORY" />

    <UI>
      <UIRef Id="WixUI_Minimal" />
      <Publish 
        Dialog="ExitDialog"
        Control="Finish"
        Event="DoAction"
        Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed
      </Publish>
    </UI>

    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch My Application" />
    <Property Id="WixShellExecTarget" Value="[#InformedWorker]" />
    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />

    <MediaTemplate EmbedCab="yes"/>

   <PropertyRef Id="NETFRAMEWORK45"/>
    <Condition Message="This application requires .NET Framework 4.5. Please install the .NET Framework then run this installer again.">
      <![CDATA[Installed OR NETFRAMEWORK20]]>
    </Condition>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="APPLICATIONROOTDIRECTORY" Name="Informed Worker"/>
        <Directory Id="OriginalFilesFolder" Name="OriginalFiles"  SourceName="SourceFiles"/>
        <Directory Id="CopiedFilesFolder" Name="My Application Name" />
      </Directory>
      <Directory Id="CommonAppDataFolder">
        <Directory Id="ConfigFOLDER" Name="My Application Name">
          <Directory Id="EmptyDataFolderDir" Name="Data" />
          <Directory Id="EmptyLogFolderDir" Name="Log" />
          <Directory Id="RegComponents" Name="Reg" />
        </Directory>
      </Directory>
      <!-- Step 1: Define the directory structure -->
      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder" Name="My Application Name"/>
        <Directory Id="DesktopFolder" Name="Desktop"></Directory>
      </Directory>
    </Directory>
    <DirectoryRef Id="APPLICATIONROOTDIRECTORY">
      <Component Id="InformedWorker" Guid="*">
        <File Id="InformedWorker" Source="SourceFilesMyApp.exe" KeyPath="yes" Checksum="yes"/>
      </Component>
    </DirectoryRef>
    <Feature Id="MainApplication" Title="Main Application" Level="1">
      <ComponentRef Id="MyApp" />
    </Feature>
    <Feature Id="ProductFeature" Title="Setup" Level="1">
      <ComponentGroupRef Id="DataFolderComponent" />
      <ComponentGroupRef Id="LogFolderComponent" />
      <ComponentGroupRef Id="RegComponents" />
      <ComponentGroupRef Id="FilesFolder" />
      <ComponentGroupRef Id="DBFolder" />
    </Feature>
    <Icon Id="InformedWorker" SourceFile="SourceFilesMyApp.exe" />
    <Property Id="ARPPRODUCTICON" Value="My Application Name" />
  </Product>
  <Fragment>
    <ComponentGroup Id="DataFolderComponent" Directory="EmptyDataFolderDir">
      <Component Id="CMP_MyEmptyDataDir" Guid="85DAD4AE-6404-4A40-B713-43538091B9D3" KeyPath="yes">
        <CreateFolder />
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="LogFolderComponent" Directory="EmptyLogFolderDir">
      <Component Id="CMP_MyEmptyLogDir" Guid="a4594ec9-3101-4627-8ee7-d60d0a9b1f63" KeyPath="yes">
        <CreateFolder />
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="RegComponents" Directory="APPLICATIONROOTDIRECTORY">
      <Component Id="RegistryEntries" Guid="9AB04D89-19B5-4729-9CD5-656C8C6B833F">
        <RegistryKey Root="HKCR" Key="My Application Name">
          <RegistryValue Type="string" Name="ClientRef" Value=""/>
        </RegistryKey>
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="FilesFolder" Directory="OriginalFilesFolder">
      <Component Id="EXE_File" Guid="*">
        <File Id="AppExe" Source="SourceFilesMyApp.exe" KeyPath="yes">
          <CopyFile Id="Copy_EXE" DestinationDirectory="APPLICATIONROOTDIRECTORY" DestinationName="MyApp.exe" />
        </File>
      </Component>
    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="DBFolder" Directory="OriginalFilesFolder">
      <Component Id="DB_File" Guid="a4eeb7a3-635c-41c3-b8c8-35c9c4f46d97">
        <File Id="AppDB" Source="SourceFilesData.db3" KeyPath="yes">
          <CopyFile Id="Copy_DB" DestinationDirectory="EmptyDataFolderDir" DestinationName="MyDB.db3" />
        </File>
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>

,但它不喜欢包含我的捆绑包..?

捆绑包是单独的项目。MSI的一个项目,一个用于捆绑的项目。

最新更新