簡體   English   中英

如何使用wix從Web安裝程序安裝.net 4.5

[英]How to install .net 4.5 from web installer using wix

第一次使用Wix,對不起,如果我的問題顯得愚蠢。 我在這里四處尋找答案,看來我需要使用捆綁包。

我的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="..\SetupProject\dotnetfx45_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="SourceFiles\MyApp.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="SourceFiles\MyApp.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="SourceFiles\MyApp.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="SourceFiles\Data.db3" KeyPath="yes">
          <CopyFile Id="Copy_DB" DestinationDirectory="EmptyDataFolderDir" DestinationName="MyDB.db3" />
        </File>
      </Component>
    </ComponentGroup>
  </Fragment>
</Wix>

但是它不喜歡包含我的捆綁包。

捆綁包是單獨的項目。 一個項目用於您的MSI,另一個項目用於您的捆綁軟件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM